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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:56:43+00:00 2026-05-21T16:56:43+00:00

I have to design a schema to store objects that have many properties, but

  • 0

I have to design a schema to store objects that have many properties, but few in common.

I found some solutions here, but I’m still not convinced about the best thing to do. I see four ways of doing it :

  1. One table with many fields : this may lead to many NULL values, and a hard time when the need comes to add some properties or modifiy some datatypes.
  2. Creating a new table for each property : this makes adding and updating columns easy, and preserves the searching capabilities, though each SELECT will result in lots of JOIN.
  3. Creating a table for each type of property, eg: tags, quantities, intervals, etc. I’m not sure in that case if I need to distinguish floats, decimals, integers, etc.
  4. Creating abstract tables (I read here it’s called Observation Pattern), that store the properties name and datatype.

Which criteria should I follow, which questions should I answer to choose between those solutions ?

Thanks

  • 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-21T16:56:43+00:00Added an answer on May 21, 2026 at 4:56 pm

    It depends on what you need to do with the properties. If the properties are of only indirect interest, then 4 is a very flexible and compact solution. What do I mean by an indirect interest? If you need to retrieve and display the information in the properties this is indirect. If you need to do calculations or detailed manipulations with the properties then this is more direct. In other words, if the only method you’re likely to use on the properties is “.ToString()” then you can get away with 4. This schema has the significant advantage of allowing you to add new property types without changing your database schema, since these are just new row inserts into your property type table.

    If on the other hand, the different property types need to be manipulated in ways which depend on their data types, then it will be a pain to store the different types of properties in one field. If this is the case you could do 3., but this is also a problem because it requires you to know which table to go to to get a value of a particular type. This isn’t an insurmountable problem but it isn’t elegant either.

    Instead of 3. you could try a sort of hybrid aproach where your single property table has multiple columns, one for each data type, and preferably one other column – maybe a calculated column – that acts as a “ToString”. This way your indirect uses can go to the simple, predictable spot and only your more involved applications need to worry about which column to go to for a particular property type.

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

Sidebar

Related Questions

I have a design issue that I would appreciate some input on. I would
I've always felt that my graphic design skills have lacked, but I do have
I have started design of a ColdFusion application that is entirely web based. Not
Suppose I have a design like this: Object GUI has two objects: object aManager
For my university assignment I have to design some basic managment system for sicknesses
The majority of resources that I have for UI design all deal with the
I'm curious whether many of us who do design or take design decisions have
I'm try to design a XSD schema that allow elements to be in a
I have a question, but let me first say that this is being performed
I have a script that appends some rows to a table. One of the

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.