Introduction to the Multitenant Architecture

Multitenancy allows for cost savings over and above the basic economies of scale achievable from consolidating IT resources into a single operation. An application instance usually incurs a certain amount of memory and processing overhead which can be substantial when multiplied by many customers, especially if the customers are small.

Since each customer will only be granted access to its own schema, it’s very easy to achieve customer isolation. Also, the data access layer is not even aware of the multitenancy architecture, meaning that, just like for catalog-based multitenancy, the data access code can focus on business requirements only.

Table of Contents

Therefore, although data is isolated, sharing resources might make it difficult to honor the Service-Level Agreement. In software terminology, multitenancy is an architectural pattern that allows you to isolate customers even if they are using the same hardware or software components.

database multi tenancy

In a catalog-based multitenancy architecture, each customer uses its own database catalog. Therefore, the tenant identifier is the database catalog itself. In a multitenancy environment, multiple customers share the same application, running on the same operating system, on the same hardware, with the same data-storage mechanism. The distinction between the customers is achieved during application design, thus customers do not share or see each other’s data. Compare this with virtualization where components are transformed, enabling each customer application to appear to run on a separate virtual machine. In any shared resource environment, administrators must manage system resources to provide a predictable environment for users and address unexpected or transient resource contention. To address these issues, and to provide resource usage monitoring, you can use Oracle Database Resource Manager.

Related Posts:

A PDB is a user-created entity that contains the data and code required for a specific set of features. For example, a PDB can support a specific application, such as a human resources or sales application. If you already have a multi-tenant system, it’s common to experience pain points with the original strategy you chose, especially as your business evolves over time. Often, this means performance and scalability issues for a variety of reasons. Perhaps the growth in the number of clients was massively above all expectations.

Instead, the ops and networking layers are wholly responsible for tenancy logic. At LightTag, we do database multi-tenancy with Django and Postgres. That means we run a SaaS with multiple customers, and each customer’s data lives in their own isolated database.

Schema per tenant, having a shared connection pool

The names Audi and Ford are used and correspond to the names of the data sources configured in grails-app/conf/application.yml. My initial thought was to share the database resources over the tenants as much as possible, but I quickly realized there are no free meals.

What is CDB and non CDB?

A non-CDB stores all metadata (system ones and user ones) in the same dictionary. A CDB stores user metadata only in the database dictionary, which have links to a common dictionary that contains the system metadata. The common container is called 'root' and the database is called 'pluggable database'.

The remaining four PDBs, each of whose names contains the prefix test, were copied from salespdb. This PDB automatically includes a full data dictionary including metadata and internal links to system-supplied objects in the root. You can only create a PDB in a CDB and not within another PDB. If you do not specify the ENABLE PLUGGABLE DATABASE clause, then the newly created database is a non-CDB and can never contain PDBs.

Approach #2: Single Database, Separate Schema

In this case, if data is leaking, the data is meaningless for other tenants. In this post I’d like to propose a method to evaluate the Relational Database appropriate architecture that matches your system’s needs. As our product matured and we started acquiring customers, we transitioned from building a product to building a SaaS business.

  • The costs of redesigning applications for multitenancy can be significant, especially for software vendors who continue to offer an on-premises single tenant version of their product.
  • The DBA team is reduced from five to three, with one CDB administrator managing the CDB while two PDB administrators split management of the PDBs.
  • Because a privilege is contained within the container in which it is granted, a local user on one PDB does not have privileges on other PDBs within the same CDB.

Shared approach definitely does seem the most reasonable approach. In hindsight, the advantages database multi-tenancy offered us significantly outweighed the costs. There are classes of problems that we don’t have and the infrastructure flexibility is very aligned with our business model. Engineering takes time and resources, which means that the cost of an ad-hoc query or a marketing experiment is high, and that slows down the business.

Leave a Reply

Your email address will not be published. Required fields are marked *