views:

55

answers:

3

I was wondering how databases are managed in open source projects which are usually hosted in repositories like CVS or SVN. Placing codes in the SVN is very logical as it allows different team members to get updated pieces of code but how about databases?

Are their schemas and contents (.sql files I assume) placed inside the SVN too? In this case if I were creating a web application, would this require developers to keep on updating their local databases with the newest .sql file?

Or, is it more like having a central server which members can modify and their software just connects to over the net?

I'm planning to start an open source web application project (which requires the use of a database) but am a bit confused of how to go about the database management part.

+1  A: 

In my experience these types of applications usually include a database set up included with the build. Usually you have to install the DB where you need it then install the client. Also, usually these databases are also open source like MySQL or something.

northpole
I see, were you able to experience any problems regarding this kind of setup? I mean, since each one will have his/her own local database setup and all.
Paul
the only negative experience I had with this kind of thing is a lack of "how-to" directions. I have spent countless hours trying to get some open source projects to work because of the lack of documentation.
northpole
Noted :) I'll just hope and pray someone in the team loves to document haha. Thanks!
Paul
+3  A: 

Typically you would include one or two things:

  • Schema creation scripts
  • Initial data to be loaded into the database

Both of these should be text files. If your data needs any special processing before it can be loaded into the DBMS, then include a tool for that too.

One thing you should not do is include any particular binary database file in your source control. For example, a SQLite database file would not be appropriate. Binary database files are not normally portable across architectures or versions.

Greg Hewgill
I personally like the Ruby on Rails way that the schema and afterwards the migration scripts are kept in separate files with sequentially increasing numbers. This makes the schema management simpler in the long run.
Eemeli Kantola
Thanks, I'll take note of those two things! :)
Paul
+1  A: 

This depends on the project you are doing. For example if all the developers are in same location in one company, the central database server may be applicaple. If the developers are distributed around the world, then the central database server is probably out of the question and every developer creates his own copy of database for development.

I would think that most common option is that every developer uses his own database.

In any case you'll want to keep the schema creation and initial data creation files in version control. This way all the developers can create a new database easily.

Juha Syrjälä
We'd probably be working in separate locations so I guess local database would be the best way to go. Thanks :)
Paul