S
S
Sergey Stepanov2020-11-15 15:42:55
Database design
Sergey Stepanov, 2020-11-15 15:42:55

How to make a database for a store?

I can not figure it out, I reviewed the information on the network, I did not find an adequate answer. Please help me figure it out :)

There is an online store, you need to connect a database to it, in which such information should be stored (for example):

  • Meta data, by type - title, description, keywords, og:** . (they may not match the name, description of the product in the card that is displayed on the site)
  • Categories
  • Products
  • Product description
  • Related Products
  • Also information about price, description, etc.


The essence is in the meta data for the site - title, description, etc.
On each page they should be unique, but in the database itself, these fields are named the same (for example, meta_title).

I can't figure out how to store this data - create a separate table, of the "meta" type, in which I will store all the necessary meta data, and then somehow connect them to the desired page, or do I need to write meta data in each table?

I didn't find the answer to my question on the Internet, maybe I didn't search well enough. Everywhere they show only "product id, product name, description, price" with examples, but it's already clear how to store it. But what about meta data?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-11-17
@firedragon

If the metadata is weakly structured, and it happens, then it's better to do this:
Create a json type field if the database supports it and dump all the metadata there. Let the app figure it out on its own.
One but! If metadata is involved in the search, then they should be taken out of this json or duplicated in a separate field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question