12

我想知道为什么 neo4j 对节点和关系有容量限制。节点和关系的限制是 2^35 1,比“正常”的 2^32 整数“稍微”多一点。常见的 SQL 数据库,例如 mysql 将主键存储为 int(2^32) 或 bigint(2^64) 2。你能解释一下这个决定的好处吗?在我看来,这是选择数据库时的关键决策点。

4

2 回答 2

12

It is an artificial limit. They are going to remove it in the not-too-distant future, although I haven't heard any official ETA.

Often enough, you run into hardware limits on a single machine before you actually hit this limit.

The current option is to manually shard your graphs to different machines. Not ideal for some use cases, but it works in other cases. In the future they'll have a way to shard data automatically--no ETA on that either.

Update: I've learned a bit more about neo4j storage internals. The reason the limits are what they are exactly, are because the id numbers are stored on disk as pointers in several places (node records, relationship records, etc.). To increase it by another power of 2, they'd need to increase 1 byte per node and 1 byte per relationship--it is currently packed as far as it will go without needing to use more bytes on disk. Learn more at this great blog post: http://digitalstain.blogspot.com/2010/10/neo4j-internals-file-storage.html

Update 2:
I've heard that in 2.1 they'll be increasing these limits to around another order of magnitude higher than they currently are.

于 2012-10-20T01:44:02.300 回答
1

从 neo4j 3.0 开始,所有这些约束都被删除了。

动态指针压缩根据需要扩展了 Neo4j 的可用地址空间,从而可以存储任意大小的图形。没错:不再有 340 亿个节点限制!

欲了解更多信息,请访问http://neo4j.com/blog/neo4j-3-0-massive-scale-developer-productivity

于 2016-05-04T16:58:25.210 回答