views:

71

answers:

5

It is very difficult for me to design the database because it requires a lot 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?

A: 

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

Earlz
A: 

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

dferraro
+3  A: 

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

Peter LaComb Jr.
Wow..i had no idea this existed. i am so glad I choose c# to build this project
Luke101
+1  A: 

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

Jason Day
+1  A: 

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

Randy