# MongoDB Application Sharding

[![Java CI with Maven](https://github.com/shashankrnr32/mongodb-application-sharding/actions/workflows/maven.yml/badge.svg)](https://github.com/shashankrnr32/mongodb-application-sharding/actions/workflows/maven.yml) [![Maven Package](https://github.com/shashankrnr32/mongodb-application-sharding/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/shashankrnr32/mongodb-application-sharding/actions/workflows/maven-publish.yml) [![codecov](https://codecov.io/gh/shashankrnr32/mongodb-application-sharding/branch/main/graph/badge.svg?token=U51FX5G10S)](https://codecov.io/gh/shashankrnr32/mongodb-application-sharding)

[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-black.svg)](https://sonarcloud.io/summary/new_code?id=shashankrnr32_mongodb-application-sharding)

Application Sharding enables you to convert a database into a distributed database to divide the dataset into multiple tables(collections), databases or both. [ShardingSphere](https://github.com/apache/sharding-sphere) provides this feature for relational databases, such as MySQL, PostgreSQL etc.

This project provides the same feature to divide the data into multiple collections for MongoDB. Inspired by Apache's Sharding-Sphere, this library provides extensions to the classes present in [spring-data-mongodb](https://github.com/spring-projects/spring-data-mongodb) to shard the database into 3 different strategies

Application Sharding Strategies supported by the library

1. Collection Sharding Strategy
2. Database Sharding Strategy
3. Composite Sharding Strategy

### Author

[Shashank Sharma](https://github.com/shashankrnr32)
