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.
我最感兴趣的是关系数据库实现或扩展。但是会对任何事情持开放态度。
3 个解决方案
#1
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.
我认为任何RDBMS都不存在分支;您可以获得的最接近的是通过备份和恢复或BULK INSERTING到新数据库来克隆整个数据库。
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.
就个人而言,我只是使用完整/部分克隆进行主要测试,使用较小的子集进行编辑模式的分支。
#2
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).
我知道Microsoft Team Foundation Server + Visual Studio 2010(仅限Premium或Ultimate版本)通过“数据库项目”与源代码控制进行数据库开发集成。我敢肯定其他版本控制系统具有相似的功能......但这并不能解决您对轻量级或内置数据库版本控制系统的疑问。 (因此,这不是技术问题,而是一个答案 - 只是一些可以帮助您解决基本问题的信息)。
Brief searching found some useful related articles but doesn't appear to exactly answer this request:
简要搜索发现了一些有用的相关文章,但似乎没有完全回答这个请求:
- RedGate SQL Source Control 3.0
- "Versioning Databases - Branching and Merging" - OdeToCode.com 2008
RedGate SQL Source Control 3.0
“版本控制数据库 - 分支和合并” - 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:
RedGate是一家*数据库工具公司,为Microsoft SQL Server,Oracle以及其他可能的数据库解决方案开发解决方案。问题在于,RedGate SQL Source Control 3.0可以在SSMS(Microsoft SQL Server Management Studio)中使用您的版本控制系统,但它本身不是DB VCS(版本控制系统)。摘自他们的网站:
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.
SQL Source Control是SQL Server Management Studio的一个加载项,可让您将数据库置于源代码管理中。因此,SQL Source Control将源代码控制的变更管理和协作优势带入数据库开发,而不会影响您的工作流程或需要新的开发过程。注意:SQL Source Control不是源控制系统;它允许您将数据库存储在现有的源代码管理系统中。
#3
0
I created the LiteTree
我创建了LiteTree
It is a modification of the SQLite engine to support branching.
它是对SQLite引擎的修改,以支持分支。
#1
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.
我认为任何RDBMS都不存在分支;您可以获得的最接近的是通过备份和恢复或BULK INSERTING到新数据库来克隆整个数据库。
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.
就个人而言,我只是使用完整/部分克隆进行主要测试,使用较小的子集进行编辑模式的分支。
#2
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).
我知道Microsoft Team Foundation Server + Visual Studio 2010(仅限Premium或Ultimate版本)通过“数据库项目”与源代码控制进行数据库开发集成。我敢肯定其他版本控制系统具有相似的功能......但这并不能解决您对轻量级或内置数据库版本控制系统的疑问。 (因此,这不是技术问题,而是一个答案 - 只是一些可以帮助您解决基本问题的信息)。
Brief searching found some useful related articles but doesn't appear to exactly answer this request:
简要搜索发现了一些有用的相关文章,但似乎没有完全回答这个请求:
- RedGate SQL Source Control 3.0
- "Versioning Databases - Branching and Merging" - OdeToCode.com 2008
RedGate SQL Source Control 3.0
“版本控制数据库 - 分支和合并” - 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:
RedGate是一家*数据库工具公司,为Microsoft SQL Server,Oracle以及其他可能的数据库解决方案开发解决方案。问题在于,RedGate SQL Source Control 3.0可以在SSMS(Microsoft SQL Server Management Studio)中使用您的版本控制系统,但它本身不是DB VCS(版本控制系统)。摘自他们的网站:
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.
SQL Source Control是SQL Server Management Studio的一个加载项,可让您将数据库置于源代码管理中。因此,SQL Source Control将源代码控制的变更管理和协作优势带入数据库开发,而不会影响您的工作流程或需要新的开发过程。注意:SQL Source Control不是源控制系统;它允许您将数据库存储在现有的源代码管理系统中。
#3
0
I created the LiteTree
我创建了LiteTree
It is a modification of the SQLite engine to support branching.
它是对SQLite引擎的修改,以支持分支。