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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:52:18+00:00 2026-06-15T09:52:18+00:00

I am trying to design a database for an ecommerce project. The current models

  • 0

I am trying to design a database for an ecommerce project.

The current models are categories (which have a foreignkey to themselves) and products (which have a fk to a category). What I am trying to implement now is custom properties.

Essentially, I want to be able to dynamically specify the properties for a given category. For example, in the ‘monitors’ category, I would want to be able to specify that products in this category will have a ‘resolution’ property. Note that this is something I want to do dynamically – I do NOT want to hardcode in any properties. The obvious solution to this is to use EAV. However…

When a user navigates to a given category, I need to be able to let them specify and filter based on custom properties. In other words, I want to let a user navigate to the monitors category and specify that they only want to see monitors with a ‘resolution’ = ‘1080p’. Well, this is where it gets complicated. I need to know, just based on a category, what properties (like ‘resolution’) are available, AND what possible values they have (like ‘1080p’).

I cannot for the life of me figure out an appropriate model… can anyone point me in the right direction?

NOTE: I am currently using MySQL, but I am definitely open to other options. For example, I know that NoSQL dbs offer the ability to have N user defined files (because you are just storing arbitrary data) so if MySQL or even SQL altogether cannot provide a 1) reasonably elegant and 2) reasonably efficient solution, I am totally willing to consider other technologies.

  • 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-15T09:52:19+00:00Added an answer on June 15, 2026 at 9:52 am

    you may try to create a table with a field for the FK, another field to the custom option name and another field to the custom option value, like that:

    id = 1;
    category_id = 1; // FK
    custom_option = "resolution";
    custom_value = "1080p";
    
    id = 2;
    category_id = 1;
    custom_option = "touch sensitive";
    custom_value = "0"; // 1=Yes / 0=No
    

    So when your customer browse the monitor category, the database can return this category special custom options

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

Sidebar

Related Questions

For a current project of mine, I am trying to first design the database
I'm trying to build out a mysql database design for a project. The problem
I've been trying to design a database schema for a side project but I
I'm trying to design a data model for my current project, and I'm having
I'm trying to design a database model and I have a question. I need
I'm trying to design a system which reports activity events to a database via
I'm trying to design database structure for personal finance application. Basically I'll have Transactions
I'm trying to design a database for a small project I'm working on. Eventually,
I'm trying to come up with a clean database design for a new project
I'm trying to design application that will have UI with database in the backend.

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.