Database sharding and JPA

夙愿已清 提交于 2020-01-01 04:23:25

问题


I am working on a Java application that requires horizontal partitioning of data in different PostgreSQL servers. I would like to use a JPA framework and Spring for transaction management.

The most popular frameworks for sharding data with JPA seem to be Hibernate Shards, which appears to be no longer in development, and OpenJPA Slice, which does not support virtual shards (one of my requirements). Are there any other options that I'm missing, or a way to get around the OpenJPA limitation?

Thanks in advance for your input!


回答1:


You can have a look at Sharding-JDBC, it is a JDBC driver for shard databases and tables, can adapter for any ORM frameworks.




回答2:


Have you looked into EclipseLink? It supports JPA2 and horizontal sharding.

The documentation says it supports Sharding over multiple database instance



来源:https://stackoverflow.com/questions/13672019/database-sharding-and-jpa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!