Hash Libraries / Sharding with JPA

My department decided to switch to hash partition / outline for some of our large Oracle databases. We will separate our objects according to different schemes. I was instructed to make a splash to assess the suitability of various JPA implementations for this.

Two that I said to focus on EclipseLink and Apache OpenJPA / Slice . In the past, we used Hibernate exclusively, but

+6
source share
3 answers

OpenJPA Slice may be one option for JPA applications in a closed database environment.

OpenJPA Slice is available since version 1.2, and also comes with Websphere 7.0 and later. The main contract for using Slice is to save the same JPA-based application code to work with alternating horizontal partitioning of the database without any impact on the database schema. Database fragments may be from different suppliers.

Slice follows a political design that allows the user application to control which shard / slice will be stored in new instances, how queries will be asked for a subset of slices, etc.

The main limitation (which is typical of any fined environment) is that a persistent domain model must adhere to a tree-restricted scheme. Essentially, given the instance of x stored in shard A, the constant closure of x, i.e. the set of instances directly or indirectly reachable from x, should also be stored in the same shard of A. Slice automatically calculates the closure when you save x.

If an application can work with this limitation, Slice may be appropriate.

Sometimes certain instances can be split between closures, for example. Country code or currency code. Slice has a provision for replicating such instances of the "master data" type through several fragments.

Aggregated operations (MAX, MIN, SUM) that are abelian / commutative for sharding are supported. A non-Abelian aggregate such as AVG is not supported. Sorted or Top-N queries are also supported.

More information about Slice can be found in the following links.

[1] OpenJPA User Guide: http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_slice

[2] IBM Developerworks: http://www.ibm.com/developerworks/java/library/os-openjpa/?ca=drs-

+4
source

EclipseLink data sharing support was released as part of the base product in version 2.2.

It supports Hash splitting and several other splitting types (value, range), as well as user-defined policies. Release 2.3 also includes integrated support for Oracle RAC, UCP, and WebLogic GridLink.

See, http://java-persistence-performance.blogspot.com/2011/05/data-partitioning-scaling-database.html

+4
source

If you want to use external tools that not only hide the logic of fragments from application developers, but also from BI users, database administrators, etc. Check out ScaleBase

0
source

Source: https://habr.com/ru/post/890089/


All Articles