spring-projects / spring-data-relational

Spring Data Relational. Home of Spring Data JDBC and Spring Data R2DBC.
https://spring.io/projects/spring-data-jdbc
Apache License 2.0
764 stars 344 forks source link

how to do database sharding #1751

Closed yande2011 closed 6 months ago

yande2011 commented 6 months ago

Does anyone have a requirement for database sharding? For example, inserting entities into different sharded tables based on a timestamp? how to do this?

schauder commented 6 months ago

This would have to happen on the driver level, when talking actual sharding, i.e. distributing data among multiple database servers, or possibly on the database level, when partitioning in a single database is sufficient. Oracle for example offers partitioned tables which look just as a normal table for the user.

Spring Data doesn't offer explicit support for sharding, and also won't do that in the future.