开发者

is there a database that can easily digest hierarchical data besides XML?

It is very difficult for me to design the database because it requires a l开发者_运维技巧ot of recursion. I really can't use XML because it is just not practical for scalability and the amount of data I need to store. Do you guys know of a database that can be used to store hierarchical data?


SQL Server 2008 has the HierarchyId data type. It's specifically designed for this task. Proper indexing and keys will give you fast access to data in both depth-first and breadth-first searches.

http://technet.microsoft.com/en-us/library/bb677290.aspx


Maybe you want a hierarchical database like LDAP? OpenLDAP is a free implementation.


Oracle easily allows hierarchy queries with the CONNECT BY syntax

You can have a self referential table like:

Part

part_id
parent_part_id

or a couple of tables like:

Organization

org_id
name

org_relation

org_id1
org_id2


If your open to NoSQL, then I'd recommend MongoDB. It is document oriented so your not tied down to a fixed schema. It is also very scalable and performant. There are a lot of good OOP like things in it. For instance, a document can contain embedded documents so that if your database is already designed as XML, it will be mostly trivial to store in MongoDB


SQL Server also allows you to store XML files in single fields, and then easily parse specific elements/attributes from them via queries

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜