有没有比 Git 更好的数据库(具有可序列化、不可变、版本化的树)?

发布于 2024-12-01 08:42:22 字数 647 浏览 2 评论 0原文

想象一下 Git 背后的数据结构。它就像一个汇合持久数据结构,只不过使用散列引用而不是传统指针。

我需要 Git 的数据结构,但没有任何工作树和索引的东西。将会有数百万个分支机构,每个分支机构都跟踪少数其他本地分支机构。不同线程上每分钟会发生数千次提交和合并。每秒都会发生拉动。

libgit2jgit 我可以使用Git的数据存储子系统。

但我是否使用了正确的工具来完成这项工作?是否有一个数据库具有 git 的功能,但速度更快/并发性更高/可扩展/阻抗不匹配更少?内存缓存写入将非常有帮助。

任务:

协作编辑的游戏。每个玩家都有自己的分支,他们对游戏世界所做的每一个更改都只会应用于他们的版本。受信任的用户将更改合并回“主”分支。数据和源代码通常捆绑在一起,需要相同的分支和合并功能。

Imagine the data structure behind Git. It's like a confluently persistent data structure, except using hash references instead of traditional pointers.

I need Git's data structure, except without any of the working tree and index stuff. And there would be millions of branches, each tracking a handful of other local branches. Commits and merges would occur several thousand times per minute on different threads. Pulls would occur every second.

Between libgit2 and jgit I can use Git's data storage subsystem.

But am I using the right tool for the job? Is there a DB that has git's features, but is faster/more concurrent/scalable/less impedance mismatch? Memory-cached writes would be extremely helpful.

The task:

A collaboratively-edited game. Every player has their own branch, and every change they make to the game world is only applied to their version. Changes are merged back into the 'master' branch by trusted users. Data and source code are often tied together, needing the same branching and merging functionality.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

野稚 2024-12-08 08:42:22

Datomic 提供持久数据存储和内置时间概念。

核心开发人员甚至创建了一个示例应用程序,将 git 存储库实现到数据库中

Datomic provides a persistent data storage and a built-in time notion.

The core developers even created a sample application that implements a git repository into the database

惜醉颜 2024-12-08 08:42:22

尽管 git 的索引/工作副本部分可以很容易地分离出来,但 git 并不是为在单台机器上以每秒数千次的速度合并或提交而设计的。在大多数情况下,核心代码甚至不是线程安全的。您可能需要为您的数据创建一些新系统(当然,您仍然可以使用 git 来编写代码,并且还可以在必要时生成 git 提交来表示您的数据等)。

Although the index/working copy parts of git can be separated out easily enough, git is not designed for merges or commits at the rate of thousands per second on a single machine. The core code is not even threadsafe, for the most part. You will likely need to create some new system for your data (you can still use git for the code, of course, and can also look into generating git commits to represent your data when necessary, etc).

柠檬 2024-12-08 08:42:22

看看 github 如何在项目之间和跨项目之间进行协作。关键在于许多用户选择复制、使用和复制他人的文件内容的方式,以便 github 核心存储库可以进行聚合。

如果您没有这种重用,那么 git 哲学可能不符合您的需求。挑战在于确定您的阻抗匹配点并努力推广它。许多人并不真正理解为什么 git 可以工作,而“普通”VCS 却不能(也就是说,旧式 VCS 最初为什么/何时工作? - 皇家邮轮泰坦尼克号的高岭土和亚麻图纸线索)。 git 之所以有效,是因为它以现代计算机功能为基础。

Have a look at how github works it terms of collaboration between and across projects. The key is in the way many users choose to copy, use and replicate the file contents of others, so that the github core repo can do the aggregation.

If you don't have that re-use then the git philosophy probably doesn't match your need. The challenge is to identify your impedance match points and promote it hard. Many folk don't really understand why git works and 'normal' VCS doesn't (that is, why/when did old style VCS work in the first place? - clue Kaolin & linen drawings for the RMS Titanic). git works because it starts with modern computer capabilities.

仅此而已 2024-12-08 08:42:22

JGit 可以使用 JDBC、HBase、Cassandra、Bigtable 等,并且它是线程安全的。

JGit can use JDBC, HBase, Cassandra, Bigtable and more and it's thread safe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文