

Fork Your Application's Data (Not Just Your Code) - thinkbohemian
https://postgres.heroku.com/blog/past/2012/11/8/fork_your_data/

======
eggbrain
One of the biggest problems I have is that I'll branch out to a new feature
branch, modify (add/rename columns) in the db, then get sidetracked by
something where I have to switch back to master, making everything explode
because the db is still modified, while my application is calling the old
values.

I'd love it if they found a way to link up your database to a repo, so that it
could track/rollback changes easily as switching branches (I guess an sqlite
db might work, but it's not perfect)

~~~
wahnfrieden
You're using branches in production? Consider not doing that.

~~~
thibaut_barrere
It's fairly common and works pretty well if you have a good test coverage and
monitoring in place.

GitHub is a documented example (and I happen to deploy branches daily too :-):

<https://github.com/blog/1241-deploying-at-github>

~~~
wahnfrieden
I didn't say one way is strictly better. There are tradeoffs to consider and
that's all that really matters. I'm not sure it occurred to the OP that there
are benefits to forgoing remote branches, so I mentioned it.

~~~
thibaut_barrere
My bad, I read "Consider not doing that." as a more strict recommendation!

~~~
wahnfrieden
Sorry, I was too blunt :)

------
arscan
Personally I find this interesting from a marketing perspective... its not
like cloning a DB is a new concept, but by calling it "forking your data" they
make it seem quite a bit sexier.

I'm not sure if technically its the best term to use, but it does sound cool.

~~~
scdoshi
Couldn't you always clone a git repo too? But the ability to "fork" (clone
plus some setup) on github is still very useful.

------
grimlck
So you can't merge changes on the fork back to the main database?

Without the ability to merge, shouldn't it just be called 'copying'

------
thibaut_barrere
Also interesting: data clips

<https://postgres.heroku.com/dataclips>

I'll have to wait for them to become SafeHarbor compliant before using them,
though (in progress!).

------
TheMakeA
Interesting. I would take it a step further and say that everything related to
your project should be forkable and branchable. Your source, your assets, your
databases, etc. I would love to be able to go back to any moment in the
projects history and get a full, working build.

~~~
Q6T46nT668w6i3m
_I would take it a step further and say that everything related to your
project should be forkable and branchable. Your source, your assets, your
databases, etc._

Isn’t that the advantage of Perforce?

~~~
TheMakeA
It is possible with Perforce, but it is far from ideal. Compare branching in
Git to branching in Perforce. There's still a lot of room for improvement.

~~~
hythloday
You should compare branching in Git to "streaming" in Perforce:

[http://www.perforce.com/product/product_features/perforce_st...](http://www.perforce.com/product/product_features/perforce_streams)

------
CookWithMe
What about images? Should one save them in the DB? Is Postgres able to handle
high-res images?

Last time I checked (for MySQL) it was possible, but not really
recommended/wide-spread. Does anyone have practical experience with Postgres
(and Heroku)?

------
5vforest
This is neat. I've always used Amazon RDS in the past because of its ease of
import/export, but this may be enough to switch me over to Heroku's offerings.

------
sterling312
I've been wanting people to post their eigenvector/value on facial recognition
training for a while. Imagine a crowdsource trained facial recognition
database!

