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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:07+00:00 2026-05-25T19:26:07+00:00

I have an architectural question concerning custom fields in a view for an object.

  • 0

I have an architectural question concerning custom fields in a view for an object. Let’s say you have a User Object with some basic information like firstname, lastname, … that can be used by all customers.

Now, often we get a question from a customer to add couple of custom fields typical for their domain. Our solution now is an xml data column where key value pairs are stored. This has been ok so far, but now we’ll have to find a more architectural solution.

For instance, now, a customer wants a dropdown where it can select the value for its custom field. We could still store the selected value in the xml data column, but where do we store all those dropdown values…

I know that in sharepoint you can also add custom fields like dropdowns and I was wondering how to deal with this best. I want to avoid creating custom tables for customers, or having a table with 90 columns (10 basic and then 10 for each customer), …

You get the idea, it should be generic and be able to deal with all sorts of problems in the future.

What I was thinking about is a Table UserConfiguration where each record has a Foreign Key to the Customer (Channel in our database), then a column FieldName, a column FieldType and a column Values. The column values should be an xml type column, because for a dropdown, we’ll need to add multiple values. Also, each value can have extra data attached to it (not just a name). The other problem then is how to store the selected value. I don’t like the idea of having foreign keys to xml in my database (read somewhere that Azure can’t handle this all to well). Do you just store the name of the value (what if the value were to disappear out of the xml?)?

Any documentation, links on this kind of problems would also be great. I’m trying to find a design pattern that deals with this kind of problem in the database.

  • 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-25T19:26:08+00:00Added an answer on May 25, 2026 at 7:26 pm

    I want to answer your question in two parts:
    1) Implementing custom fields in a database server
    2) Restricting custom fields to an enumeration of values


    Although common solutions to 1) are discussed in the question referenced by @Simon, maybe you are looking for a bit of discussion on what the problem is and why it hasn’t been solved for us already.

    • databases are great for structured, typed data
    • custom fields are inherently less structured
    • therefore, custom fields are more difficult to work with in a database
    • some or many of the advantages of using a database are lost
      • some queries may be more difficult or impossible
      • type safety may be lost (in the database)
      • data integrity may no longer be enforced (by the database)
      • it’s a lot more work for the implementers and maintainers

    As discussed in the other question, there’s no perfect solution.
    But these benefits/features still need to be implemented somewhere, and so often the application becomes responsible for data integrity and type safety.
    For situations like these, people have created Object-Relation Mapping tools, although, as Jeff Atwood says, even using an ORM could create more problems than it solved. However, you mentioned that it ‘should be generic and be able to deal with all sorts of problems in the future’ — this makes me think an ORM might be your best bet.

    So, to sum up my answer, this is a known problem with known solutions, none of which are completely satisfactory (because it’s so hard). Pick your poison.


    To answer the second part of (what I think is) your question:
    As mentioned in the linked question, you could implement Entity-Attribute-Value in your database for custom fields, and then add an extra table to hold the legal values for each entity. Then, the attribute/value of the EAV table is a foreign key into the attribute-value table.

    For example,

    CREATE TABLE `attribute_value` ( -- enumerations go in this table
        `attribute` varchar(30), 
        `value` varchar(30), 
        PRIMARY KEY (`attribute`, `value`)
    );
    
    CREATE TABLE `eav` ( -- now the values of attributes are restricted
        `entityid` int, 
        `attribute` varchar(30), 
        `value` varchar(30), 
        PRIMARY KEY (`entityid`, `attribute`), 
        FOREIGN KEY (`attribute`, `value`) REFERENCES `attribute_value`(`attribute`, `value`)
    );
    

    Of course, this solution isn’t perfect or complete — it’s only supposed to illustrate the idea. For instance, it uses varchars, and lacks a type column. Also, who gets to decide what the possible values for each attribute are? Can these be changed at any time by the user?

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

Sidebar

Related Questions

A general architecture question in Sitecore 6... Let’s say we have a situation where
I have an architectural question. I have a project that is conceptually something like
I have an architectural question, we need to develop information system with two frontends:
I have a simple architectural question and would love some advice. I am trying
I have an architectural question on handling message ordering. For purposes of this question,
this question may seem too basic to some, but please bear with be, it's
I have an architectural question. We have many applications in our company and we
Just some architectural question: I use ASP.net MVC and exclusively rely on Strongly-Typed Views
Hi Developers/Architects, This is more of an Architectural question: I have a web application.
I am developing a Ruby on Rails website and I have an architectural question

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.