D
D
drumserLance2015-01-03 16:36:10
MySQL
drumserLance, 2015-01-03 16:36:10

How to properly organize the database structure of an online store?

I want to write an online store from scratch, mini-cms, to understand this issue from the inside. I sketched a diagram in the workbench, could you evaluate and help correct the bad places in this diagram?6bfe90a5f2b24c1495a92741b7060d6a.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
kstyle, 2015-01-03
@kstyle

www.williamspublishing.com/Books/978-5-8459-1602-0.html

M
Muhammad, 2015-01-03
@muhammad_97

1. Besides Adjacency List (as in your case) there are other tree types like Nested Sets, Materialized Path, Closure Table etc. They differ in the speed/complexity of various operations (adding, deleting, moving, selecting). Although all problems are solved by caching.
2. Why put product images in a separate table? It is enough to create an images field and store a serialized array of paths there.
3. The structure of the basket is also not clear. It is easier to create in the basket (*carts) table the customer_id fields and the products field (also a serialized list of products in the basket). It's even better to store the cart data in the session.

S
Semyon Semyonov, 2016-01-04
@man_without_face

There was a post on Habré, it was called a serious design of an online store. Or something very similar. There was more and more serious, maybe it will help you.
Alternative: find an open source solution, download it, look at the structure there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question