Simplify Multi-Tenant Queries in ORM Frameworks

Post on 08-Jul-2015

383 views 6 download

description

介紹ORM Frameworks中的多租戶功能的發展

Transcript of Simplify Multi-Tenant Queries in ORM Frameworks

#JCConf

薛元揆 (Study Hsueh)study.hsueh@cacafly.com

Application

Tenant#1 Tenant#N

Tenant#1

Application

Tenant#2 Tenant#N

Application Application

ServerWAR WAR WAR

Tenant#1

Application

Tenant#2 Tenant#N

ServerWAR

Server

Web Layer

Service Layer

Persistence Layer

2. pass tenant-id to service layer

3. pass tenant-id to persistence layer

Client

1. assign tenant-id when user login, and then make a tenant-related request

Service Layer

Web Layer

Persistence Layer

Service Layer

Web Layer

Persistence Layer

Persistence Layer

Persistence Layer

Model

Model

• Application

Tenant#1 Tenant#N

Application

Tenant#1 Tenant#NTenant#2

DB#1 DB#2 DB#N

Application

Tenant#1 Tenant#NTenant#2

DB

Application

Tenant#1 Tenant#NTenant#2

DB

Performance Management Backup Scalable API Cost

Separate Database

Separate Schema

Discriminator Column

JPA 2.1 Hibernate 4.3.6 Final EclipseLink 2.5.2

Separate database supported supported supported

Separate schema

no (candidate in JEE 8)

supported supported

Discriminator column

no (candidate in JEE 8)

no (will support in 5.0)

supported

薛元揆 (Study Hsueh)study.hsueh@cacafly.com

@phstudy