S
S
Sergey Romanov2015-10-10 16:52:41
MySQL
Sergey Romanov, 2015-10-10 16:52:41

What to choose, a single database or a database for each user?

Suppose a SaaS online store application is being created. Each user can create his own store. How to organize a database. To make a common or single database where each new store will be just a key in one set of tables, or for each new store to create its own set of tables?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Makarov, 2015-10-10
@Nipheris

It all depends on what is supposed to be given to the user to manage. If the service is such that the user should never, ever access the database, then it is possible in one set of tables. Although different databases will be easier to administer and an order of magnitude safer (suddenly you forget to do WHERE by store id somewhere). If there is no common data between stores, then there are practically no advantages from using one database IMHO.

I
Ivanq, 2015-10-10
@Ivanq

Generally, it doesn't matter. But if human readability of the database is important, it is better to divide it at least by tables.

P
Puma Thailand, 2015-10-11
@opium

depends purely on how you will scale the base and shard it.
if you have a hundred users at most, then it doesn’t matter at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question