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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:23:40+00:00 2026-05-24T03:23:40+00:00

Sorry for the stupid title, but I don’t know how else to name this

  • 0

Sorry for the stupid title, but I don’t know how else to name this question 🙂

So I’m trying to build a very simple content management system that stores data in the database.

One of the data types is a “content type” (similar to WordPress’s posts / custom post types).

A content type can be whatever: a page, a car listing, a comment, a book product etc.

Each content type has its own fields. For example:

  • a page has the: title, text.
  • a car listing has: make, model, type, year, price, …
  • a book has: title, author, price

and so on…

The idea is that these content types are dynamic (and so are their fields). They would be added trough a extension of the CMS. The only built-in content type would be the page.

Anyway, I need advice on how to set up the database tables for them. This should be done from the main CMS, and not from the extensions which are supposed to be very easy to write using the CMS API.

How should I set up tables / table fields, in such a way that searching for results based on certain content type fields would be very fast?

WP uses a different table for the fields, and stores them as rows with a ID pointing to the post they are attached to. But this is pretty slow when you’re searching for multiple fields…

  • 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-24T03:23:40+00:00Added an answer on May 24, 2026 at 3:23 am

    There are a bunch of different options.

    The most common is storing “key/value” pairs (I believe this is the WP model), alongside the content item. There are many problems with this model – boolean logic when searching quickly becomes unintelligible, content types aren’t easily be defined and validated in code (e.g. “all CAR content types must have attribute engine size”), etc. However, they do make it easy to create and change content types.

    Another model is to generate database tables on the basis of the content types, usually with a “base” content item as the root. There’s a good discussion in Larman’s book on how to model the database tables (“Applying UML and patterns”). This design creates a large amount of housekeeping code – creating and modifying the database tables is a pain, and I wouldn’t recommend doing this for solutions where you’re going to need lots of content types.

    The most robust solution I’ve seen uses XML to store the content – often within a database. XML allows you to define a content type (using a DTD or schema), and validate/query it. It isn’t as fast as SQL, though…

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

Sidebar

Related Questions

Sorry if this question seems stupid, but it's stumped me for a couple days,
Sorry if this is a stupid question, but is there an easy way to
I'm sorry if it's a stupid question, but I don't now how to call
Sorry for the stupid question, but this is driving me crazy... I have test_framework.php
Really sorry for the extremely stupid title, but if I know what it is,
1:sorry for this stupid question, but I am newbie in coding and this is
Sorry if this is a stupid question, but I can't get this to work.
Sorry if this is a stupid question but sometimes I see Easter eggs and
Sorry for stupid title, first. :) Problem is very simple... .gitignore ignores me! Scenario:
sorry for stupid question. But really interesting and incomprehensible. In this session discussed about

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.