Should I use a single or multiple database setup for a multi-client application?

前端 未结 10 737
囚心锁ツ
囚心锁ツ 2020-11-30 17:50

I am working on a PHP application that intends to ease company workflow and project management, let\'s say something like Basecamp and GoPlan.

I am not sure on what

10条回答
  •  萌比男神i
    2020-11-30 18:29

    Having a database per client generally does not scale well. MySQL (and probably other databases) holds resources open per table, this does not lend itself well to 10k+ tables on one instance, which would happen in a large-scale multitenancy situation.

    Of course, if you have some other issue which causes other problems before you get to this level, this may not be relevant.

    Additionally, "sharding" a multi-tenant application is likely€ to be the right thing to do eventually as your application gets bigger and bigger.

    Sharding does not however mean one database (or instance) per tenant, but one per shard or set of shards, which may have several tenants each. You will need to discover the right tuning parameters for yourself, probably in production (hence it probably needs to be pretty tunable from the outset)

    € I can't guarantee it.

提交回复
热议问题