I'm trying to make a SaaS prototype and have a couple of questions on the databases.

For each saas user, their own database and their user will be created. A separate database user is needed to secure the data of other users, since SaaS provides access to the database. Own database is optimal according to a set of criteria (number of records distributed across databases, fast indexing, search, etc.), but doesn’t affect the "separate MySQL account for each user" performance? In theory, each user is only an entry in the mysql.user table, but is this true in practice? And will MySQL cope with, say, 1000 accounts no worse than one, with the same load?

Thanks in advance for your help

  • one
    MySQL does not know how to scale. There are solutions, of course, but they invariably lead to manual monitoring of the situation and unofficial prayers that everything should not be broken today, and if you have a client crawling up the load on the server that was loaded, then you will likely lose , and those whom he crush. Therefore, instead of cramming everyone into one database, I recommend raising the mysql instance per user — the game rules have changed significantly in the past five years, and any container manager will allow you to do this. - etki
  • Thanks for the advice! Recently I came across containers, but here it will be necessary to study the topic in more detail. - user2890234

0