Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Jacek.

Asked: April 06, 2022 - 9:44 am UTC

Last updated: April 11, 2022 - 5:03 am UTC

Version: 19

Viewed 10K+ times! This question is

You Asked

Hi,

I am a data architect building a new database design for a web application that potentially will support hundreds of thousands of users.

Recently, one of our new hires suggested we design the database using a “multi-client” architecture.

The idea would be to build one database per user/client.

I was horrified when I first heard of this, though when I Googled it, it seems like many companies do it.

Here’s an article that explains the pros and cons that I found:
https://www.brentozar.com/archive/2011/06/how-design-multiclient-databases/#comment-3540812

It seems though that this sort of architecture might work Ok for a company building an application with several dozen clients with different data requirements, but not for a web application supporting hundreds of thousands of users.

Another idea that came up was having a schema per user rather than a database per user.

The advantage being that we could rollout changes for one group of users without affecting another group.

My feelings are that it should be the application code that controls whether a particular group of users has access to one set of features or not and not the database.

There is a security aspect in all of this as well, we have sensitive data and that is a concern we must address.

Have you ever heard or seen a “multi-client” database in action anywhere?

In your opinion, is this ever a “good” design pattern?

and Connor said...

Brent's post talks about "database" from the SQL Server perspective as opposed to the Oracle perspective. In SQL Server, a database is not the "entire thing", a single SQL Server instance can have multiple databases.

From an Oracle perspective, we would call that a pluggable database, as part of our multi-tenant architecture, and as the name suggests ("tenant") it is designed exactly for the purposes you're describing - the ability to host multiple tenants in the same (Oracle) database.

There can be shared code, shared data, and we expose the tenancy facilities that *we* use to allow multiple pluggable database to you as well via *application* containers.

More info on multitenant here

https://www.oracle.com/a/ocom/docs/multitenant-wp-19c-5395859.pdf

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Use cases

Jacek Trociński, April 08, 2022 - 8:14 am UTC

Thanks Tom, a multi-tenant architecture that uses pluggable databases seems to work well when there is a need for a relatively small number of tenants with a large amount of data per tenant or customization per tenant (e.g. SaaS applications).

For a web app that can have a large number of tenants (e.g., a banking app) each with a small amount of data I think using a shared table with a user id works best.
Connor McDonald
April 11, 2022 - 5:03 am UTC

Plenty of flexibility here for your needs

- "big" clients, pluggable database per client
- "medium", schema per client
- "small", schema or shared tables

Its always driven by what best suits your business needs

DaaS?

How much, April 08, 2022 - 2:03 pm UTC

potentially will support hundreds of thousands of users.

SE2 is licensed up 3 PDB. EE supports up to 252 PDB for extra-cost. EE-ES up to 4096 PDB for extra-cost.
For example EE for one processors (2 core x86) will costs $47500ee + $17500multitentant + %22support * 5year = $136500.
100000users / 250pdb = 400 instances (CDB).
18 processors for each instance will cost ~$1 billion.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database