This relates to scalable, hierarchical multi-tenant applications and more particularly to abstraction of data and logic partitioning, hierarchical configuration and administration to enable developers to build scalable hierarchical multi-tenant applications.
Traditionally when designing applications, scalability is achieved by de-coupling functions into different services as well as partitioning data. Typically this type of partition is called a vertical partition. Once the application has been decomposed into multiple services, the next challenge is typically to scale an individual service. This is typically done by moving part of the data into a separate database based on an identifier which could be based on geographic location or based on some way to group related data together.
The problem of partitioning is particularly acute for multi-tenant applications. Multi-tenant applications typically store data of multiple customers within the same database. They also use the same instance of an application which multiple customers' access in-order to deliver services.
Hierarchical multi-tenancy may be defined as the ability to define a hierarchy of tenants and establish multi tenancy within the hierarchy. As an example if a health care service is launched by a health care service provider (dealing with retail health care products) to the entire globe, they would have the possibility of establishing a root organization, create geographies (or countries/states) as tenants within the root organization, create customers (possibly targeted hospitals which consume the service) as tenants within the geography. Every tenant in the hierarchy has access to their own data as well as data within the hierarchy.
Hierarchical multi-tenancy allows each tenant to access their own data; i.e., each tenant in the hierarchy like hospitals, geographies have access to data specific to them (which is qualified by means of a tenant identifier pointing to these tenants). Hierarchical multi-tenancy also allows access to data within the hierarchy.
The need for this kind of multi-tenancy is to launch services that span across the globe consistently with a lot of administration being handled at individual tenant level yet providing control to ancestors of the hierarchy on how the service may be consumed. This facet of hierarchical multi-tenant applications is called hierarchical configuration. Apart from the hierarchical configuration, there is need for administration of the hierarchical multi-tenant context which provides the ability to create needed hierarchy and hierarchically manage the created tenants
Currently, there is no easy way to enable an application to be constructed in a manner that it may easily support hierarchical multi-tenancy along with vertical and horizontal partitioning capabilities at the same time abstracting the complexity of the same as much as possible to the developers who develop the application.
Also, current methods do not provide any mechanism to abstract complexity of building scalable hierarchical multi-tenant applications. In most cases, the application is rewritten to support partitioning and the hierarchical configuration services or multiple instances of the same software are deployed for every tenant. Also, partitions are done from the start and typically support a separate instance per data partition as the only deployment model.
The principal object of this is to propose a method and system to enable an application to be constructed, wherein the application may support hierarchical multi-tenancy along with vertical and horizontal partitioning capabilities
Another object of the is to enable an application to be constructed, wherein the complexity of the application is abstracted as much as possible to the developers who develop the application.
Accordingly the provides a method for enabling construction of an application based on data to support hierarchical multi-tenancy, the method comprising performing vertical partitioning of the data into a plurality of vertical partitions; performing horizontal partitioning of the data into a plurality of horizontal partitions; performing at least one hierarchical configuration based on the data specific to the application by a hierarchical configuration engine; and performing at least one action related to at least one tenant based on the at least one hierarchical configuration.
Also, provided herein is a system configured for enabling construction of an application based on data to support hierarchical multi-tenancy, the system configured for performing vertical partitioning of the data into a plurality of vertical partitions; performing horizontal partitioning of the data into a plurality of horizontal partitions; performing at least one hierarchical configuration based on the data specific to the application by a hierarchical configuration engine; and performing at least one action related to at least one tenant based on the at least one hierarchical configuration.
These and other aspects of the embodiments herein will be better appreciated and understood when considered in conjunction with the following description and the accompanying drawings. It should be understood, however, that the following descriptions, while indicating preferred embodiments and numerous specific details thereof, are given by way of illustration and not of limitation. Many changes and modifications may be made within the scope of the embodiments herein without departing from the spirit thereof, and the embodiments herein include all such modifications.
This is illustrated in the accompanying drawings, through out which like reference letters indicate corresponding parts in the various figures. The embodiments herein will be better understood from the following description with reference to the drawings, in which:
The embodiments herein and the various features and advantageous details thereof are explained more fully with reference to the non-limiting embodiments that are illustrated in the accompanying drawings and detailed in the following description. Descriptions of well-known components and processing techniques are omitted so as to not unnecessarily obscure the embodiments herein. The examples used herein are intended merely to facilitate an understanding of ways in which the embodiments herein may be practiced and to further enable those of skill in the art to practice the embodiments herein. Accordingly, the examples should not be construed as limiting the scope of the embodiments herein.
The embodiments herein disclose a method and system to enable an application to be constructed in a manner so as to support hierarchical multi-tenancy along with vertical and horizontal partitioning capabilities at the same time abstracting the complexity of the same as much as possible to the developers who develop the application. Referring now to the drawings, and more particularly to
Vertical partitioning of data is performed (202), wherein vertical partitioning comprises of partitioning of related functionality in the application leading to the creation of difference services that needs to inter-operate for various needs. Consider an eCommerce portal application as a first example. A vertical partition in such an application may be an administrative and metadata portal along with the catalogue metadata tables that allows the eCommerce portal owner to configure different catalogue items that are available to be sold in the portal and an end user facing shopping cart application that displays the catalogue items and allows them to buy consisting of the user and order tables. In another example, consider Germany and France, wherein there are two hospitals Hospital 1 and Hospital 2 in Germany and one hospital (hospital 3) in France (as depicted in
A suitable means such as webservices may be used to enable (203) services to communicate with each other. This may be achieved by exposing the data access layer itself as remotely accessible such that between two services, the data managed by the service may be directly accessed using the service. In an embodiment herein, this may be achieved by exposing more functional services that does have business logic to process data. In an embodiment herein, this may be achieved by providing ability to provision the tenant hierarchy as and when it is established to the vertical service.
Considering the eCommerce example, the administrative and metadata service directly exposes Catalog table via the data access layer interface, which enables the shopping cart application to show the catalogue and also consider the order functionality. Also, assuming there has to be an inherent feature that filters out specific catalogue items based on different geographies that are not a concern of the shopping cart application, a business service needs to be written that does the actual filter of the catalogue data based on a specific context and exposes the same to the shopping cart application. Considering the health care service example, if the health care service provider has a catalogue of items that needs to be shown to hospitals for ordering, it is a potential service that may be consumed by the hospital focused service.
In an embodiment herein, there may be hierarchy specific features that may be built even within the vertical partition. This may be enabled by provisioning the tenant hierarchy into the vertical partition thereby allowing the vertical specific functionality to work. Considering the health care example, it could be possible that a bunch of hospitals are grouped together to form a hospital group adding one more level in the hierarchy. In such case the same set of services is consumed both at the hospital and hospital group level which mandates hierarchical functionality to be available even within vertical partitions.
Embodiments disclosed herein abstracts out the complexity of creating a vertical partition and enables easy creation of vertical data and logic services that interact with each other and scale seamlessly.
Horizontal partitioning is further performed (204) by horizontally cut a portion of the data set based on a tenant key at a particular level to a different database and allow the data set to be split thereby enabling a more controllable data set that is accessed and updated.
The split may involve moving an entire hierarchy out into a separate database. Considering the health care example, there may be a need to move out data specific to Germany alone into a different database. This can happen because of performance and scale reasons or even for compliance reasons. Abstraction of the horizontal partitioning may be performed using the common data access interface. When a query is being made, the context of the query can be injected external to the user that allows the data access layer to decide to which database the query is targeted. In an embodiment herein, the tenant identifier may be the key based on which the horizontal partitioning may be established, the tenant identifier of the current logged in user may be injected into the context of execution so that the data access layer may understand which database the query is targeted towards. In a programming language such as java/j2ee, the concept of a datasource configured at the container may be injected into the context of the Java Persistence API EntityManager based on the current context. The data source may be configured at any point in time. As long as the data access layer depends on the “context” to come in externally, the data access layer may be pointed to query from an appropriate database. In this case of an entire hierarchy being moved, the hierarchical configuration service may be used to define a data source at the level in hierarchy at which the partition has been established. Because of the behavior of the hierarchical service all tenants which are descendants of the partitioned tenant automatically default to the parent data source definition. The various actions in method 200 may be performed in the order presented, in a different order or simultaneously. Further, in some embodiments, some actions listed in
Embodiments herein discloses enables seamless partition of data at a stage not necessarily known during the development of the software but can be decided at runtime.
Embodiments disclosed herein enable an administrator to use a single database for the service and as data grows, the administrator may define a different data source for a specific subset of users based on tenant identifier and then allows this context to be passed on to the data access layer to decide which data source to use for which user request at runtime. Passing a context may be made generic if the data access layer externalizes the concern to a generic metadata service for determining the right data source by passing the current context available to it.
The above mentioned method for partitioning of data may be performed on existing data or new data. In an example, as a policy the eCommerce portal may decide that all geographies will get its own database and therefore whenever a new geography is launched, a new data source is configured and injected within the application at runtime.
In an embodiment herein, data may be manually partitioned and a new data source configured manually.
In the example of the health care provider example, each geography may get its own database. So, Hospital 1 and Hospital 2 would be in a separate database and Hospital 3 would be in a separate database.
Embodiments disclosed herein allow a single application (service) instance to support partitioned data, wherein the partitioned data may be partitioned based on the tenant (as shown in
Embodiments herein enable the creation and management of the tenants and tenant hierarchy and enable the hierarchy to be available across all partitions. A provisioning API is provided, wherein the provisioning API enables creation of tenants based on hierarchy (ability to specify parent). The provisioning API also informs the individual partitioned application of new additions to the hierarchy so that the hierarchy is updated accordingly. This enables creation of other additional hierarchical services within the application partition itself.
In a standard programming environment (such as Java/J2EE), embodiments enable deployment of an archetype that packages all of the above and enables abstraction of the partition complexity. An archetype may be considered as a template that consists of specific artifacts meant for a specific purpose. The deployment archetype may comprise of a base web archive and a Hierarchical Configuration and Administration web archive. The base web archive further comprises of the source of the base data model class which every other data model will extend, the interface definition of the data access layer, an implementation class of the data access layer, a filter which helps set the context of the current request based on various parameters passed in as part of the request, implementation for exposing the data access layer as a webservice, all required libraries needed for the above functions and a provisioning API implementation that creates the tenant hierarchy whenever a tenant gets added. The Hierarchical Configuration and Administration web archive allows hierarchical configuration of different settings within the application, provisions tenants (which internally provisions the hierarchy across all running instances of the services) and manage tenants.
Embodiments disclosed herein may be extended to other programming languages based on the way packaging is done within the languages.
By allowing the use of an archetype, the complexity of partition is easily abstracted and enables the developer to concentrate of the actual business functionality.
The foregoing description of the specific embodiments will so fully reveal the general nature of the embodiments herein that others can, by applying current knowledge, readily modify and/or adapt for various applications such specific embodiments without departing from the generic concept, and, therefore, such adaptations and modifications should and are intended to be comprehended within the meaning and range of equivalents of the disclosed embodiments. It is to be understood that the phraseology or terminology employed herein is for the purpose of description and not of limitation. Therefore, while the embodiments herein have been described in terms of preferred embodiments, those skilled in the art will recognize that the embodiments herein can be practiced with modification within the spirit and scope of the embodiments as described herein.
Number | Date | Country | Kind |
---|---|---|---|
2409/CHE/2014 | May 2014 | IN | national |