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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:40:21+00:00 2026-06-11T15:40:21+00:00

A question about table structure. Here is a small scenario to introduce the question:

  • 0

A question about table structure.

Here is a small scenario to introduce the question:
Imagine you want to store objects of a class (let A) in a table.

You have two possible table structure to do so:

Structure A: "one field per row":
id (int),
name (text),
credit (int),
birthday (date).

Structure B: "all data in one row":
id (int),
data (bigtext).

Consider the following:

  • You will NEVER execute requests filtering/sorting the fields name/credit/birthday
  • Before editing a field, you want to load the object
  • Fields name/credit/birthday have no options/modifiers (keys/unique/…)

What is the difference between theses two table structure ?

.

Concretely, I’m doing a PHP/SQLITE app that – at one point – needs to store objects in database. I’d like to be able to easily add db-stored-class without having to edit my db scheme each time I do so. Using “structure B” would allow me to do so.
It may look dirty and yea you’ve probably be teached that you need to have nicely typed rows.. but why not ?

Isn’t the main advantage of “structure A” only the effectiveness of select filters and updates ?

  • 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-06-11T15:40:22+00:00Added an answer on June 11, 2026 at 3:40 pm

    You’re talking about handling all your data integrity in the business layer/web app which is totally acceptable these days.

    Rather than using a table structure at all, why not just store a JSON object? That way you don’t have to worry about schema changes and you can just serialize/deserialize the object for use with your front end.

    Maybe consider using a key/value store (a NOSQL solution) for something like this although any database will suffice really.

    To answer your question – the difference is in being able to query against the fields, validate data, maintain data integrity etc whereas in structure B you’re handling all of this outside of the database in the application.

    Regarding your perceived limitation about not being able to query against the object, MapReduce will allow you to run aggregate queries over your JSON data.

    Go for option B if you need the flexibility and don’t need the other benefits a structured database provides, go for option A if you want to validate your data in the database and run queries more easily over it.

    The advantages of structure A are data integrity rules close to the data, and ability to easily query your data in many different ways.

    The advantages of structure B are extensibility and scalability – you can change your data structures easily in the application and also if you need to scale you can horizontally partition your data easily.

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

Sidebar

Related Questions

I have a question about MySQL. I have this table structure: ID Name ------
I just saw this dating site on builtwithbootstrap and have a question about table
I have a question about Access.If for example I have a table with the
i have one question about jquery ajax().. I created a table grid and there
I have a simple question about the barplot function. I have a TRUE/FALSE table
This question is not about caching. I need this in-memory table for many small
I have a question about removing all elements after the current one. here's the
I had a question about indices on a table and I put it up
Question about subclassing in matlab, under the new class system. I've got class A
Question about GridView sorting in VB.NET: I have a GridView with AutoGenerateColumns = True

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.