r/DatabaseHelp • • Feb 04 '18

Database design HELP!

I am building a database for an app that I’m developing and have a question about how I should have my users access the database. My first thought was that I would have a global account that would create the user when they register and the user would use their MySQL username and password that they create. My second thought would be instead of using individual user accounts when a user registers, a table is created with a username and password column and when the user “ logs in” the global account checks to see if there is a table that matches the username and password columns and the global account handles the adding/removing of data within the table. I was thinking the first option makes cracking passwords more likely due to the high number of users but the second option only has one global account to crack however if the global account was cracked it would be able to manipulate all the tables from a single account? What should I do? Hopefully I conveyed my thoughts clearly and any help/advice is appreciated.

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/BinaryRockStar Feb 05 '18

I don't quite get what you're saying. For example if your entities are users you would have a table with this structure:

User
----
UserID, int, PK
UserName varchar(50)
EmailAddress varchar(255)
...

And it would contain data like this:

UserID, UserName, EmailAddress

1, 'Bob', 'bob@yahoo.com'

2, 'Alice', 'alice@hotmail.com'

3, 'Charlie', 'charlie@msn.com'

4....

So the entity here is User, not a specific user, but the concept of a user. Each row is an actual concrete user.

1

u/mackkey52 Feb 05 '18

That was pretty much what I was trying to ask but worded poorly. I wanted to know if each user should have their own table or if all users should be in a single table. Thanks