Skip to main content
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
[![Partitioning and Rebalancing Strategies (hash, range, hotspots) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_partitioning-strategies/opengraph-image)](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_5

COMPONENT STACK (9)

  • Application ServiceSTATEFUL
    Writes users and events by shard key
  • Shard routerSTATELESS
    Checks the JWT, then applies the table strategy
  • MongoDB shardSTATEFUL
    Hash bucket 0 to 1: even share of user ids
  • MongoDB shardSTATEFUL
    Hash bucket 2 to 3: even share of user ids
  • MongoDB shardSTATEFUL
    Newest range: every new event lands here
  • MongoDB shardSTATEFUL
    Older range: created_at before day 50, idle
  • Traces, metrics and logsSTATEFUL
    Write rate per shard shows a Hotspot
  • Capacity cardSTATELESS
    Toy sizing for the drawn tables
  • Platform OperatorSTATEFUL
    Changes the events shard key

REQUEST & DATA FLOW (9)

  1. Application Service → Shard router (Sends a write with a JWT)[HTTPS]
  2. Shard router → MongoDB shard (Hashes key to a bucket)[TCP]
  3. Shard router → MongoDB shard (Picks the newest range)[TCP]
  4. MongoDB shard → Shard router (Returns an ack)[TCP]
  5. MongoDB shard → Shard router (Returns an ack)[TCP]
  6. Shard router → Application Service (Returns an ack)[HTTPS]
  7. MongoDB shard → Traces, metrics and logs (Exports (OTLP))[OTLP]
  8. Platform Operator → Shard router (Re-shards events by hash)[HTTPS]
  9. MongoDB shard → MongoDB shard (Moves events to other shards)[TCP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →