简体   繁体   中英

Are there any databases that support branches?

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.

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" (ie, 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.

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.

I created the LiteTree

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM