TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you manage your dev database among multiple developers?

8 pointsby sheddalmost 15 years ago
My co-founder posted this question on Stack Overflow (http://stackoverflow.com/questions/3133639/how-do-you-manage-databases-during-development) and got some good advice. I wanted to get the HN community's take on the question and see if there were any other thoughts:<p>In your agile startup, how do you handle a multi-person development team where each developer is making changes to the DB schema and everyone needs to have a current copy for local development and testing? What SCM strategies do you use and/or what software to replicate the database? Do you have a central development database?<p>Thanks for the thoughts!

5 comments

klsalmost 15 years ago
Database replication will always fail. What you need to do is treat database changes no different that software changes. Developers should make modifications to there local database (they are running local right) and then as they complete their work. The need to script the DDL and DML. This way, the changes can be versioned and applied in sequence to existing environments as well as new environments. The root of all change in a system should always be versioning, to try to manage it any other way is inviting trouble.
maxdemarzialmost 15 years ago
My employer uses .NET, but we use the "Rails" model for databases. We have population and migration script directories (for each database) which each contain numbered .sql files. Everything in SVN, update to latest, make your changes, make a migration script, commit script. Repeat.
sheddalmost 15 years ago
Clickable link to Stack Overflow question &#38; thoughts:<p><a href="http://stackoverflow.com/questions/3133639/how-do-you-manage-databases-during-development" rel="nofollow">http://stackoverflow.com/questions/3133639/how-do-you-manage...</a><p>plus the other similar thread on Stack Overflow:<p><a href="http://stackoverflow.com/questions/988426/how-should-you-build-your-database-from-source-control" rel="nofollow">http://stackoverflow.com/questions/988426/how-should-you-bui...</a>
评论 #1469596 未加载
vandahmalmost 15 years ago
Liquibase:<p><a href="http://www.liquibase.org/" rel="nofollow">http://www.liquibase.org/</a><p>The contents of our personal development databases are not synchronized, just the schema. Each developer has enough mock data to run our app for development purposes.<p>At a previous job, all developers shared a single development database. It was a huge pain, and I don't recommend that practice.
评论 #1470435 未加载
darklighter3almost 15 years ago
One option is to have your code manage the database schema it needs rather than managing the schema externally. You would have some kind of initialization routine that checks the schema and creates anything that it needs. This probably makes a little more sense if you are using some kind of OR mapping scheme so you don't have to duplicate data (some OR mapping tools can do this for you).