The payment service that used sharding mechanism for distribution payment info between three databases.
Used:
- Apache ShardingSphere
- H2 in-memory database for demonstration purpose
All sharding settings (database instances, sharding rules) are set up by Spring Boot Autoconfiguration in application.yaml
- Clone repository
- Move to the project folder
- Execute the following commands
For Windows:
gradlew bootRun
For Linux:
./gradlew bootRun
API info: http://localhost:8080/swagger-ui.html
H2 database console: http://localhost:8080/h2_console
Instances:
- jdbc:h2:mem:test
- jdbc:h2:mem:test1
- jdbc:h2:mem:test2
Username: sa Password: password