https://github.com/peterj/mongodb-sharding-article
Example of sharding in MongoDB
https://github.com/peterj/mongodb-sharding-article
Last synced: 2 months ago
JSON representation
Example of sharding in MongoDB
- Host: GitHub
- URL: https://github.com/peterj/mongodb-sharding-article
- Owner: peterj
- Created: 2020-05-13T17:22:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T17:23:09.000Z (about 6 years ago)
- Last Synced: 2025-03-19T21:42:58.362Z (about 1 year ago)
- Language: JavaScript
- Size: 136 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Horizontal partitioning in MongoDB
This repository can be used as part of the ["Horizontal partitioning in MongoDB"](https://www.learncloudnative.com/blog/2020-05-12-creating-horizontal-partitions-or-shards-in-mongodb/) article.
## What's in this repo?
- `docker-compose.yml` = 3 MongoDB shards, a configuration server and a router
- `books.json` = sample data
- `init-config.js` = config file for the configuration server
- `init-router.js` = config file for the router
- `init-shard1.js` = config file for shard1
- `init-shard2.js` = config file for shard2
- `init-shard3.js` = config file for shard3
## How to get started?
Run `docker-compose up -d`, then configure all services. See the ["Horizontal partitioning in MongoDB"](https://www.learncloudnative.com/blog/2020-05-12-creating-horizontal-partitions-or-shards-in-mongodb/) article.