Hey everyone,

I am working on setting up an eCommerce site and want to make sure the database is designed properly from the start.

For example:

Should I normalize everything or keep some denormalized tables for faster queries?

How do you usually handle product attributes and variations efficiently?

Any tips for indexing or caching that make a noticeable difference?

Would love to hear how others approach database design for online stores or similar projects.

Thanks a lot!

Recommended Answers

All 3 Replies

Your questions are too broad and would take hours to write even a compact answer addressing them. I could offer my take on "How do you usually handle product attributes and variations efficiently?" that I think is central to database schema design for eCommerce, but to give you the best advice, I first need you to answer a few questions based on your post.

You wrote you want to "make sure the database is designed properly from the start." Does that mean that there is already a database, or that you will design it from scratch? If there is, what is the schema for attributes, options, variations, etc., there? Is this database going to be used by a ready-made eCommerce solution?

Lesson learned some hundred times. For ecommerce, go with pre-built ecommerce solutions.

The worst example I can share is that my mother's workplace asked me this and a consultant said "Oh no, you need full custom."
Two years later and over 100 thousand USD (dollars) the site was not online and said consultant was asking for another funding round.

Finally the owner pulled the plug and went with a pre-built ecommerce provider and sales began in TWO WEEKS. They paid for that lesson.

I guess some will pay for this lesson rather than learn from others.

Of course, it all depends on who you are and what you are doing, but having said that, , I strongly disagree. I believe that the main reason my company has survived, so far, is that we have our own eCommerce system that we can easily, fast, and reliably alter to cover customers always changing specs and non conventional needs. I have seen the database schemas of some ready-made solutions over the years when a customer migrates to our system and wishes to keep some data. I used to be generous towards them, because most of them are open source and, furthermore, there is always the danger that when you're trying to satisfy every need, you end up with bad design choices. But now I am saying it clearly: what I have seen of ready-made eCommerce DB schema is really bad and it's obvious that whoever did that hasn't worked in the field (at least not extensively).

Because I am not an expert on ready-made solutions, perhaps there is some out there that is at least decent. Closing as I started, if you are going to search for it, understand the criteria to recognize it when you see it, and if it suits you, it all comes down to who you are and what you are doing.

commented: I didn't tell all. It was a simple(?) product. Just needed the usual cart, checkout, etc. Put products in cart, check out, done. +17
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.