Proxy Data Source for Multitenant Java EE and SE Environments
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multitenant application server environments, existing technologies face challenges in allowing applications to access tenant-specific data sources without knowing the actual data sources, and efficiently switching between them based on caller context.
Innovation Solution
A system and method that provides a proxy data source mechanism in Java EE and Java SE environments, enabling applications to access tenant data sources through a non-tenant-specific JNDI name, and allowing switching between tenant data sources based on the caller context, using a proxy data source that is not tenant or partition specific.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If each tenant has its own data source with tenant-specific JNDI name, then tenant data isolation is improved, but application complexity increases because applications must know the actual data source names for each tenant
Solution Approach 1:
A proxy data source is introduced as an intermediary between applications and tenant-specific data sources. The proxy data source has a generic JNDI name that applications can use universally, while internally it resolves to the appropriate tenant-specific data source based on the caller's tenant context. This mediator eliminates the need for applications to know actual data source names while maintaining tenant data isolation.
Solution Approach 2:
The data source access layer is segmented into two levels: the proxy data source layer (with generic JNDI names) that applications interact with, and the tenant-specific data source layer (with tenant-specific JNDI names) that actually stores the data. This segmentation allows decoupling of application code from specific data source implementations.
2Adaptability or versatility
If the application code is modified to handle multiple tenants, then tenant-specific data access is improved, but development time and complexity increase
Solution Approach 1:
The proxy data source provides a universal interface that works for all tenants through a single generic JNDI name. The same application code can access data for any tenant without modification, as the proxy automatically resolves the correct tenant-specific data source based on the caller context. This multi-functional approach eliminates the need for tenant-aware code modifications.
3Ease of operation
If a proxy data source with generic JNDI name is used, then application code simplicity is improved, but data source switching overhead increases
Solution Approach 1:
The proxy data source is pre-configured with mappings between the generic JNDI name and multiple tenant-specific data sources. When a connection is needed, the system performs preliminary resolution of the correct tenant-specific data source based on the caller context before actual data access occurs. This pre-prepared mapping structure minimizes runtime switching overhead.
4Reliability
If tenant-specific data sources are created for each tenant, then data isolation is improved, but system resource consumption increases
Solution Approach 1:
Multiple tenant-specific data sources are merged into a single proxy data source instance with a generic JNDI name. The proxy maintains internal references to all tenant-specific data sources but presents a unified interface to applications. This merging reduces the number of data source objects that applications need to manage while preserving data isolation through the proxy's internal routing mechanism.
Data Source
AI summary
In accordance with an embodiment, described herein is a system and method for supporting proxy data sources in a multitenant application server environment, such as Java SE and Java EE environments. In multitenant environments, various tenants can have data sources that an administrative application can access without needing to know the actual data sources. A system and method provide a proxy data source mechanism such that applications in Java EE and Java SE environments can access tenant data sources, each tenant data source having a JNDI name that is tenant or partition specific, through the proxy data source, the proxy data source comprising a JNDI name which is not tenant or partition specific. The proxy data source can also provide for switching between tenant data sources based upon a caller context.


