Design a sharded MongoDB cluster for device telemetry before the replica set runs out
A device telemetry workload outgrows a single replica set when one primary can no longer take the writes or the working set no longer fits in RAM. Sharding fixes that, and the shard key is the decision you cannot cheaply undo. A key that rises with time, such as a timestamp alone, sends every new write to one shard. A compound key on device identifier and time spreads writes and keeps one device's readings together. A minimal production sharded cluster with three shards of three members, a three-member config server set and two query routers is 14 processes, before any hidden node or analytics member. OSStend designs the shard key, the shard count, the zones and the backup plan with you, then runs the cluster. For comparison, Amazon DocumentDB elastic clusters document sharding limits: only enableSharding and shardCollection are listed as supported, with balancer, moveChunk and reshardCollection commands marked unsupported (AWS docs, checked 23 Nov 2026).
45 minutes with an engineer: we review your workload and sketch the design.
- ✓MongoDB
- ✓Sharding design
- ✓IoT
- Service
- Design, then Run if you choose
- Key choice
- Compound key on device and time
- Minimum processes
- 14 for 3 shards, 3 config, 2 routers
- Output
- Signed design with sizing and test plan
- Runs where
- Your cloud account
Typical situation
Trigger. Ingest has grown with the device fleet and the single primary's write queue and cache are near their limit.
Versions. A current MongoDB major version on the sharded cluster; time series collections considered for readings.
- Writes arrive continuously from many devices
- Queries are by device and time range
- Data ages out on a retention schedule
A typical situation, not a named customer.
Designing a sharded MongoDB cluster for IoT means choosing a shard key that spreads writes, such as device identifier plus time, sizing shards from measured ingest and working set, and planning chunk balancing, zones and backups. OSStend writes the design, you sign it off, and OSStend builds and runs the cluster 24/7 in your cloud account.
Customers
Partners
- PostgreSQL
- MySQL
- MongoDB
- Redis
Valkey
- OpenSearch
- Kafka
- RabbitMQ
- AWS
- Google Cloud
- Azure
- Kubernetes
- OpenShift
- Prometheus
- Grafana
- Datadog
- Dynatrace
- Splunk
What OSStend runs and what you keep
OSStend engineers design, move and run the cluster; you keep the application, the data and the decisions about it. The split below is what is set in the design you sign off, and it is written into the contract.
| Area | OSStend | You |
|---|---|---|
| Shard key analysis | Tests candidate keys against your query and write patterns | Supplies representative data and queries |
| Sizing | Sets shard count, member size and storage from measured ingest | Supplies growth forecasts |
| Topology | Places members across zones and defines zone ranges if needed | Provides accounts and network |
| Build and load test | Builds a test cluster and replays load | Reviews the results |
| Backups | Designs consistent backups across shards and tests restore | Holds storage and retention policy |
| Run | Balancer windows, upgrades, 24/7 response | Owns the device pipeline and schema |
Where it can run
Sharded clusters need enough nodes that placement matters. For this use case the cluster runs in your cloud account; OSStend's cloud and your data center are possible when the fleet's edge sites call for them.
| Option | When it fits | Licence and source |
|---|---|---|
| Our cloud | Dedicated sharded clusters for teams with no cloud account for it | MongoDB Community Server is published under the Server Side Public License (MongoDB, checked 31 Oct 2026). OSStend runs MongoDB in its own cloud, in your cloud account or in your data center. |
| Your cloud account | The fleet already sends data to your cloud and egress should stay inside it | Same licence note; infrastructure on your bill |
| Your data center | Plant or edge sites that must keep data on site | Same licence note |
Licence placement comes from the OSStend licensing review, 19 Nov 2026. This table is not legal advice.
How the design works
A design is a short project with a written result and a load test behind it. Times are typical and agreed up front.
Workload review, 3 to 5 days
Measure writes per second, document size, query shapes, retention and the working set.
Shard key candidates, 3 to 5 days
Test two or three keys on sample data for write spread, query targeting and jumbo chunk risk.
Sizing and topology, 3 days
Set shard count, member size, storage and zones, and decide how routers are placed.
Build and load test, 1 to 2 weeks
Build a test cluster, replay load, force a shard failover and a balancer run, and record the results.
Sign-off and hand-over, 2 days
You sign the design. OSStend can build and run it, or hand the design to your team.
Cost basis
The process count is the first driver, because each shard is a replica set. No public list price covers a self-run sharded cluster, so we show the count and leave the price to the design.
| Component | Count in the minimum cluster | Notes |
|---|---|---|
| Shards | 3 replica sets of 3 members = 9 | Each member holds a full copy of its shard |
| Config server replica set | 3 | Holds cluster metadata |
| Query routers (mongos) | 2 | Applications connect here |
| Total processes | 14 | Before hidden or analytics members |
Counts are arithmetic from the topology above, not a vendor figure. Amazon DocumentDB elastic clusters list $0.132 per vCPU-hour in US East (AWS DocumentDB pricing, checked 23 Nov 2026); their sharding command support is in the AWS docs.
OSStend's own price is quoted per design after a 45-minute workload review. It depends on the node design, the service level tier and where the cluster runs; see pricing.
What we watch on call
Sharded clusters fail in ways a replica set does not. These are the patterns we watch and the signal behind each.
- Hot shard.
- One shard takes most of the inserts; per-shard write rate is compared across shards.
- Jumbo chunks.
- Chunks that cannot split because many documents share one key value; we alert on chunk size.
- Balancer lag.
- Migrations falling behind during heavy ingest; balancer windows are set and queue depth watched.
- Scatter-gather queries.
- Queries that omit the shard key and hit every shard; found in slow query logs.
- Config server health.
- Loss of the config replica set freezes metadata changes; we alert on election events.
- Orphaned documents.
- Leftovers after failed migrations, cleaned on a schedule.
When OSStend is not the right fit
The design fits when one replica set cannot carry the write rate or working set and you want the key right first. It does not when scaling up a single node is still cheap.
Contact us if
- ✓Ingest or data size is within a year of a single node's ceiling.
- ✓Queries are mostly by device and time range.
- ✓You want a load-tested design before building.
Not a fit if
- ✕A larger single replica set is still affordable and sufficient.
- ✕Queries have no common key to shard on.
- ✕You want sharding as a checkbox on a managed plan.
Questions buyers ask
Short answers to the questions that come up most on this kind of move. Each can be checked against the sources linked above.
Can the shard key be changed later?
MongoDB can reshard a collection, but it is a heavy operation. The design aims to get the key right so you never need to.
Should we use a time series collection?
It is tested in the design for readings that are written once and queried by time. The choice depends on your update and delete patterns.
Does a managed service shard for us?
Some do and some do not; check the documented command support, as the DocumentDB example above shows. See managed MongoDB.
How is this different from the Atlas cost use case?
That use case reviews a bill. This one designs a cluster before the ceiling, see Atlas cost assessment.
Related pages
- PricingDatabase as a service pricing: dedicated, tailoredDatabase as a service pricing from OSStend: dedicated, tailored clusters priced by engine, size, SLA tier and location. Enterprise only, with no free tier.
- MongoDBMongoDB hosting: managed replica sets, shardingMongoDB hosting run 24/7 by OSStend engineers: replica sets and sharded clusters with HA, backups, point-in-time recovery, monitoring and upgrades.
- Use caseMongoDB Atlas cost: an assessment for mediaAn Atlas cost assessment for a media platform: tier, storage, transfer and backup lines, a worked three-cluster example and when a move beats right-sizing.
Design the shard key before you need it
Bring write rate, document size and query shapes. An engineer will outline the design in 45 minutes.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





