One database. N tables. In each table we have column (ex. "user"). ~1000 users.
We have to isolate data for each user from another users. How to do it?
The most common solution is use queries like SELECT * FROM TABLE_NAME WHERE USER = 3
. But the queries became more complex and the chance to make a mistake is growing.
Is there the way to do it on the level of database? I prefer to use MySQL, but if the best solution exists, I'm gonna use it.
P.S. it is impossible to create separate DB for each user.