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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:23:18+00:00 2026-05-13T22:23:18+00:00

Say you’re designing an application that, by requirement, allows a user the flexibility of

  • 0

Say you’re designing an application that, by requirement, allows a user the flexibility of creating custom types (for managing his data, whatever it may be). One way of handling this is to define a schema which allows us to use metadata for defining these types. This often means the resulting db schema will have some way of storing key/value pairs (the properties belonging to an instance of a type), where the value portion is usually stored as a string (regardless of the underlying datatype of the column). This alone presents a number of issues. I’ve read that some frown upon using a db to track key/value pairs.

The main issue I have with it is how it affects querying. For example, let’s say the user wants to create a type called Event having these columns: event_name, description, start_at and end_at (datetimes). Using key/value pairs where all values are strings makes queries more sensitive to how the parameter values are formatted; therefore, querying for a set of events falling between two dates is not as simple as it would be if we were using actual datetime columns.

This moves me to consider alternative designs which would accommodate custom types. The first one that came to mind and which I liked the most was to use the database itself to define these custom types. That is, rather than create a separate set of meta-tables into which all types must be defined, simply permit the user a limited privilege to create/modify his own tables within the database (all of which would be prefixed with his username: e.g. usertable-johndoe-album). The most prominent issue I see with this approach is the sheer number of tables that might ultimately exist. I wonder if most open-source databases (MySQL, Postgres, etc.) have either a hard or a practical limit on how many tables they can manage without being impeded. That is, I know most production-ready databases are tuned to handle millions of records, but I don’t know if they’re equipped to handle hundreds of thousands of tables. Does anyone know?

Given the requirement for allowing users to create their own types, do you prefer key/value pairs or utilizing the database itself? Or if you have another pattern/idea, please describe it.

  • 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-13T22:23:18+00:00Added an answer on May 13, 2026 at 10:23 pm

    With regards to your second idea (assumption is that when you create usertable-johndoe-album it’s structure is a mirror of an underlying base-album table):
    One thing I would say is do NOT create new tables for each user. Otherwise, if you have to change the underlying table structure in the future (for maintenance fixes, perhaps), you will then have to propgate the same change to ALL of the tables that were created by users. You might be able to find a clever way to automate this, but it still opens the door for a lot more potential trouble, IMO (not including hard upper limits to table numbers).

    I do think the metatables are the better way to approach this. It might be possible to automatically create views on the types that the user defines, this might simplify the querying the metadata. You might also want to consider having more than just keys and values in the key/value table. Having a userID would allow you to index by UserID and that might help with performance problems.

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

Sidebar

Related Questions

Let's say that I'm currently designing an application where I will need to use
A two parter: 1) Say you're designing a new type of application and you're
Let's say that I'm considering designing a WCF service whose primary purpose is to
Say you have an application divided into 3-tiers: GUI, business logic, and data access.
I'm designing an application that receives information from roughly 100k sensors that measure time-series
I'm in a process of designing a multi-tier ASP.NET web application that is supposed
We're designing an Android app that has a lot of data (customers, products, orders...),
Say I'm designing a tool that would save code snippets either in a PostgreSQL/MySQL
I'm designing a tool using Java 6, that will read data from Medical Devices.
I am looking into designing an application that can run on multiple platforms (i.e.

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.