Answer the question
In order to leave comments, you need to log in
How to properly store statistical data in MySQL database?
Good day friends! Project: social platform. Several thousand users are constantly working on it. How to conduct splatter analytics for each user?
Each user performs actions, transactions. They must be stored in such a way that they can be "pulled out" at any time. Yes, sampling should also be present.
Tell me the right way! Create a separate table for each user? How to pull up the data will not matter at all.
Answer the question
In order to leave comments, you need to log in
1. 10 million lines per week is not much.
2. Insert not one line at a time, but a bundle. It will be faster.
3. Keep several tables, for example, 1 table for each day. That. data decimation will be an elementary task.
4. Think about indexes.
For analytics, it is not optimal to use MySQL, it is better to look towards column bases . Although MySQL is also suitable for such a volume, broken down into tables by day, week or month.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question