Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 46387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:57:29+00:00 2026-05-10T15:57:29+00:00

I’m working on a database design for groups hierarchy used as the foundation of

  • 0

I’m working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also ‘devices’ as leaf objects (nothing goes below device).

The database being used is MS SQL 2005. (Though working in MS SQL 2000 would be a bonus; a solution requiring MS SQL 2008 is unfortunately not feasible at this time).

There are different types of groups, and these need to be dynamic and definable at run-time by users. For example, group types might be ‘customer’, ‘account’, ‘city’, or ‘building’, ‘floor’, and each type is going to have a different set of attributes, definable by the user. There will also be business rules applied – eg, a ‘floor’ can only be contained underneath a ‘building’ group, and again, these are definable at runtime.

A lot of the application functionality comes from running reports based on these groups, so there needs to be a relatively fast way to get a list of all devices contained within a certain group (and all sub-groups).

Storing groups using modified pre-order tree traversal technique has the upside that it is fast, but the downside that it is fairly complex and fragile – if external users/applications modify the database, there is the potential for complete breakage. We’re also implementing an ORM layer, and this method seems to complicate using relations in most ORM libraries.

Using common table expressions and a ‘standard’ id/parentid groups relation seem to be a powerful way to avoid running multiple recursive queries. Is there any downside to this method?

As far as attributes, what is the best way to store them? A long, narrow table that relates back to group? Should a common attribute, like ‘name’ be stored in a groups table, instead of the attributes table (a lot of the time, the name will be all that is required to display)?

Are there going to be performance issues using this method (let’s assume a high average of 2000 groups with average of 6 attributes each, and average 10 concurrent users, on a reasonable piece of hardware, eg, quad-core Xeon 2 Ghz, 4GB ram, discounting any other processes)?

Feel free to suggest a completely different schema than what I’ve outlined here. I was just trying to illustrate the issues I’m concerned about.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:57:29+00:00Added an answer on May 10, 2026 at 3:57 pm

    I’d recommend you actually construct the easiest-to-maintain way (the ‘standard’ parent/child setup) and run at least some basic benchmarks on it.

    You’d be surprised what a database engine can do with the proper indexing, especially if your dataset can fit into memory.

    Assuming 6 attributes per group, 2000 groups, and 30 bytes/attribute, you’re talking 360KB*expected items/group — figure 400KB. If you expect to have 1000 items/group, you’re only looking at 400MB of data — that’ll fit in memory without a problem, and databases are fast at joins when all the data is in memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.