HLDArena
HLD-411·Transactions & Locking
Expert · 2,000 pts

Geo-Partitioned Distributed SQL & Serializable Transaction Engine

Design a Spanner / CockroachDB-inspired range-partitioned transactional database proxy supporting multi-key serializable commits, range splits, and leader lease failover.

Max p99
≤ 95 ms
Availability
≥ 99.5%
Budget
≤ $11,600

Functional Requirements

  • FR-1POST /sql/tx/{range_key}/commit — Executes 2PC/Raft-replicated serializable write transaction.
  • FR-2GET /sql/tx/{range_key}/read — Serves bounded-staleness or linearizable point/range reads.
  • FR-3DELETE /sql/tx/{range_key}/commit — Releases canceled or expired leases/holds atomically and immediately refreshes cached availability.
  • FR-4Zero lost committed transactions (RPO = 0) and zero write-skew anomalies during range leader crash.

Workload Profile

Steady OLTP Workload62,000 Read RPS / 12,000 Commit Write RPS
End-of-Month Settlement Peak165,000 Read RPS / 36,000 Commit Write RPS
Active Working Set46 GB hot KV tablet ranges & lock tables
Consistency GateStrict serializable isolation + RPO = 0 synchronous quorum

Consistency Model

External consistency / strict serializable isolation with Raft/Paxos quorum replication.

Design Write-up
0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 190 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology