S
S
sokira2020-02-17 16:12:01
Database design
sokira, 2020-02-17 16:12:01

What base structure to choose for the catalog?

I want to make a product catalog and I have a question:

What base structure should I choose for this?

If the goods can be of different types with different characteristics. For example, televisions and refrigerators.
The expected number of different types of goods in my case will be about 10-20. Each type will have 20-40 characteristics. The number of goods of each type is about 10. There will be no more than 500 sellers of these goods.

Characteristics rarely change, but for different types of goods, sets of characteristics can vary greatly.

Studying the topic, I realized that there are approximately 2 options:

Option 1 (flexible). All characteristics in one table (model EAV).
Option 2. For each type of product, create its own table with its own sets of characteristics. In this case, it is necessary to produce new tables when a new type of product appears.

There was also a variant using JSON to store characteristics in one column.

Most likely, the task of designing a database is typical, and perhaps there is some beautiful ready-made solution. Only I haven't found it yet.

I wonder how adults solve such a problem, for example. Yandex.Market ?
What is the structure of the database they have?

Can ElasticSearch help here?

---

The project is currently using laravel + mysql.
Maybe there is something ready for this bundle?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2020-02-17
@2ord

There was also a variant using JSON to store characteristics in one column.
This one is very flexible. Versions 5.7+ support JSON. 8 is good. If the necessary JSON fields are correctly indexed, then it works quickly.

A
asd111, 2020-02-17
@asd111

The first option is in small shops. The second in large ones like Yulmart. In the Yandex Market, most likely Monga or Cassandra, because the stability of the base to fall is important to them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question