Chapter 13.  Slice: Distributed Persistence

Table of Contents

1. Overview
2. Salient Features
2.1. Transparency
2.2. Scaling
2.3. Distributed Query
2.4. Data Distribution
2.5. Data Replication
2.6. Heterogeneous Database
2.7. Distributed Transaction
2.8. Collocation Constraint
3. Usage
3.1. How to activate Slice Runtime?
3.2. How to configure each database slice?
3.3. Implement DistributionPolicy interface
3.4. Implement ReplicationPolicy interface
4. Configuration Properties
4.1. Global Properties
4.1.1. openjpa.slice.DistributionPolicy
4.1.2. openjpa.slice.Lenient
4.1.3. openjpa.slice.Master
4.1.4. openjpa.slice.Names
4.1.5. openjpa.slice.ThreadingPolicy
4.1.6. openjpa.slice.TransactionPolicy
4.2. Per-Slice Properties

The standard JPA runtime environment works with a single database instance. Slice is a plug-in module for OpenJPA to work with multiple databases within the same transaction. Following sections describe the features and usage of Slice for distributed database environment.

1. Overview

Enterprise applications are increasingly deployed in distributed database environment. A distributed, horizontally-partitioned database environment can be an effective scaling strategy for growing data volume, to support multiple clients on a multi-tenant hosting platform and many other practical scenarios that can benefit from data partitioning.

Any JPA-based user application has to address demanding technical and conceptual challenges to interact with multiple physical databases within a single transaction. OpenJPA Slice encapsulates the complexity of distributed database environment via the abstraction of virtual database which internally manages multiple physical database instances referred as slice. Virtualization of distributed databases makes OpenJPA object management kernel and the user application to work in the same way as in the case of a single physical database.