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 3286874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:25:47+00:00 2026-05-17T20:25:47+00:00

Thinking of building a nested category system using chained strings for lack of a

  • 0

Thinking of building a nested category “system” using “chained strings” for lack of a better term. Here’s the plan:

A category slug could be something like “shopping-clothing-womens”. This would correlate to a 3 deep category: Shopping > Clothing > Women’s.

An object in the database would have a category field, containing the slug. Let’s say there are several objects, with varying slugs in the Shopping > Clothing category, perhaps: “shopping-clothing-mens”, “shopping-clothing-kids” and “shopping-clothing-other”.

I’d have a collection, or a dictionary, that would translate that slug into something more meaningful for end-users (for example, “shopping-clothing-womens” -> “Women’s Clothing”).

If I wanted to select all the objects that were in the Shopping > Clothing category, I’d do something like this:

DB.Objects.Where(a => a.Category.Contains("shopping-clothing"));

And would get back all the women’s, men’s, kids and clothing subcategories of the Shopping > Clothing category.

The goal is simple querying, yet remain powerful with capabilities of near endless sub categorization without insane DB relations and JOINS. I’m also leaning toward perhaps adapting my application to a NoSQL database in the future, this would help in implementing that.

But, the query above worries me… would it be slow?

Is this plan a bad idea?

  • 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. Editorial Team
    Editorial Team
    2026-05-17T20:25:47+00:00Added an answer on May 17, 2026 at 8:25 pm

    This sounds like a good idea. The only direct problem I see is that it would be difficult to rename categories. One way to solve this would be to chain the internal ID’s of the categories instead of the codes.

    Concerning the Contains, I would probably go for StartsWith. This would produce a LIKE 'shopping-clothing%' and is a lot faster with the correct index.

    One more tip: if you append every category with a dash, you won’t get problems if one category has the same prefix as another like "shopping-clothing-womans-". Then you can always use StartsWith("shopping-clothing-").

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

Sidebar

Related Questions

I'm thinking about building a login system for Ruby on Rails, much like this
So lately I've been thinking of building and implementing my own invoice system with
I am thinking of building some kind of hook function system. Basically a couple
I'm thinking of building a small web app using the MVC framework as a
I was considering using openID for a site I am thinking of building but
We are currently thinking of building a cache-system to hold data pulled out of
I'm thinking of building a multi-player game using GAE. When player A makes a
I was thinking about building a method that I could pass in the connString
I was thinking of building my own MVC system with a member system. However,
I was thinking of building a web app which would be single page, using

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.