SaaS multi-tenant mode data storage scheme

 

Reprinted: https://yq.aliyun.com/articles/325824/

  Multi-tenant cloud computing for almost all software as a service (Software as a Service, SaaS) application, because computing resources are scalable and allocation of these resources actually used by the decision. Having said that, users can access many types of SaaS applications through the Internet, Internet-based widget from small to large enterprise software applications. According to the data on the outside of the corporate network infrastructure software vendors store different security needs are growing. Multi-tenant application requires a number of reasons, the most obvious reason is cost: In most cases, increase the number of servers and a database for each customer is not enough, although in the case of high security requirements under somewhat useful to do so.

  Multi-tenancy means that multiple tenants share an instance, tenant isolation have both data sharing, in the final analysis is how to solve the problem of data storage.

  Now SaaS Multi-Tenant present on the data storage three main categories of two programs, namely: an independent database and a shared database, a shared database which can be divided into a shared database, a shared database schema and data isolation, data sharing architecture. Here were these three programs are described:

 

Independent database:

 

  This is the first embodiment, i.e. a a Tenant Database, the user data of this embodiment the highest level of isolation, the best security, but the cost is high.

advantage:

  Provide for different tenants separate database, designed to help simplify the extended data model to meet the unique needs of different tenants; If a fault occurs, data recovery is relatively simple.

Disadvantages:

  Increases the number of database installation, the attendant maintenance costs and acquisition costs.

  This solution is a traditional client, a set of data, the deployment of a similar, differing only unified software deployed in the operator there. If faced with a very high level of data isolation tenants banks, hospitals, etc., you can choose this model to improve the rental pricing. If the price is low, the products take the low road, this program is general operators can not afford.

Shared database, data architecture isolation

  This is the second program, which several or all tenants share the Database, but a Tenant a Schema

advantage:

  Provide higher security requirements of the tenant a certain degree of logical data isolation, is not completely isolated; each database can support a greater number of tenants.

Disadvantages:

  If a fault occurs, data recovery is more difficult, because the recovery database will involve data from other tenants; some difficulties if you need cross-tenants statistics exist.

Shared database, shared data architecture

  This is the third embodiment, i.e., the tenants share the same Database, the same Schema, but to distinguish the data in the table by the tenant TenantID. This is the highest degree of sharing, the lowest level of isolation mode.

advantage:

  Compare up to three programs, the lowest cost of ownership and maintenance of the third scheme, the number of database support allows each tenant.

Disadvantages:

  The lowest level of isolation, security, minimum, need to increase the amount of development in the design and development of security; data backup and recovery of the most difficult, you need to back up and restore one by one by the table.

  If you want to provide services with minimal server most tenants, and tenants at the expense of isolation level in exchange for accepting lower costs, this solution most suitable.

to sum up

  Three schemes like student dormitories points, isolated databases like 10 a person a student dormitory, each holding the key to their own quarters, elite schools have generally treated the students had a local tyrant; shared database, data architecture like isolation 10 students in a dormitory, no one is a dormitory key, the average family of students can live; shared database, shared data architecture student is at home conditions are relatively poor, 10 people a dormitory, even dormitory keys are Peibu Qi, we only A bunch of keys.

  For a simple example, the three programs have advantages and disadvantages, select the appropriate option according to the actual situation. The above is my online through the exchange and sharing of large cattle and small partners with their own understanding, inadequate, please criticism.

Guess you like

Origin www.cnblogs.com/Jeely/p/12325678.html