MySQL – Should a New Database Be Created for Every User?

database-designMySQL

I want to make a website which will have approximately 10M+ users. My MySQL database will be huge! Because the users will chat, post, share etc.

I will use dreamhost. They can provide me unlimted databases but they told me to keep the database size below 2-3GB. I'm afraid if I use a single database it will exceed 2-3GB in a week or two.

So the question is – should I create a new database per user?

Best Answer

Humour form for begin:

if You are plan have 10M active users, which will chat, send messages and pay for You at least couple of dollars per month - You must open Your own hosting provider, rather than try to use anybody.

If talking seriously:

  • Size of database limited only by plan (mean cost) - so 2-3Gb it just for smallest plans
  • 10M users - most important, how many of them active and what approximate but realistic data they will generate
  • what historic period they really need? as example - store 1 week history in active database and all other in archive instance
  • and 10M separate databases - will be exactly killer of Your server and application (and by resource usage, and by code complicity and by logic)