GIT and storing DBs


we have a dev database which I would like to make available to developers, some of whom may be remote. Is storing in GIT a good idea?
John DarbyPMAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GIT is not general purpose storage. Databases work better on database servers.
Gustav BrockCIOCommented:
That depends. Git will store any file, and if the purpose is to maintain a schema, it may work.

But for storing and/or sharing data it requires a disciplin that no one can live with in the long run. For this you would be better off with a cloud based database like Azure SQL or Amazon Simple Db.

It depends how do you want to store the database. Basically, Git captures whole files. Whenever the file changes, new image of the file is stored -- this is the core to think about. If the database means the file attached to the SQL engine (that is not the content exported to some text form), and if the file contains also empty blocks, calculated images, etc. (in other words, it is big), and if it is going to change often, then Git is not the perfect choice for that. The reason is the same as if you were asking whether the database backup via storing a database file is a good idea.

However, if the database captures an initial state that is not going to change very often, then the solution can be acceptable.

Git is able to store differences (optimization that is executed occasionally, takes more time, saves some space); however, it does not know how to find the differences for binary files. This way (some people report that), it is not suitable for storing video sequences (game development) and probably also not suitable for storing database files (for the same reasons).

It may be a better idea to make a tool/SQL script that is able to make the initial content of your database. The script or source code for the tool would have the form of text files. In such case Git would be perfect for the case.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SolarWinds® IP Control Bundle (IPCB)

Combines SolarWinds IP Address Manager and User Device Tracker to help detect IP conflicts, quickly identify affected systems, and help your team take near instantaneous action. Help improve visibility and enhance reliability with SolarWinds IP Control Bundle.

Steve BinkCommented:
Agree with pepr - store the SQL dump for your database, not the actual database.  Git is not the desired platform for data which changes as frequently as database tables do.
Gustav BrockCIOCommented:
Which database system/file are we talking about? Even a CSV or INI file can be a database ...

John DarbyPMAuthor Commented:
Thank you for insights; I think the method will be to generate a create.sql (for creating a new db) file and various development delta.sql files. Thank you for the help!
You can make daily clones of DB and call them snapshots, then pull schema deltas if really needed....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.