The popularity of cloud environments is real and the deployment of SaaS applications is becoming a strong business model. To support these applications is essential to create a multi-tenancy environment separating each customer data and providing a single execution environment with security and isolated customer contexts. The main challenges of this architecture are: separation of contexts, data isolation, customisation features, resource isolation and management of the execution environment. This talk will demonstrate different technologies and strategies used to implement those features using the Java EE platform.
2. About Me
• Brazilian guy ;)
• Work for Integritas company
• http://integritastech.com
• Software Architect
• Java Platform
• JUG Leader of GUJavaSC
• http://gujavasc.org
• Twitter
• @rcandidosilva
• Personal
• http://rodrigocandido.me
3. Agenda
• Cloud Services Model
• SaaS Market
• Multi-tenancy
• Challenges
• Pros and Cons
• Strategy Types
• Java EE + Multi-tenancy
• Multi-tenancy at Cloud
8. Multi-instances vs. Multi-tenant
Feature Multi-instances Multi-tenant
Cost Structure Can support only tiered or
flat pricing
Supports usage based pricing
as well as tiered or flat
Resources Dedicated resources Shared resources
Operation and
Maintenance
Manage and administer
as many instances as
customers
Manager and administer a
single instance for a number
of customers
Scalable Model Not scalable. As the
number of customers
increase the maintenance
requirements increase
proporcionally
Scalable, since a number of
customers are serviced by
one instance
10. Challenges
• Data separation
• UI and business rules customization
• Access control by tenant
• Resource provisioning
• Integration
• Application update
• Failover tolerance
11. Pros and Cons
• Pros
• Low maintenance cost
• Same source code for all customers
• High scalability
• Sharing resources between customers
• Cons
• High complexity
• Separation by tenant-id
• More failure risks
• If code breaks -> breaks to all customers
• Low flexibility available to the customers
16. What is the Best Choice?
• Depends on…
• Data Customization
• Addition or removal of columns in the data store
• Function Customization
• The functionality executed for a specific business can vary by
customers
• Process Customization
• The business process can vary for each customer
• Licensing Features
• The product has multiple licenses which define the functionality
that is enabled for the customer
18. Database Strategy
Feature Separate DBs Separate Tables Shared Database
Data
Customization
Security
Inter-dependency
and Performance
Scalable Model
Customer On-boarding
19. Java EE + Multi-tenancy
• Database
• JPA + Multi-tenancy
• UI Customization
• JSF + Multi-tenancy
• Java EE 8 with Cloud support
20. JPA + Multi-tenancy
• There is no standard at this time
• EclipseLink
• Multi-tenancy support using @Multitenant
• Multitenant strategies
• @Multitenant(SINGLE_TABLE) – default
• @Multitenant(TABLE_PER_TENANT)
• @Multitenant(VPD)
• Hibernate
• Supports tenant identifier features
• MultiTenantConnectionProvider
• CurrentTenantIdentifierResolver