ARCHOS 525 BLUEPRINT · /d/dgm_partitioning-strategies
Partitioning and Rebalancing Strategies (hash, range, hotspots)
9 COMPONENTS · 9 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_partitioning-strategies) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_partitioning-strategies)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_partitioning-strategies" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Partitioning and Rebalancing Strategies (hash, range, hotspots) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
app_0[("Application Service")]
router_1["Shard router"]
h2_2[("MongoDB shard")]
h1_3[("MongoDB shard")]
r2_4[("MongoDB shard")]
r1_5[("MongoDB shard")]
metrics_6[("Traces, metrics and logs")]
capacity_7["Capacity card"]
operator_8[("Platform Operator")]
app_0 -->|"1. Sends a write with a JWT · HTTPS"| router_1
router_1 -->|"2a. Hashes key to a bucket · TCP"| h1_3
router_1 -->|"2b. Picks the newest range · TCP"| r2_4
h1_3 -->|"3a. Returns an ack · TCP"| router_1
r2_4 -->|"3b. Returns an ack · TCP"| router_1
router_1 -->|"4. Returns an ack · HTTPS"| app_0
r2_4 -->|"Exports (OTLP) · OTLP"| metrics_6
operator_8 -->|"Re-shards events by hash · HTTPS"| router_1
r2_4 -->|"Moves events to other shards · TCP"| r1_5COMPONENT STACK (9)
- Application ServiceSTATEFULWrites users and events by shard key
- Shard routerSTATELESSChecks the JWT, then applies the table strategy
- MongoDB shardSTATEFULHash bucket 0 to 1: even share of user ids
- MongoDB shardSTATEFULHash bucket 2 to 3: even share of user ids
- MongoDB shardSTATEFULNewest range: every new event lands here
- MongoDB shardSTATEFULOlder range: created_at before day 50, idle
- Traces, metrics and logsSTATEFULWrite rate per shard shows a Hotspot
- Capacity cardSTATELESSToy sizing for the drawn tables
- Platform OperatorSTATEFULChanges the events shard key
REQUEST & DATA FLOW (9)
- Application Service → Shard router (Sends a write with a JWT)[HTTPS]
- Shard router → MongoDB shard (Hashes key to a bucket)[TCP]
- Shard router → MongoDB shard (Picks the newest range)[TCP]
- MongoDB shard → Shard router (Returns an ack)[TCP]
- MongoDB shard → Shard router (Returns an ack)[TCP]
- Shard router → Application Service (Returns an ack)[HTTPS]
- MongoDB shard → Traces, metrics and logs (Exports (OTLP))[OTLP]
- Platform Operator → Shard router (Re-shards events by hash)[HTTPS]
- MongoDB shard → MongoDB shard (Moves events to other shards)[TCP]