Before Sharding
- sharding is an horizontal scaling solution
- Have you reached the limits of our vertical scaling
- Need to understand how data grows and how data is access
- Sharding works by defining key base ranges
- It's important to have a shardkey
- frequency
- Rate of change - Avoid monotonically increasing or decreasing values
order: Execute operations one by one if "true" else execute operations in parallel
Reading from Secondaries
When reading from secondary is a good idea
- Offloading work
- Local reads
When reading from secondary is a bad idea
- In general
- Reading from shard directly
Aggregation Pipeline on a Sharded Cluster