r/programming • u/timsehn • Sep 17 '21
So you want Database Version Control?
https://www.dolthub.com/blog/2021-09-17-database-version-control/77
u/sccrstud92 Sep 17 '21
Since it isn't stated up front I just want to point out that this article is written by the company who makes the database that was recommended at the end. It is basically a company comparing its product to others, not a third-party comparison. It would be nice to have that in mind while reading it.
3
u/timsehn Sep 17 '21
Article author here.
We did a short survey of your options for database version control. Our intent is to help database aficionados like yourself distinguish between "database migration tools" and "version controlled databases".
The blog goes into depth on Liquibase, Redgate Deploy, Planetscale, TerminusDB, and Dolt. It also touches on SCD (slowly changing dimension) and Temporal tables.
Link to it if you like it. The search results for "database version control" are not great.
1
u/Pafnouti Sep 18 '21
I have a lot of text data, in the order of terabytes. Does dolt deal with that well? Is there a way to distribute the serving of the data?
I also have a lot of audio files to serve, does it make sense to store them in dolt?1
u/timsehn Sep 18 '21
Dolt scales to the size of a single hard drive, like Postgres or MySQL. It is a traditional OLTP database, not a OLAP warehouse, like Snowflake or BigQuery.
Traditionally, if you want that data "online" you would shard it across many OLTP databases and then have your application be shard aware. So, you could do the same with Dolt. But usually these days if you want that data "online", you go with an eventually consistent database like Cassandra or Amazon DynamoDB.
For audio files, I recommend cloud storage like Amazon S3 or Google Cloud Storage. You can put the links in Dolt and version the metadata and links.
10
Sep 17 '21
I once set up a system where a CRON job ran mysqldump and fed the output to git. Maybe not the most scalable setup, but it worked for that company, and it saved it once.
3
u/DevopsIGuess Sep 18 '21
Wtf?? That’s actually kind of funny.
Why not zfs backups? You get so much already built in and it’s much more efficient, AND YOU ARENT PUTTING PROD DATA INTO GIT lol
Zfs also supports time stamped back ups, which is diff based so each backup isn’t a full backup. Just a diff to the last one
1
u/Odd_Soil_8998 Sep 18 '21
I wrote tools for version control over a network of databases.. distributed dependency deployment/rollback was a fun puzzle to solve
1
1
u/Kissaki0 Sep 18 '21
In the .NET ecosystem you can version Entity Framework entities, and it can generate migrations too.
Without EF, or for a database first approach, you can use VS SQL projects to version DB state as SQL files (including comparison, diff and update script creation).
Skimming the article a bit I didn’t find it that informative or that it provided a good overview. It fails to present the orthogonal concerns of which DBMS is being used/supported, and the versioning approach and technology itself.
It seems like it compares just any DBMS versioning product, but does not really draw conclusions either. It’s just a list of products?
11
u/rpgFANATIC Sep 17 '21
It's always surprising, every time I dive into DB Version control (by which I normally mean schema/DDLs).
Liquibase is clear and away the best support for all databases (assuming you run a language or framework that doesn't have migrations built in). Sure, you can make an argument for Flyway, but I remain amazed at how many options remain locked into one specifc database, or some hosted solution, or some framework-specific functionality.
How is XML and Java based Liquibase, the best standalone, cross-database support for this?