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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:27:16+00:00 2026-05-30T02:27:16+00:00

In my codebase I recently came across a design decision made by the team

  • 0

In my codebase I recently came across a design decision made by the team where key-value pairs are stored in a formatted manner within a database(Relational-mysql) column. There is a universal set of metadata and a subset of this metadata might be present for a particular record. For a given record, its metdata subset and its values are stored in a column in a formatted manner as follows:

Key1:Value1\n\nKey2:Value2\n\nKey3:Value3\n\n.....

To get the metadata for a given record-id would then boil down to just running a simple select and then parsing the result to populate a dictionary in memory.

The rationale for doing this was cited as follows:

  1. Better performance than maintaining a denromalized table consisting of the columns recordId/Key/Value.
  2. Scalability
  3. To be conservative on space on the database server.

I can see the logic of storing these parings in the database column but something tells me this might cause problems in the longer run and may not be the panacea to our “scalability” woes.

Can somebody give some feedback on what might be wrong with this approach and what are some of the best practices on storage and retrieval of information like this on systems under heavy load.

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-30T02:27:17+00:00Added an answer on May 30, 2026 at 2:27 am

    Obviously it depends on the particular case, but this sort of 1NF violation is generally a bad approach. One significant problem is that you can’t ever query on the metadata. (E.g., “SELECT WHERE key2 = ‘value3′”) Another is that you can’t ever update a single key/value without parsing, adjusting, un-parsing, and rewriting the whole large set. To address the claims individually:

    1. Has this claim actually been tested against your data? If you only ever need one key/value from the record, you currently have to pay the database overhead to read the whole set, the network overhead to transport it to the client, and the cpu overhead to parse out the one piece you need. Doing that job inherently is precisely what the database was designed for, so you’re essentially disabling the component that excels at that sort of work and poorly emulating it with unnecessary client-side programming.

    2. How do they figure that? Storing all key/value pairs in a single field will degrade as the number of pairs increases.

    3. Almost certainly irrelevant. Disk space is cheaper than bad design.

    P.S. What happens if you have a value with two newlines in it?

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

Sidebar

Related Questions

I've recently been working through a large codebase, refactoring and generally improving design to
I came across some code recently that used a custom error handler to turn
I recently ran across the following snippet in an existing codebase I'm working on
I have seen a codebase recently that I fear is violating alignment constraints. I've
I recently found a log statement in my projects codebase that says here i
I'm working on an exceedingly large codebase, and recently upgraded to GCC 4.3, which
I recently inherited a large codebase and am having to read it. The thing
I'm recently working on this platform for which a legacy codebase issues a large
I've recently inherited the maintenance of a big, ugly codebase for a production website.
I recently joined a new company with a large existing codebase. Most of my

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.