Answer the question
In order to leave comments, you need to log in
What is the best way to organize data storage in mysql?
I plan to create a large web service with tens of thousands of records (products and announcements, news). Now I am laying the foundation for Back-end and Fron-end, I have already created it, I have no complaints. I had no experience with a database for high-load projects.
I want the database to be as fast as everything else that I have created.
The essence of the question is simple: As you all know, the largest block of data is stored in the html (longtext) column.
An average of 30 kilobytes of data, a maximum of 100 kilobytes. The remaining data is a maximum of 0.2-1 kilobytes.
table product : id - title - description - keywords - html - thumb
It makes more sense to store html in a separate table, since it is rarely used - only when it hits the product page. In other cases, such as product search, category sections, sorting, hashtags, etc. - it is not used at all.
For example, if you remove html from a table, it will become ten times smaller, will it be effective for performance and data transfer speed? While the size of the database itself will remain unchanged.
Answer the question
In order to leave comments, you need to log in
title - description - html
can be placed in a single field of type JSON (Mysql 5.7+) . Then it's easier to add new fields without changing the database.
If html is not used independently of other fields, then let it stay in the same table.
What is the thumb field?
keywords should be placed in a separate table, indexed by hashtag
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question