Distributed Lock Service  ·  View 01 of 26  ·  1 · Context and scope

System Context

Who calls the service, what it depends on, and the stores outside the boundary that do the actual enforcing.

Editable source SVG draw.io All views
Callers Job schedulers Replica sets Entity workers People Service owner On-call SRE Security reviewer Platform dependencies Git + Argo CD lock class config SPIRE workload identity Keycloak operator sign-in Observability Prometheus · Tempo Distributed Lock Service leases + fencing tokens Guarded databases Guarded object stores Unfenced legacy stores run once elect leader lock a record declares classes inspects, releases reads audit classes SVIDs OIDC metrics token rule token rule risk register Distributed Lock Service — System Context Application we own Person or role Security / platform External / third party Risk / gap synchronous batch event / async failure / alternate v 1.0 · owner Platform Architecture · date 2026-09

Decisions

  • The service decides who is entitled to act on a key and makes that entitlement checkable later. It never performs the guarded work and never touches the guarded data.
  • Guarded resources sit outside the boundary but are drawn on the context view on purpose. Mutual exclusion is a property of their write path, and a context view that hides them implies the lock alone keeps writers apart.
  • Unfenced legacy stores are drawn as a risk, not as a customer. The service still issues ordered grants to them, and the gap is registered rather than forgotten.

Assumptions

  • A mid-size estate: a few hundred services, 300 namespaces, 2,000 client workloads and 40,000 sessions, all inside one organisation's data centres.
  • SPIRE, Keycloak, Git with Argo CD and the observability stack already exist as shared platform services. The lock service consumes them and owns none of them.
  • Kubernetes control-plane leader election keeps using Kubernetes Lease objects. A lock service that the cluster needs in order to start is a circular dependency.

Out of scope

  • Distributed transactions, sagas and cross-key atomicity. A lock is not a transaction and is not sold as one.
  • Rate limiting and idempotency for callers. Both are cheaper problems that are often mistaken for locking problems.