Skip to main content
  1. System Design Components/

Mechanism Interface Boundary And Substitution Overlay

Mechanism Interface Boundary And Substitution Overlay #

Status: Archive candidate. Keep as historical reference; prefer system-design-core-index.md and the core notes for day-to-day use.

Narrow overlay note; not part of the active working set.

Use this on top of the existing mechanism families.

The point is not to replace the runtime mechanism taxonomy.

The point is to add the modularity questions that Design Rules emphasizes:

  • what module is authoritative
  • what interface is exposed
  • what implementation stays hidden
  • what can be substituted cleanly
  • how the mechanism usually evolves

How To Use This #

For any chosen mechanism:

  1. name the family
  2. identify the authoritative module
  3. name the published interface
  4. name the hidden module
  5. list realistic substitutions
  6. list likely evolution moves

Template:

  • family:
  • authoritative module:
  • published interface:
  • hidden module:
  • substitution options:
  • evolution moves:

Overlay Table #

FamilyAuthoritative ModulePublished InterfaceHidden ModuleSubstitution OptionsCommon Evolution Moves
Guarded Writetruth store that decides whether the mutation is validconditional put/update, uniqueness rule, transaction boundary, version tokenlock strategy, index layout, storage engine, conflict detection internalsCAS vs unique constraint vs transaction vs conditional updatesplit validation from effect, augment with outbox, invert from app-enforced to data-enforced guard
Ownership Controllease/claim service or ownership row that decides current actorclaim, renew, release, fencing token semantics, expiry semanticsliveness detector, expiry wheel, storage of lease rows, reaper detailsDB row lease, Redis lease, etcd lease, ZooKeeper ephemeral nodesplit detector from owner store, add fencing, partition ownership domain, augment with reaper/reconciliation
Append + Replayappend log that defines accepted order and durable historyappend, read from offset, commit/checkpoint, retention contractsegment layout, replication, compaction, batching, checkpoint storageDB WAL/CDC, Kafka, Pulsar, parent-local append tablesplit hot append from cold archive, add snapshots, invert from direct writes to log-first writes
Projection + Catch-Upsource truth plus projector checkpoint that defines applied progresschangelog subscription, projector output schema, replay/rebuild contractbatching, projector scheduling, tombstone handling, backfill internalstrigger-based view, CDC worker, stream processor, rebuild jobsplit projector by view, augment with rebuild lane, exclude low-value projections, substitute push with pull rebuild
State Propagationsource truth or control plane revision streamwatch, list snapshot, resume from version, monotonic apply contractpoll cadence, fanout transport, local cache format, apply schedulerpoll, watch, pub/sub, push-version/pull-snapshotsplit transport from apply engine, augment with local snapshot, invert from push to pull, port across agents/SDKs
Immutable Publicationmanifest/head pointer that names the published versionblob upload API, manifest schema, head/ref advance, reachability contractchunking, dedup, GC, placement, replicationGit refs, OCI manifests, package registry metadatasplit content store from namespace, add CDN/cache, augment with dedup, invert from mutable overwrite to immutable publish
Time Gatingdue-time truth that defines eligibilityschedule, delay until, scan due, expiry semantics, lateness contracttimer wheel, shard layout, scanner cadence, sweep batchingdelay queue, timing wheel, due-index scanner, cron evaluatorsplit scheduling from execution, add runnable materialization, partition by time bucket, augment with jitter
Frontier Progressionfrontier/checkpoint state that defines covered vs uncovered workclaim range, advance checkpoint, resume token, coverage contractpartitioning, scan order, split/merge heuristics, retry schedulercursor scan, range claim table, crawler frontier, ETL checkpoint storesplit frontier by shard, augment with snapshots, add reconciliation sweep, invert from full scan to resumable scan
Selection / Assignmentscorer/assignment truth that decides chosen candidatecandidate request, scoring inputs, assignment record, acceptance/expiry rulesranking heuristics, feature computation, batching window, fallback logicgreedy assignment, batched optimizer, nearest-neighbor, auction/scoring enginesplit retrieval from scoring, augment with precompute/index, partition by pool, invert from push to candidate pull
Delivery + Acknowledgmentdelivery record or outbox/inbox state that decides outstanding workenqueue, deliver, ack, retry semantics, dedup keyretry backoff, batching, transport choice, replay window storageoutbox relay, broker delivery, webhook engine, websocket replay buffersplit producer from relay, augment with inbox dedup, add DLQ/reconciliation, partition retry lanes
Aggregation / Approximationaggregate state or window state that defines the served summaryincrement/update API, query contract, approximation/error contractheap/sketch maintenance, merge schedule, compaction, shard-local combineexact counters, sketches, heap + window, periodic recomputesplit exact truth from approximate view, augment with hierarchical aggregation, substitute exact with approximate at scale
Placement / Schedulingscheduler/placement state that decides where work runssubmit work, score/filter contract, bind/reserve semantics, capacity modelqueue layout, heuristics, preemption logic, backoff, warm-pool handlinggreedy scheduler, fair-share scheduler, bin-pack planner, work stealingsplit by pool/zone, add local snapshots/indexes, augment with reservation/assume, invert from central queue to partitioned schedulers

Repeated Modularity Moves #

These are the recurring Design Rules style moves across the mechanism families.

Split #

Separate one overloaded module into two clearer ones.

Examples:

  • State Propagation: split transport from local apply/cache
  • Placement / Scheduling: split candidate retrieval from scoring/binding
  • Immutable Publication: split namespace head from blob store

Substitute #

Swap one realization for another while preserving the contract.

Examples:

  • Ownership Control: DB row lease -> etcd lease
  • State Propagation: poll -> watch
  • Aggregation / Approximation: exact count -> sketch

Augment #

Add a support module without changing the primary contract.

Examples:

  • Guarded Write: add outbox
  • Projection + Catch-Up: add rebuild lane
  • Placement / Scheduling: add warm pools or fairness queue

Exclude #

Remove an expensive module from the hot path.

Examples:

  • remove synchronous projection updates from write path
  • remove exact ranking from online path and serve approximate top-k
  • remove full replay from hot recovery path by adding snapshots

Invert #

Flip which module is primary and which is derived.

Examples:

  • direct write -> log-first write
  • mutable overwrite -> immutable publish plus head move
  • push every update -> push version and let clients pull snapshot

Port #

Reuse the same interface contract in a new environment.

Examples:

  • same watch/snapshot contract across agent, SDK, and control-plane client
  • same manifest/blob publish model across container images and package registries
  • same lease/fencing semantics across job claim and shard ownership

Practical Reading Rule #

If a concrete design feels messy, ask:

  1. what module is authoritative
  2. what interface is actually stable
  3. what implementation detail is leaking
  4. what should be substitutable but is not
  5. which modularity move would simplify it:
    • split
    • substitute
    • augment
    • exclude
    • invert
    • port

That is the Design Rules overlay on top of the runtime mechanism families.


Interview Shortcut #

Good answer shape:

The mechanism family here is Ownership Control, implemented as claim + lease + fencing. The authoritative module is the lease store, the published contract is claim/renew/release + epoch, and the hidden module is liveness detection and expiry sweeping. If scale or reliability changes, I can substitute the realization from a DB row lease to etcd without changing the external ownership contract.