EclipseLink Multitenant Data Isolation via Discriminator Columns
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing multitenant systems face challenges in efficiently storing tenant-specific data without requiring complete reconfiguration when tenants are added or removed, while ensuring data isolation and sharing the same schema transparently.
Innovation Solution
EclipseLink supports shared multitenant tables using tenant discriminator columns, allowing multiple tenants to share the same schema and enabling flexible configuration through @Multitenant annotation or xml elements, with options for usage at the Entity Manager Factory or individual Entity Manager levels, ensuring data isolation and efficient data management.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple tenants use separate database tables for tenant-specific data, then data isolation is ensured, but system complexity increases and maintenance effort increases
Solution Approach 1:
The patent merges multiple tenant-specific tables into a single shared table by adding a tenant discriminator column. This consolidation reduces the number of tables from N (one per tenant) to 1, simplifying the database schema while maintaining data isolation through the discriminator column that identifies which tenant each record belongs to.
Solution Approach 2:
The shared table structure serves multiple tenants simultaneously through a universal schema. The tenant discriminator column enables the same table to store and manage data for multiple tenants, making the database structure multi-functional rather than requiring separate dedicated tables for each tenant.
2Quantity of substance
If separate database tables are used for each tenant, then tenant-specific data storage is achieved, but scalability deteriorates when tenants are added or removed
Solution Approach 1:
By consolidating tenant data into a single shared table with a tenant discriminator column, the system eliminates the need to create or drop tables when tenants are added or removed. The same shared table structure accommodates any number of tenants, improving scalability while maintaining tenant-specific data storage through the discriminator.
3Productivity
If default properties are used for multitenant applications, then development effort is reduced, but data capture capability deteriorates for particular user needs
Solution Approach 1:
The patent applies local quality by allowing each tenant to have custom properties and attributes specific to their needs while using a shared table structure. The tenant discriminator column enables differentiation of local characteristics for each tenant, allowing customization without requiring separate table structures, thus maintaining both development efficiency and data capture capability.
Data Source
AI summary
Systems and methods are provided to support multitenant data in an EclipseLink environment. EclipseLink supports shared multitenant tables using tenant discriminator columns, allowing an application to be re-used for multiple tenants and have all their data co-located. Tenants can share the same schema transparently, without affecting one another and can use non-multitenant entity types as per usual. This functionality is flexible enough to allow for its usage at an Entity Manager Factory level or with individual Entity Manager's based on the application's needs. Support for multitenant entities can be done though the usage of a multitenant annotation or <multitenant> xml element configured in an eclipselink-orm.xml mapping file. The multitenant annotation can be used on an entity or mapped superclass and is used in conjunction with a tenant discriminator column or <tenant-discriminator-column> xml element.


