Answer the question
In order to leave comments, you need to log in
What is the best way to organize data in tables with a large number of elements in MySQL?
What is the best way to organize tables with a large number of items in MySQL?
There is a certain abstract object it has its own ID. Events are associated with this object (in my case, accidents on machines). When an event arrives at the host, it is assumed to be processed and written to the table. There are several 10 thousand events per month. You will need to contact them often. Resources on the host are limited to 2 cores 4 GB of RAM. Which is better for performance?
3) Or make 3 tables. 1 where temporary data will be written, 2 and 3 tables as in paragraph 2 data will be transferred there gradually so as not to waste resources
1) Make 1 table and write down both event data and object data there.
2) Or make 2 tables, one for events and another for objects. For the second table, as I understand it, you will have to check whether there is data with such an ID already there, and there will also be a lot of objects, several tens of thousands.
Answer the question
In order to leave comments, you need to log in
1. Without extremely good reasons, you should always start with the 3rd normal form. In this case it is a variant with 2 tables.
2. Tens of thousands of entries per month - this is not a load at all, even for the specified configuration.
To understand the principles of how to properly store large volumes in the database, I recommend that you read the good article Database Scaling through Sharding and ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question