I have 10k users in my MySQL database and for every user i need to store the last 500 events.
Please advise me, how I should design my database? One MegaEventsTable or dedicated tables for every user?
Pros of many small tables:
- I can pick fast, for example, 50 events by type from 500 entries than from 500*10k entries.
- It is faster get top 500 entries, and kill all other entries in table for this user
- I can shard my entries database some time in future
- i feel that 10k tables is HORRIBLE idea (and what if there will be 100K)