Is it unreasonable to assign a MySQL database to each user on my site?

前端 未结 10 2109
情歌与酒
情歌与酒 2020-12-03 00:27

I\'m creating a user-based website. For each user, I\'ll need a few MySQL tables to store different types of information (that is, userInfo, quotesSubmitted, and ratesSubmit

10条回答
  •  长情又很酷
    2020-12-03 00:34

    Use one database.

    Use one table to hold users and one table to hold quotes.

    In between those two tables you have a table that contains information to match users to quotes, this table will hold the rating that a user has given a quote.

    This simple design will allow you to store a practically unlimited number of quotes, unlimited users, and you will be able to match up each quote to zero or more users and vice versa.

    The table in the middle will contain foreign keys to the user and quote tables.

    You might find it helpful to review some database design basics, there are plenty of related questions here on stackoverflow.

    Start with these...

    What is normalisation?

    What is important to keep in mind when designing a database

    How many fields is 'too many'?

    More tables or more columns?

提交回复
热议问题