Are there any databases that support branches? [closed]
Asked Answered
H

4

6

What I'm really looking for would be the equivalent of a lightweight database snapshot that could be further modified.

The database could be huge, but the snapshot itself should be tiny and maintain a relationship to the parent.

Something like this would allow me to have, essentially, a database per branch. It could also be used for testing environment that go almost directly against production, but without the possibility of affecting it.

I most interested in relational database implementations or extensions. But would be open to anything.

Hecht answered 11/5, 2012 at 17:4 Comment(2)
It would help to know what database system you are currently using OR what DBs you are fimiliar with. The ideal answer will probably be a plug-in for a mainstream RDMS so you get may be very different answer for MS SQL Server, Oracle, MySQL, etc.Robinia
I primarily use mysql and other free databases.Hecht
S
0

I don't think branching exists for any RDBMS; about the closest you can get is cloning the entire database via backing up and restoring or BULK INSERTing into a new database.

You could try rolling your own branching system by cloning the target database's schema for each branch and storing "diffs" (i.e., edited records) in them, but that would then require querying across both databases, resolving edit conflicts, and descending into a unique circle of hell when it comes time to insert or delete records.

Personally, I'd just go with a full/partial clone for primary testing and a smaller subset for branches where you're editing the schema.

Shedd answered 11/5, 2012 at 17:38 Comment(0)
A
1

A little late to the party here but Dolt is the first version-controlled SQL database. It has branches, merges, forks, clones and all the other Git-style version control you are used to. It's MySQL compatible. It is as if Git and MySQL had a baby.

DISCLAIMER: I'm the CEO of DoltHub, the company that built it so I'm a bit biased.

Atronna answered 25/10, 2022 at 19:42 Comment(0)
S
0

I don't think branching exists for any RDBMS; about the closest you can get is cloning the entire database via backing up and restoring or BULK INSERTing into a new database.

You could try rolling your own branching system by cloning the target database's schema for each branch and storing "diffs" (i.e., edited records) in them, but that would then require querying across both databases, resolving edit conflicts, and descending into a unique circle of hell when it comes time to insert or delete records.

Personally, I'd just go with a full/partial clone for primary testing and a smaller subset for branches where you're editing the schema.

Shedd answered 11/5, 2012 at 17:38 Comment(0)
R
0

Thoughts: I also have not seen an Relational Database System that includes the notion of branching... though the concept itself seems quite useful IMHO.

I know Microsoft Team Foundation Server + Visual Studio 2010 (Premium or Ultimate editions only) has database development integration with source control via "Database Projects". I'm sure other version control systems have similar capability... but this doesn't answer your question for a lightweight or built-in DB version control system. (Therefore this is technicall NOT an answer - just some information that may help you resolve your base question).

Brief searching found some useful related articles but doesn't appear to exactly answer this request:

  1. RedGate SQL Source Control 3.0
  2. "Versioning Databases - Branching and Merging" - OdeToCode.com 2008

RedGate is a top tier DB tooling company that develops solutions for Microsoft SQL Server, Oracle, and probably other database solutions. The catch is that RedGate SQL Source Control 3.0 enables working with your version control system within SSMS (Microsoft SQL Server Management Studio) but it's not a DB VCS (version control system) on its own. Excerpt from their website:

SQL Source Control is an add-in for SQL Server Management Studio that lets you get your database into source control. SQL Source Control therefore brings the change management and collaboration benefits of source control to database development, without affecting your workflow, or requiring new development processes. Note: SQL Source Control is not a source control system; it allows you to store your databases in your existing source control system.

Robinia answered 14/5, 2012 at 15:40 Comment(1)
If it's a question of creating a new SQL Server database without the additional storage requirements, creating one or more virtual databases might be the best option. This mounts a backup file, rather than the database. red-gate.com/products/dba/sql-virtual-restoreIndigestion
P
0

I created the LiteTree

It is a modification of the SQLite engine to support branching.

Paulinepauling answered 30/8, 2018 at 2:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.