易于比较的数据库
我们有一个应用程序,其元数据信息存储在数据库中(一些具有相互关系的表)。元数据可以通过 Web 应用程序进行编辑,也可以直接操作 SQL Server 数据库中的值。
问题:元数据发生变化,需要在不同环境(测试、登台、生产等)之间进行合并。有一些工具(例如 RedGate)可以提供帮助,但如果使用自动生成的 ID(就像现在在我们的数据库中一样),比较数据库仍然需要大量工作,是的,一种方法是使用自然键来使比较更容易)。
然而,我们的元数据不一定存储在 SQL 数据库中 - 它可以作为文档存储在 NOSQL 数据库(MongoDB、CouchDB、RavenDB)甚至简单的 XML 数据库(可能是 Berkeley DB XML?)中。存储为 XML 文件似乎可行(因为比较和合并文件比数据库更容易),但可能不是一个好的选择,因为需要一些并发机制和某种程度的事务支持。 我们不需要复制到其他服务器,不需要高可用性等。
存储数据的要求:
- 某种 ACID
- 应该在 Windows 上运行
- 轻松比较(双向同步)
- (可选)GUI 以查看其中的内容数据库
- (可选)导出到文件(JSON、XML)
有哪些选项?
We have an application which has metadata information stored in database (some tables with relations between). The metadata can be edited through web app or directly manipulating values in SQL Server database.
The problem: metadata changes and needs to be merged between different environments (test, staging, production, etc.). There are tools (e.g. RedGate) that help but it is still quite a lot of work to compare databases if autogenerated ID's are being used (as it is now in our DB, and yes, one way is to use natural keys to make comparison easier).
However, our metadata may be stored not necessarily in SQL database - it could be stored as documents in NOSQL databases (MongoDB, CouchDB, RavenDB) or even simple XML databases (maybe Berkeley DB XML?). Storing as XML file seems would work (as it easier to compare and merge files rather than databases) but may not be a good option as there needs to some concurrency mechanisms, some degree of transaction support.
We do not need replication to other servers, there is no need for high availability, etc.
The requirements to store data:
- some kind of ACID
- Should run on Windows
- Easy comparison (bi-directional sync)
- (optional) GUI to see what is in database
- (optional) export to file (JSON, XML)
What are the options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么要将存储与您正在执行差异的表示混为一谈?
我会将所有内容保留在 SQL 中,但是当需要比较时,选择所有重要数据(不是 ids)为 XML 格式,并使用 XML 差异工具(或 csv 格式,并使用纯文本比较器)。
Why conflate the storage with the representation you are performing the diff on?
I'd keep everything in SQL, but when it came time to compare, select all the important data (not the ids) into a XML format, and use an XML differencing tool (or a csv format, and use a plain text comparer).
我从未使用过它,但 CouchDB 内置了对数据库之间双向同步的支持。
I have never used it but CouchDB has built-in support for birectional syncing between db's.