1

我有一个需要图形数据库的产品,不幸的是,我发现的所有图形数据库都不够成熟,要花很多钱,或者不能满足我的需求。
我想实现一个量身定制的图形数据库,它具有以下功能:

  • 图只能是有向的。
  • 数据库必须嵌入正在运行的进程中,因此它将保存在内存中。
  • 数据库只会执行以下操作:
    • 从节点读取。
    • 写入节点(创建/更新)
    • 删除节点
    • 边缘重定向(具有指向一个节点的边缘的节点现在将指向另一个节点的操作)
    • 与此问题无关的图搜索算法。
  • 图数据库只需要包含和处理三种类型的节点。

为了写这个作为概念证明,我需要知道什么?写它需要多少时间?
面向函数的方法(我知道它可以更好地处理递归)是否比面向对象的方法更适合这里?
我的约束是否使其更易于实施?

4

2 回答 2

1

The database must be embedded within the running process and thus it will be kept in memory.

You could basically use any kind of graph processing library (like QuickGraph for C#) and periodically serialize a database to disk in background thread (in case of sudden power loss or crash).

You'll need some understanding of the graph theory (of course), of multithreading, parallel computing (locks, transactions etc), but if you don't need transactions, then using libraries basically makes it a weekend project IMO.

于 2012-01-23T13:13:12.400 回答
1

如果您使用其他一些数据存储作为后端,您可以非常快速地编写概念证明,只需在顶部添加一个 graphdb API。关于项目的大小:看看 SourceForge 和 GitHub 等地方,你应该能够找到小的 graphdb 实现。然后,您可以查看源代码行与功能,并对您的项目有所了解。你没有提到事务和故障恢复之类的东西——如果你想要的话,那将需要更多的努力。

于 2011-06-27T09:59:50.310 回答