Hacker News new | ask | show | jobs
by celticjames 4887 days ago
How do other people keep databases in sync between multiple developers and the production server? Source code is easy. Source control and code merging are mostly straightforward.

But in something like wordpress, a lot of what gets displayed to the end user is in a database. Aside from page content, widgets and other configuration often ends up in a database. It's not unusual for themes to keep css, javascript or php in the database. (Every time I use a theme that allows me to put PHP into a database I feel like I've failed as a programmer and the gods of MVC will smite me.)

So developer X adds content to his dev copy. Developer Y adds content to his copy. Meanwhile, the client or end users are adding content to the production copy. Using a shared development/staging server somewhat mitigates this, but not totally. You can't just git merge the sql together. (Can you? I mean, sure you can merge two sql files. But is the end product actually usable?) Is this a solved problem?

2 comments

you would probably need to do something along the lines of creating a sql.diff file that has the difference between production and local database and then ONLY inserts into the production database so you don't overwrite changes that have occurred since you started working locally.

This is something that could be written but really would only be worth it for someone that does a ton of WordPress development...definitely an interesting problem.

Maybe a database with immutable data, like datomic?