This project serves as a framework for implementing horizontal sharding in a multi-tenant application. It provides a scalable database architecture using PostgreSQL and Spring Boot.
For a deeper understanding of the design principles behind this approach, check out the article:
What to Expect When You’re Expecting Database Scaling: A Serious Look at Sharding for a Multi-Tenant Webshop Application on Postgres.
- Spring Boot 3 – Backend framework
- JPA (Java Persistence API) – ORM for database interactions
- PostgreSQL 16 – Database system
- Flyway – Database migration tool
- TestContainers – For integration testing with PostgreSQL in a containerized environment
- Maven – Build and dependency management tool
-
Start PostgreSQL using Docker Compose
Run the following command to launch a PostgreSQL instance in a Docker container:docker-compose up -d
-
Run the Spring Boot application
Start the project using Maven:mvn spring-boot:run
Alternatively, you can run it directly from your IDE.
Contributions are welcome! Please open an issue or submit a pull request for improvements and bug fixes.
This project is licensed under the Apache License 2.0.