CN-116074371-B - Multi-tenant application architecture, multi-tenant application development method and related device
Abstract
The embodiment of the specification provides a multi-tenant application architecture, a multi-tenant application development method and a related device, wherein middleware resources corresponding to user identities are adapted for user requests through tenant units running in independent running in a multi-tenant module, so that multi-tenant of each tenant in the actual resource use process is realized, the tenants are isolated from each other, and decoupling of multi-tenant capacity and user function logic is realized. Meanwhile, the multi-tenant application architecture respectively packages the user function logic for acquiring the user request and the middleware for providing the distributed resource into two different containers, so that the distributed resource arranged in the resource container is decoupled from the user function logic, the coupling degree of the multi-tenant application architecture is reduced, in the development process, the distributed capability which can be provided by one type of middleware is exposed to a developer in an interface form, the decoupling of the distributed capability and the user function logic is realized, and the development difficulty of the multi-tenant application is reduced.
Inventors
- HUANG BAIRU
- FANG YUPING
- HUANG HUA
- DENG YUNHUI
Assignees
- 阿里巴巴(中国)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230116
Claims (10)
- 1. A multi-tenant application architecture is characterized by comprising a functional container and a resource container, wherein, The function container is used for acquiring a user request, wherein the user request is used for requesting to realize a user function, and the user request comprises user identity information; The resource container comprises a middleware module and a multi-tenant module, wherein the middleware module comprises a plurality of middleware, the middleware is used for providing middleware resources, and the middleware comprises at least one of a database, a cache, a distributed task scheduling platform, a message middleware and a distributed transaction; the multi-tenant module comprises at least one tenant unit, wherein the tenant unit operates in independent operation, and the tenant unit is used for adapting the middleware resource corresponding to the user identity information for the user request according to the user identity information.
- 2. The multi-tenant application architecture of claim 1, wherein the functional container and the resource container are disposed at a cloud server, and wherein a client of the multi-tenant application architecture comprises a first interface unit; the first interface unit comprises a plurality of test interfaces, each test interface is used for providing a communication interface of one type of middleware for the client, and the first interface unit is used for providing the test interface for the client and is used for proxy of a test request to the cloud server; the functional container is further configured to receive the test request and send the test request to the resource container; The resource container is further configured to adapt, for the test request, the middleware resource corresponding to the identity information of the test user according to the identity information of the test user in the test request.
- 3. The multi-tenant application architecture of claim 2, wherein the functional container comprises a test module and a service module, wherein the resource container further comprises a tenant test unit, wherein, The service module is used for acquiring the user request and sending the user request to the resource container; the test module comprises a distribution unit, wherein the distribution unit is used for acquiring the test request and sending the test request to the tenant test unit; the tenant testing unit is used for adapting the middleware resources corresponding to the identity information of the test user for the test request through the interface unit according to the identity information of the test user in the test request.
- 4. The multi-tenant application architecture of claim 3, wherein the resource container comprises a plurality of tenant units, at least one of the plurality of tenant units functioning as the tenant test unit, the tenant units comprising a second interface unit and an adapter; the second interface unit comprises a plurality of middleware interfaces, each middleware interface corresponds to one type of middleware, and the middleware interfaces are used for providing communication interfaces of the middleware of the type corresponding to the middleware interfaces; the second interface unit is configured to receive the user request or the test request, and request the middleware resource to the adapter through the middleware interface; The adapter is configured to adjust the user request or the test request according to the user identity information, so that a scope of the middleware resource requested by the user request or the test request corresponds to the user identity information or the identity information of the test user, and return the middleware resource requested by the user request according to the adjusted user request.
- 5. The multi-tenant application architecture of claim 2, wherein the interface unit is packaged as a software development kit.
- 6. A method for developing a multi-tenant application, characterized in that the method is applied to the multi-tenant application architecture of any one of claims 1 to 5, wherein a client of the multi-tenant application architecture comprises a first interface unit, the first interface unit comprises a plurality of test interfaces, and each test interface is used for providing a communication interface of a type of middleware for the client; The development method of the multi-tenant application comprises the following steps: acquiring user function logic according to the user function to be realized and the type of the middleware which can be provided by the first interface unit; and deploying the user function logic to a cloud server of the multi-tenant application architecture.
- 7. The method of claim 6, wherein the first interface unit is further configured to proxy a test request to the cloud server; before the deploying the multi-tenant application on the cloud server of the multi-tenant application architecture, the method further comprises: acquiring identity information of a test user; generating a test request according to the identity information of the test user; and the test request is proxied to the cloud server through the first interface unit, and the test request is used for requesting middleware resources from the cloud server.
- 8. The method of claim 6, wherein the deploying the user function logic at the cloud server of the multi-tenant application architecture comprises: and deploying the user function logic in a function container in the cloud server in an independent operation mode.
- 9. An electronic device is characterized by comprising a processor and a memory; Wherein the memory is connected with the processor and is used for storing a computer program; the processor is configured to implement the method for developing a multi-tenant application according to any one of claims 6 to 8 by running a computer program stored in the memory.
- 10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the method for developing a multi-tenant application according to any one of claims 6 to 8 is implemented.
Description
Multi-tenant application architecture, multi-tenant application development method and related device Technical Field Embodiments in the present disclosure relate to the field of computer application technologies, and in particular, to a multi-tenant application technology in the field of computer application technologies, and more particularly, to a multi-tenant application architecture, a multi-tenant application development method, and related devices. Background The multi-tenant application (Software Multitenancy) is a software architecture in which a single instance of software runs on a server and serves multiple tenants (Tenant). Multi-tenant applications may also be referred to as SaaS (Software-as-a-Service) applications. Systems designed in this manner are "shared" rather than "dedicated" or "isolated. Through the multi-tenant application, tenants subscribe required services to operators of the multi-tenant application through the Internet, and the required software services can be used without preparing hardware facilities such as a server, so that the hardware cost of the server and the like required by the tenants to construct the application by themselves is reduced. However, the coupling degree of each part of the current multi-tenant application architecture is higher, and great difficulty is brought to the development of multi-tenant applications. Disclosure of Invention Various embodiments in the present disclosure provide a multi-tenant application architecture, a method for developing a multi-tenant application, and related devices, so as to achieve the purpose of reducing the coupling degree of the multi-tenant application architecture. In a first aspect, one embodiment of the present specification provides a multi-tenant application architecture, comprising a functional container and a resource container, wherein, The function container is used for acquiring the user request, wherein the user request is used for requesting to realize the user function, and the user request comprises user identity information; the resource container comprises a middleware module and a multi-tenant module, wherein the middleware module comprises a plurality of middleware, and the middleware is used for providing middleware resources; the multi-tenant module comprises at least one tenant unit, wherein the tenant unit operates in independent operation, and the tenant unit is used for adapting the middleware resource corresponding to the user identity information for the user request according to the user identity information. In a second aspect, an embodiment of the present disclosure provides a method for developing a multi-tenant application, which is applied to the multi-tenant application architecture described above, where a client of the multi-tenant application architecture includes a first interface unit, where the first interface unit includes a plurality of test interfaces, and each of the test interfaces is configured to provide a communication interface of one type of middleware for the client; The development method of the multi-tenant application comprises the following steps: acquiring multi-tenant application according to the user function to be realized and the type of the middleware which can be provided by the first interface unit; and deploying the multi-tenant application to a cloud server of the multi-tenant application architecture. In a third aspect, an embodiment of the present disclosure provides a development device for a multi-tenant application, which is applied to the multi-tenant application architecture described above, where a client of the multi-tenant application architecture includes a first interface unit, where the first interface unit includes a plurality of test interfaces, and each of the test interfaces is configured to provide a communication interface of one type of middleware for the client; the device for developing the multi-tenant application comprises: the application development module is used for acquiring multi-tenant application according to the user function which is realized as required and the type of the middleware which can be provided by the first interface unit; And the application deployment module is used for deploying the multi-tenant application to a cloud server of the multi-tenant application architecture. In a fourth aspect, one embodiment of the present specification provides an electronic device comprising a processor and a memory; Wherein the memory is connected with the processor and is used for storing a computer program; The processor is configured to implement the method for developing a multi-tenant application as described above by running a computer program stored in the memory. In a fifth aspect, an embodiment of the present disclosure provides a computer readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing a method for developing a multi-tenant applica