Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jun 23, 2018 1:40 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: To Store or Not to Store Hierarchical Paths in Database
PostPosted: Sat Nov 10, 2012 5:38 pm 
Offline

Joined: Mon Nov 24, 2008 12:25 am
Posts: 155
Hi,

I have a question about whether or not to store paths of hierarchical data into the database.

For each widget record in my database, the user will be able to have a maximum of 4 possible categories ( a minimum of 1 ). Each category is shown as a hierarchal path until the terminal category. Each category, children categories and terminal category consists of an ID and a Name.

I'm storing my hierarchical data in the database in a way so that I can retrieve it using a modified preorder tree traversal. It is explained at: http://www.sitepoint.com/hierarchical-data-database-2/

I need to be able to retrieve the complete tree and display it when a user clicks on a widget. Using a modified preorder tree traversal, it's pretty quick for me to build the tree using code. At this moment, after traversing the tree in code, I store the category Names and IDs of each part of the path in arrays. However, I was wondering if there is any benefit of storing the tree path in the database instead? I feel like maybe a class of nodes would be beneficial here?

Many Thanks!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group