This sounds like a problem that should be solved in the database (SQL is functional). Perhaps the table design or queries need to be optimized? Is there a Rule table with foreign keys to SecurityGroup and OrganizationalGroup? Assuming yes, in SQL Server you could take the following steps to build the rule set:

1. build the SecurityGroup hierarchy using recursive CTE
2. likewise build the OrganizationalGroup hierarchy
3. cross join those two result sets and join that set to the Rule table

It should be possible to make this efficient with appropriate indexes.

By on 1/31/2012 9:10 PM ()

I'm not sure you answered my question, but I really appreciate the response! Maybe I'm missing something or didn't state it clearly enough.

Yes, there's no doubt that a fully-normalized set of tables is the best space-efficient means of storing the data, and SQL is a very functional language. The problem is that the overhead of cross-process communication is simply too much for each hit from a web client. This is why you see most all of the major web services use some sort of key-value RAM-based lookup as a means of keeping performance up.

I could just load up each table into a hashtable and do lookups, but the recursion involved means a lot of lookups for each hit. Since the trie structure allows me to both find the leaf and also walk all the parent nodes, I was thinking that it would be best for what I'm looking for. Perhaps it would scale linearly?

Thanks again for the reply.

By on 2/3/2012 7:11 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper