there are 2 million users
each user has 4 tables . the data in 4 tables is not going to be appended and will remain fix.
the structure of each users tables will be same.
To store the data of these users in mysql i have to design a database.
do i need to create 2 million databases each with 4 tables ?
any help appreciated
the 4 tables are the the
This is an SQL antipattern that I call Metadata Tribbles. They look cute and friendly, but soon they multiply out of control.
As soon as you hear phrases beginning "I have an identical table per..." or "I have an identical column per..." then you probably have Metadata Tribbles.
You should start out by making one database with four tables, and add a
user_id attribute to each of the four tables.
There are exception cases where you'd want to split into separate databases per user, but they are exceptions. Don't go there unless you know what you're doing and can prove that it would be necessary.