Saas application management framework and method based on double isolation of tenants and system

By adopting Spring Boot and Mybatis-Plus technologies in multi-tenant SaaS applications, double isolation of tenants and systems is achieved, and the problem of data isolation between different tenants and systems is solved, which improves development efficiency and simplicity of system management, and reduces the Cost and complexity.

CN119322609APending Publication Date: 2025-01-17QIMING INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411484873.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

In multi-tenant SaaS applications, it is difficult for the prior art to achieve simultaneous data isolation between different tenants and systems, resulting in increased business data confusion and management complexity.

Method used

Adopting Spring Boot-based microservice development framework, combining Mybatis-Plus and Seata technology, through the tenant and system dual isolation module, the tenant ID and system ID are used to perform data isolation, realizing tenant isolation and system isolation, ensuring accurate data distinction and management .

Benefits of technology

It realizes data isolation between different tenants and systems, reduces development complexity and operation and maintenance complexity, improves development efficiency and system scalability, and reduces database costs and management consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322609A_ABST
    Figure CN119322609A_ABST
Patent Text Reader

Abstract

The invention discloses a Saas application management framework and method based on double isolation of tenants and a system, the method comprises tenant isolation and system isolation, the tenant isolation uses a multi-tenant use method provided by mybatisplus, a configuration class of mybatis is packaged, and acquisition of tenant Id is realized by realizing a Tenant LineHandler interface. The application management framework provided by the invention does not need to pay attention to excessive underlying architectures, most of energy can be put into concentrated development, various component supports and toolkits are provided in the framework, and the framework can be used after being opened, so that the development efficiency is improved, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software backend architecture, and in particular to a SaaS application management framework and method based on double isolation of tenants and systems. Background Art

[0002] As the most important technology of current SaaS applications, multi-tenancy is receiving more and more attention and concern. Its basic idea is that in order to reduce the cost of SaaS applications, multiple enterprises share software and hardware facilities, and the service provider is responsible for managing and maintaining resources. In addition to reducing the overall resource consumption, this model can also reduce the cost of software operation and management consumption, making it easier to update and maintain software.

[0003] Multi-tenant architecture is the most essential feature that distinguishes the SaaS model from the traditional software model system. In the traditional software model, each customer has a separate running instance, and these instances are deployed separately and have different configurations according to the different needs of the customers. The pay-per-use delivery and operation model of the software in the SaaS service model determines that SaaS software is a multi-tenant model, which can effectively reduce the hardware and maintenance costs of SaaS applications and maximize the effect of SaaS applications. Therefore, for economic benefits, the realization of the SaaS model application system must implement a multi-tenant system architecture design.

[0004] On the basis of multi-tenancy, the system acts as the middle platform of the business, providing a service architecture to the outside world. For different business systems of the company, the systems are independent of each other, but they will use the basic services provided by the middle platform, such as the management of users, organizations, permissions, and menus. Each system configuration is related to itself, so the middle platform needs to increase the isolation between systems during design. For different tenants and system isolation, the company may have the same tenant but different systems, and different Party A companies outside the company may have different tenants and different systems, so both must be done to isolate the business internally. Summary of the invention

[0005] The present invention proposes a SaaS application management framework and method based on double isolation of tenants and systems, so as to achieve internal isolation of different tenants and different systems at the same time.

[0006] First, a SaaS application management framework based on double isolation of tenants and systems, a complete framework for implementing microservice development based on Spring Boot, and the development of distributed system infrastructure using Spring Boot, including the following modules: Spring Boot module: As the core of the entire framework, it is used to build the infrastructure of distributed microservice systems; Spring Cloud module: implements distributed system functions, including microservice registration, discovery, load balancing, gateway, and circuit breaker; Mybatis-Plus module: As the data access layer, it provides enhanced CRUD functions and multi-tenant support to simplify database operations; Multi-tenant plug-in module: provides multi-tenant extension for Mybatis-Plusd to isolate tenants of data; System isolation module: provides isolation capabilities based on system dimensions to avoid confusion of business data from different systems; Distributed transaction support module: Ensure the consistency of cross-service transactions with Seata.

[0007] Specifically, the microservice development includes: configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision campaigns, distributed sessions, and cluster state management components.

[0008] Specifically, the development of the infrastructure includes: service discovery registration, configuration center, message bus, load balancing, circuit breaker and data monitoring.

[0009] Specifically, the application management framework also includes one or more tenants, multi-tenant applications and a database; a table space is set in the database.

[0010] Specifically, each table in the database table space needs to add fields of tenant id and system id to distinguish different tenants and systems; tenant tables and system tables are also added to record tenant and system information.

[0011] On the other hand, a Saas application management method based on double isolation of tenants and systems is implemented based on the Saas application management framework based on double isolation of tenants and systems described in the right, including tenant isolation and system isolation. The tenant isolation uses the multi-tenant usage method provided by mybatisplus to encapsulate the configuration class of mybatis, and realizes the acquisition of tenantId by implementing the TenantLineHandler interface. The tenant isolation specifically includes: when the request header carries qfctid and passes the authentication of the microservice gateway, the corresponding tenantId will be obtained in the scaffolding; the corresponding tenant id is automatically spliced ​​during the query through the multi-tenant plug-in of MyBatis-Plus to realize tenant isolation of a single table.

[0012] Specifically, in the tenant isolation, each SQL executed by the tenant will automatically carry the tenant id.

[0013] Specifically, the system isolation includes: when the front end chooses to switch the system, the current system ID is carried in the corresponding request header qfcsid. After authentication by the microservice gateway, the back-end scaffolding will obtain the currently selected system id. When performing data CRUD, it determines whether the table to be operated is a table that needs system isolation, and determines whether the corresponding system id needs to be spliced.

[0014] Specifically, the system isolation also includes: performing a separate configuration for different tables, multiple tables are separated by commas, and the configured tables will execute the SQL splicing system id.

[0015] Beneficial effects of the present invention: The present invention proposes a SaaS application management framework and method based on dual isolation of tenants and systems, which solves the problem of simultaneous data isolation of different tenants and systems, and has the following technical advantages: Unified Framework: The main idea of ​​the unified framework is to enable developers to be on the same platform and to unify the architectural models of various systems as much as possible, so as to achieve the goal of unified interface specifications, unified data transmission models, and unified developer code styles.

[0016] Object-oriented: Object-oriented is the original programming paradigm for software development. However, the rise of rapid development models in recent years has mostly adopted data-oriented anti-pattern development processes. This invention standardizes the object-oriented domain set, allowing developers to focus on business model construction, using microservice boundaries as business boundaries, and thus driving the overall development process with a complete and single business model.

[0017] Focus on development: Developers do not need to pay too much attention to the underlying architecture and can devote most of their energy to focusing on development. The framework provides a variety of component supports and toolkits that are ready to use out of the box, improving development efficiency and reducing development costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a Saas application management framework architecture diagram based on double isolation of tenants and systems in the present invention; DETAILED DESCRIPTION

[0019] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.

[0020] The implementation method adopted by this invention is determined based on the following contents: (1) Scalability: the number of tenants, the storage level of each tenant, the overall storage, and the workload.

[0021] (2) Tenant isolation: data isolation and performance (whether the load of one tenant will affect other tenants).

[0022] (3) Per-tenant cost: database cost.

[0023] (4) Development complexity: changes in data structure and query statements.

[0024] (5) Operational complexity: performance monitoring, data structure schema management, tenant data recovery, and disaster recovery.

[0025] (6) Customizability: The ease of customizing the architecture according to the needs of tenants.

[0026] In order to isolate different tenants and different systems from the internal business at the same time, the present invention proposes a SaaS application management framework and method based on double isolation of tenants and systems. Figure 1 As shown in the figure, a SaaS application management framework based on double isolation of tenants and systems, a complete framework for implementing microservice development based on Spring Boot, and the development of distributed system infrastructure using Spring Boot, including the following modules: Spring Boot module: As the core of the entire framework, it is used to build the infrastructure of distributed microservice systems; Spring Cloud module: implements distributed system functions, including microservice registration, discovery, load balancing, gateway, and circuit breaker; Mybatis-Plus module: As the data access layer, it provides enhanced CRUD functions and multi-tenant support to simplify database operations; Multi-tenant plug-in module: provides multi-tenant extension for Mybatis-Plusd to isolate tenants of data; System isolation module: provides isolation capabilities based on system dimensions to avoid confusion of business data from different systems; Distributed transaction support module: Ensure the consistency of cross-service transactions with Seata.

[0027] In this embodiment, microservice development includes: configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision campaigns, distributed sessions, and cluster state management components.

[0028] Infrastructure development includes: service discovery registration, configuration center, message bus, load balancing, circuit breaker and data monitoring.

[0029] The application management framework also includes one or more tenants, multi-tenant applications and a database; a table space is set in the database.

[0030] Each table in the database table space needs to add tenant id and system id fields to distinguish different tenants and systems; tenant tables and system tables are also added to record tenant and system information.

[0031] In this embodiment, the present invention uses the following technology stack and tools: 1. Spring Cloud A complete framework for implementing microservices based on Spring Boot, which provides components such as configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision campaigns, distributed sessions, and cluster state management required for microservice development. It cleverly simplifies the development of distributed system infrastructure by leveraging the development convenience of Spring Boot, such as service discovery registration, configuration center, message bus, load balancing, circuit breakers, data monitoring, etc., which can all be started and deployed with one click using the SpringBoot development style, providing developers with tools to quickly build distributed systems. Developers can quickly start services or build applications, and quickly connect to cloud platform resources.

[0032] 2. MyBatis-plus MyBatis-Plus (MP for short) is an enhancement tool based on MyBatis. It enhances the basic functions of Mybatis without making any changes. It allows us to directly upgrade the project developed by Mybatis to Mybatis-plus. As it positions itself, it can help us further simplify the development process and improve development efficiency.

[0033] Mybatis-Plus can actually be seen as another encapsulation of Mybatis. After the upgrade, the CRUD operation of a single table can be easily implemented by calling the API provided by Mybatis-Plus. In addition, it also provides various query methods, paging and other behaviors. Developers do not need to write XML, which greatly reduces the difficulty of development.

[0034] Database: For each table, add tenant id and system id fields to distinguish different tenants and systems, and add tenant tables and system tables to record tenant and system information.

[0035] For the PO layer, we encapsulate the parent class and only need each PO class to inherit it.

[0036] On the other hand, a SaaS application management method based on double isolation of tenants and systems includes tenant isolation and system isolation. The tenant isolation uses the multi-tenant usage method provided by mybatisplus, encapsulates the configuration class of mybatis, and realizes the acquisition of tenantId by implementing the TenantLineHandler interface. The tenant isolation specifically includes: when the request header carries qfctid and passes the authentication of the microservice gateway, the corresponding tenantId will be obtained in the scaffolding; the multi-tenant plug-in of MyBatis-Plus automatically splices the corresponding tenant id when querying, so as to realize tenant isolation of a single table.

[0037] In this embodiment, in tenant isolation, each SQL executed by the tenant will automatically carry the tenant id.

[0038] In this embodiment, system isolation specifically includes: when the front end chooses to switch the system, the current system ID is carried in the corresponding request header qfcsid. After authentication by the microservice gateway, the back-end scaffolding will obtain the currently selected system id. When performing data CRUD, it determines whether the table to be operated is a table that requires system isolation, and determines whether the corresponding system id needs to be spliced.

[0039] System isolation also includes: a separate configuration for different tables, multiple tables are separated by commas, and the configured tables will execute SQL splicing system ID.

[0040] The present invention proposes a SaaS application management framework and method based on dual isolation of tenants and systems, which solves the problem of simultaneous data isolation of different tenants and systems and has the following technical advantages: Unified Framework: The main idea of ​​the unified framework is to enable developers to be on the same platform and to unify the architectural models of various systems as much as possible, so as to achieve the goal of unified interface specifications, unified data transmission models, and unified developer code styles.

[0041] Object-oriented: Object-oriented is the original programming paradigm for software development. However, the rise of rapid development models in recent years has mostly adopted data-oriented anti-pattern development processes. This invention standardizes the object-oriented domain set, allowing developers to focus on business model construction, using microservice boundaries as business boundaries, and thus driving the overall development process with a complete and single business model.

[0042] Focus on development: Developers do not need to pay too much attention to the underlying architecture and can devote most of their energy to focusing on development. The framework provides a variety of component supports and toolkits that are ready to use out of the box, improving development efficiency and reducing development costs.

[0043] The present invention has shown and described the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A SaaS application management framework based on double isolation of tenants and systems, characterized in that: A complete framework for implementing microservice development based on Spring Boot, which uses Spring Boot to develop distributed system infrastructure, including the following modules: Spring Boot module: As the core of the entire framework, it is used to build the infrastructure of distributed microservice systems; Spring Cloud module: implements distributed system functions, including microservice registration, discovery, load balancing, gateway, and circuit breaker; Mybatis-Plus module: As the data access layer, it provides enhanced CRUD functions and multi-tenant support to simplify database operations; Multi-tenant plug-in module: provides multi-tenant extension for Mybatis-Plusd to isolate tenants of data; System isolation module: provides isolation capabilities based on system dimensions to avoid confusion of business data from different systems; Distributed transaction support module: Ensure the consistency of cross-service transactions with Seata.

2. According to claim 1, a SaaS application management framework based on double isolation of tenants and systems is characterized in that: The microservice development includes: configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision campaigns, distributed sessions, and cluster state management components.

3. According to claim 1, a SaaS application management framework based on double isolation of tenants and systems is characterized in that: The infrastructure development includes: service discovery registration, configuration center, message bus, load balancing, circuit breaker and data monitoring.

4. According to claim 1, a SaaS application management framework based on double isolation of tenants and systems is characterized in that: The application management framework also includes one or more tenants, multi-tenant applications and a database; a table space is set in the database.

5. A SaaS application management framework based on double isolation of tenants and systems according to claim 4, characterized in that: Each table in the database table space needs to add fields of tenant id and system id to distinguish different tenants and systems; tenant tables and system tables are also added to record tenant and system information.

6. A SaaS application management method based on double isolation of tenants and systems, implemented based on a SaaS application management framework based on double isolation of tenants and systems as described in any one of claims 1 to 5, characterized in that: It includes tenant isolation and system isolation. The tenant isolation uses the multi-tenant usage method provided by mybatisplus, encapsulates the configuration class of mybatis, and realizes the acquisition of tenantId by implementing the TenantLineHandler interface. The tenant isolation specifically includes: when the request header carries qfctid and passes the authentication of the microservice gateway, the corresponding tenantId will be obtained in the scaffolding; the multi-tenant plug-in of MyBatis-Plus automatically splices the corresponding tenant id when querying, so as to realize tenant isolation of a single table.

7. A SaaS application management method based on double isolation of tenants and systems according to claim 6, characterized in that: In the tenant isolation, each SQL executed by the tenant will automatically carry the tenant id.

8. A SaaS application management method based on double isolation of tenants and systems according to claim 6, characterized in that: The system isolation specifically includes: when the front end chooses to switch the system, the current system ID is carried in the corresponding request header qfcsid. After authentication by the microservice gateway, the back-end scaffolding will obtain the currently selected system id. When performing data CRUD, it is determined whether the table to be operated is a table that needs system isolation, and whether the corresponding system id needs to be spliced.

9. A SaaS application management method based on double isolation of tenants and systems according to claim 8, characterized in that: The system isolation also includes: performing a separate configuration for different tables, multiple tables are separated by commas, and the configured tables will execute SQL to splice the system ID.