> For the complete documentation index, see [llms.txt](https://shashankrnr32.gitbook.io/mongodb-application-sharding/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shashankrnr32.gitbook.io/mongodb-application-sharding/mongodb-application-sharding.md).

# 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://shashankrnr32.gitbook.io/mongodb-application-sharding/mongodb-application-sharding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
