Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Hi, thank you very much for your answer, very much appreciated! You are correct that there will be a lot of duplicated data because what if the user changed only one data column, then all of the other column will remain the same. My only question is, is it fine to have for example 3 types right now, and then while in production alter the table to add another one? that's what scares me the most. Also, other than that, the design is ok? is there anything you would add? Thanks again!
Hi there! Thank you for your answer. Actually, I did thought of this solution but it made me think of some more vulenerabilities it has. for example now this admin is a complete user which means if for some reason someone might find out its credentials then he would be able to remove all the general records from the database. Also for a little debate, what if I'll need to add in the future some kind of system to determine whether or not a user record is a "trusted" record by other users. Then the first approach would be come "clustered" with unnecessary data. no?
What's more efficient than this? Its a one to many relationship. One user can have many posts. Then all you have to do is a JOIN query to receive all the posts that are associated with a user id.