I'm writing my first web app, and I know enough about databases to know that the schema is important but not enough to know how to actually write a good one.
Is there a standard protocol for handling information stored in each user account? My instinct is to have one table that stores the user's key and log-in info, and a handle to their table (probably the key?), and then have one table for each user.
But I wonder if there are performance issues around having table for each user or if that seems an incredibly stupid way to do it. This seems like it should be a "solved problem" since basically all web apps have user accounts, but I haven't been able to find anything via search. Are there any resources with "solved" schemas for storing various sorts of web data?
Usually you would not create a separate table for each user - this solution does not scale well.
Instead you usually put all users' data into a single table (or one table per type of data) and use conditions in the WHERE clause to ensure that a user can only read/write their own data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With