Cloud computing Multi-tenancy is used for almost all software as a service (software as a services, SaaS) applications because computing resources are scalable and the allocation of these resources is determined by actual usage. That said, users can access multiple types of SaaS applications over the Internet, from small Internet-based widgets to large enterprise software applications. Security requirements are also growing, depending on the data stored on the infrastructure of software vendors outside the Enterprise network. There are many reasons why an application needs to be multi-tenancy, the most obvious of which is cost: in most cases, adding several servers and a database for each customer is not enough, although it is useful in situations where security requirements are high.
Multi-tenancy means that multiple tenants share one instance, and the tenant's data is both isolated and shared, and ultimately, how to solve the problem of data storage.
There are now two major types of SaaS multi-tenant on data storage: stand-alone and shared databases, where shared databases can be divided into shared databases, isolated data schemas and shared databases, and shared data schemas. These three scenarios are described in the following separate ways:
Standalone Database:
This is the first scenario, a tenant a database, which has the highest level of user data isolation, security best, but also high cost.
Advantages:
Providing separate databases for different tenants helps to simplify the extended design of the data model to meet the unique needs of different tenants, and it is easier to recover data if a failure occurs.
Disadvantages:
Increases the number of installed databases, resulting in increased maintenance costs and acquisition costs.
This approach is similar to a traditional customer, set of data, and a set of deployments, except that software is deployed uniformly across the carrier. If you are facing a bank, hospital, and other tenants who require very high data isolation levels, you can choose this model to increase the pricing of your rental. If the pricing is low and the product goes down the price route, this scenario is generally unsustainable for the operator.
sharing a database, isolating the data schema
This is the second scenario where multiple or all tenants share the database, but one tenant a schema
Advantages:
Provides a level of logical data isolation for tenants with higher security requirements and is not completely isolated; Each database can support more tenants.
Disadvantages:
In the event of a failure, data recovery is difficult because the recovery database will involve data from other tenants, and if cross-tenant statistics are required, there is some difficulty.
shared database, shared data schema
This is the third scenario where tenants share the same database, the same schema, but the data in the table is differentiated by Tenantid. This is the mode with the highest degree of sharing and lowest isolation level.
Advantages:
With three scenarios compared, the third scenario has the lowest maintenance and acquisition costs, allowing the largest number of tenants to be supported per database.
Disadvantages:
The lowest level of isolation, minimum security, need to increase the amount of security development in the design development, data backup and recovery is the most difficult, you need to backup and restore by table-by-article.
This is best if you want to provide services for the largest number of tenants with the fewest servers, and tenants accept the expense of isolation in exchange for lower costs.
Summary
Three kinds of programs, such as students to separate dormitories, the isolation of the database is like 10 students a dormitory, everyone holding their own dorm keys, the general aristocracy of the treatment, students have to be local tyrants; sharing a database, isolating the data schema is like 10 students a dorm, no one has a dorm key, the average family can live ; shared database, shared data architecture is a poor family of students, 10 people a dorm, even the dormitory keys can not afford, we only have a key.
For example, each of the three options has advantages and disadvantages, and chooses the right solution according to the actual situation. The above content is I through the online Daniel's sharing and small partners to communicate with their own understanding, there are shortcomings, please criticize correct.
Copyright NOTICE: This article for Bo Master original article, reproduced please indicate the source, thank you!
SaaS Multi-tenant mode data storage Scenario