Skip to content

ysrgozudeli/spring-boot-sharding-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Sharding Example

Project Purpose

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.

Technology Stack

  • 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

How to Start the Project

  1. Start PostgreSQL using Docker Compose
    Run the following command to launch a PostgreSQL instance in a Docker container:

    docker-compose up -d
  2. Run the Spring Boot application
    Start the project using Maven:

    mvn spring-boot:run

    Alternatively, you can run it directly from your IDE.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for improvements and bug fixes.

License

This project is licensed under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages