- My Development Notes/
- System Design Components/
- Archetype State, Actors, Failure, and Scale Reference/
Archetype State, Actors, Failure, and Scale Reference
Archetype State, Actors, Failure, and Scale Reference #
Use this as the compact reference once you have identified an archetype.
The goal is to answer five questions quickly:
- what states exist?
- which states are source of truth?
- who acts on those states?
- what fails by default?
- what gets hot first?
The failure and scale vocabulary below is normalized to match the repo’s standard wording as closely as possible.
Product Archetypes #
| Archetype | Canonical States | Source-of-Truth States | Actors | Default Failure Vocabulary | Default Scale Hotspots |
|---|---|---|---|---|---|
A01 Current-Value Entity | XState | XState | user, API/service, cache | retry ambiguity on write, concurrent overwrite race, stale read after update, cache invalidation lag | hot entity read skew, write contention on hot entity, cache invalidation churn |
A02 Relation / Edge | XRelationState, XCountView | XRelationState | user, API/service, projector | duplicate edge creation on retry, add/remove race, count projection lag, stale relation list cache | celebrity skew, hot relation partition, hot count key, hot relation-list pages |
A03 Append-Only Child Object | XChildState, XThreadView | XChildState | user, producer, moderation service, projector | duplicate child creation on retry, projection/search lag after append, delete/edit race, moderation/removal lag, concurrent edit/delete race | hot parent append rate, hot thread reads, long history scans |
A04 Workflow / Lifecycle State | XWorkflowState | XWorkflowState | user, operator, workflow service, side-effect worker | retry of same transition after commit, invalid transition from stale state, competing transitions, crash after transition but before side effect, stale status read | hot workflow transition rows, expensive status polling, side-effect worker backlog |
A05 Derived Projection | XSourceState, XView | XSourceState | source writer, projector, reader | stale projection, missing entry, duplicate entry, tombstone not propagated, expensive reindex after schema change, stale ranking after source update | fanout on write, projection lag, expensive ranking/recompute, query fanout across shards, rebuild cost |
A06 Inventory / Constrained Resource | XInventoryState | XInventoryState | user, allocator/service, release path | oversell, double allocate, lost release, stale availability read | hot inventory key, concentrated contention on scarce resources, fragmented capacity |
A07 Critical Transaction Process | XRequestState, XTransactionState, XMovementState | XTransactionState, XMovementState | user, transaction service, external provider, reconciler | duplicate commit, invalid transition, crash after commit before side effect, retry ambiguity against provider, reconciliation drift | synchronous commit-path latency, external provider bottleneck, retry amplification, idempotency-store hotspot |
A08 Time-Bounded Exclusive Allocation | XHoldState, XBookingState, XInventoryState | XHoldState, XInventoryState | user, booking service, expiry worker | duplicate hold, expired hold not released, confirm-after-expiry race, cancel/confirm race, stale availability after hold expiry | hot hold key, hold storms, expiry scan pressure, hold-store contention |
A09 Future Constraint + Claimable Run | XScheduleState, XRunnableJobState, XExecutionState, XHistoryView | XScheduleState, XRunnableJobState | user, scheduler, due scanner, worker | due item materialized twice, due item never materialized, job claimed twice, run executed but result not recorded | due-time burstiness, due bucket/index hotspot, queue backlog, worker burst pressure |
A10 Frontier + Claimable Run | XFrontierState, XBatchRunState, XCheckpointState, XProgressView | XFrontierState, XCheckpointState | operator, scanner, worker | frontier advanced too far, same frontier item claimed twice, progress not advanced after success, uncovered work skipped | frontier hot row, batch-claim bursts, skewed range/work distribution, checkpoint lag |
A11 Control Plane + Local Snapshot | XConfigState, XSnapshotState, XAppliedVersionState | XConfigState | admin, control plane, agent/evaluator, publisher | stale snapshot, out-of-order apply, partial rollout, old config still serving locally | rollout fanout to many agents, snapshot distribution bursts, hot tenant config, snapshot size |
A12 Matching / Assignment | XRequestState, XAssignmentState, XExecutionState | XRequestState, XAssignmentState | user, matcher, candidate, executor | duplicate assignment, stale candidate accepted, timeout/reassignment race, assignment accepted after expiry | candidate lookup breadth, hot assignment pool, reassignment churn, timeout worker load |
A13 Ranking / Leaderboard | XSubmissionState, XBestState, XAggregateState, XLeaderboardView | XSubmissionState, XBestState, XAggregateState | user, producer, ranker, reader | duplicate submission, stale rank, incorrect top-K, ranking lag after score update | global aggregation, hot score updates, hot window state, ranking store saturation |
A14 Realtime Fanout | XMessageState, XDeliveryState, XRecentWindowView | XMessageState | user, session/websocket service, fanout worker | missed delivery, duplicate replay, out-of-order fanout, reconnect replay gap | fanout explosion, websocket fleet pressure, egress bandwidth, hot room/channel |
A15 Search-First Product | XListingState, XIndexEntryState, XSearchView | XListingState | user, writer, indexer, search service | stale index, missing result, tombstone lag, broad query inconsistency during reindex | hot query terms, broad query fanout, index freshness pressure, search shard saturation |
A16 Auction / Competitive Window | XAuctionState, XBidState, XBestBidState, XWinnerState, XHistoryView | XAuctionState, XBidState, XBestBidState | bidder, auction service, closer | accepted late bid, wrong winner, duplicate close, stale current-best read near close | burst bids near close, hot auction row, current-best contention, append hotspot for hot auction |
A17 Shared Mutable Subject | XOperationLog, XSubjectState, XVersionState, XSnapshotState | XSubjectState, XOperationLog | collaborator, coordinator, session service, projector | lost concurrent edit, duplicate op, out-of-order apply, divergence, stale coordinator snapshot | hot-subject coordinator, high per-subject op rate, replay cost, subscriber fanout |
A18 Versioned Namespace + Immutable Content Units | XNamespaceState, XVersionState, XBlobState, XSyncCursorState, XConflictState | XNamespaceState, XVersionState, XBlobState | user, sync client, metadata service, blob store, conflict resolver | namespace CAS race, sync cursor treated as source of truth, content uploaded but namespace not advanced, reconnect storm, conflict not materialized | namespace metadata contention, reconnect/sync storms, popular chunk read amplification, dedup check pressure |
A19 Catalog + Scoped Relation | XDefinitionState, ParentXRelationState, XView | XDefinitionState, ParentXRelationState | admin, scoped attach/detach service, projector, reader | duplicate attachment, missing detach, stale scoped view, aggregate count drift | hot scoped relation partition, attach/detach churn, aggregate maintenance pressure, projection lag |
Infrastructure Archetypes #
| Archetype | Canonical States | Source-of-Truth States | Actors | Default Failure Vocabulary | Default Scale Hotspots |
|---|---|---|---|---|---|
I01 Coordination / Consensus Metadata | LeaseState, LeadershipState, MembershipState, RevisionedConfig | LeaseState, LeadershipState, MembershipState, RevisionedConfig | client, leader, follower, watcher | split brain, stale leader/stale holder, watch gap on reconnect, follower stale read | quorum write latency, hot metadata key, watch fanout |
I02 Claim / Lease / Exclusive Ownership | ClaimState, LeaseState, OwnerEpoch | ClaimState, LeaseState, OwnerEpoch | worker, claimant, renewer, reconciler | duplicate claim, stale holder acting after expiry, lease expiry race, orphaned claim after crash | hot claim key, heartbeat/renew storm, lease-manager contention |
I03 Due-Time Release + Claimable Run | ScheduledState, RunnableJob, ExecutionState | ScheduledState, RunnableJob, ExecutionState | submitter, due scanner, worker | due item materialized twice, due item never materialized, job claimed twice, run executed but result not recorded | due-time bucket hotspot, cron boundary burst, queue backlog, worker burst |
I04 Frontier Scan + Claimable Run | FrontierState, BatchRun, CheckpointState | FrontierState, BatchRun, CheckpointState | scanner, worker, reconciler | frontier advanced too far, same range claimed twice, progress not advanced after success, already-covered range reprocessed | frontier contention, skewed range claims, checkpoint lag, bursty batch materialization |
I05 Append Log + Consumer Progress | LogSegment, Offset, ConsumerProgress | LogSegment, ConsumerProgress | producer, broker, consumer | duplicate consumption, offset advanced before effect committed, consumer lag, out-of-order processing across partitions | hot partitions, log I/O, lag buildup, rebalance churn |
I06 Projection / Index / Search Pipeline | SourceEntity, IndexEntry, ProjectionVersion | SourceEntity, IndexEntry, ProjectionVersion | writer, CDC/outbox, projector, query service | stale index, missing entry, duplicate entry, tombstone not propagated | projector lag, rebuild cost, hot search/index shards, broad query fanout |
I07 Cache / Origin Projection / Edge Delivery | OriginState, CacheEntry, PurgeVersion | OriginState | client, cache node, origin service, invalidator | stale cache, invalidation miss, cache stampede, origin fallback inconsistency | hot key, miss storm, origin overload, invalidation fanout |
I08 Rate Limit / Budget / Token Accounting | BudgetState, WindowState, TokenBucketState, ConfigState | BudgetState, WindowState, TokenBucketState, ConfigState | client, evaluator, control plane | over-admit under race, stale policy, token drift, incorrect local snapshot apply | hot tenant/account key, fleet-wide config rollout, evaluator hot path |
I09 Sequence / Identifier Generation | CounterState, RangeLeaseState, WorkerIdState, EpochState | CounterState, RangeLeaseState, WorkerIdState, EpochState | client, allocator, leased node | duplicate IDs, non-monotonic IDs, worker-id exhaustion, clock rollback / stale epoch | allocator hot spot, worker-id pool contention, lease refresh pressure |
I10 Membership / Presence / Registry | MemberState, PresenceState, RegistryVersion | MemberState, PresenceState, RegistryVersion | node, session service, watcher | false liveness, false death, ghost member, watch gap | heartbeat fan-in, hot room/group membership, registry fanout |
I11 Control Plane + Snapshot Distribution | ConfigState, SnapshotState, AppliedVersionState | ConfigState | admin, publisher, agent/evaluator | out-of-order snapshot apply, stale local config, partial rollout, old revision still active | snapshot distribution fanout, hot tenant config, snapshot size, rollout bursts |
I12 Workflow + External Side Effect | WorkflowState, OutboxState, EffectState | WorkflowState, OutboxState, EffectState | user, workflow service, external dependency, reconciler | effect succeeded but ack lost, duplicate side effect, stuck reconciliation, invalid workflow transition around effect | external dependency latency, retry storms, outbox relay backlog |
I13 Shared Subject Coordination | OperationLog, SubjectState, VersionState | OperationLog, SubjectState, VersionState | client, coordinator, subscriber | duplicate op, out-of-order op, divergence, stale coordinator | hot-subject coordinator, replay cost, per-subject ordering bottleneck |
I14 Immutable Artifact Namespace + Delivery | ArtifactState, ManifestState, NamespaceHeadState, BlobState | ArtifactState, ManifestState, NamespaceHeadState, BlobState | publisher, downloader, CDN/blob store | orphaned artifact, stale head, manifest pointer mismatch, missing blob after head advance | origin bandwidth, head/manifest contention, popular artifact amplification |
I15 Execution Fleet + Worker Substrate | WorkerState, CapacityState, PlacementState, ExecutionLeaseState, ExecutionAttemptState, RuntimeSlotState | CapacityState, PlacementState, ExecutionLeaseState, ExecutionAttemptState | invoker, placement service, worker, reconciler | duplicate placement, stale completion after lease expiry, capacity leak after worker crash, stranded placed-but-never-started work, cold-start amplification | worker saturation, placement contention, cold starts, heartbeat fan-in, noisy-neighbor pressure |
Quick Usage Rules #
Canonical Statesare the states you should be ready to name in entities/HLD.Source-of-Truth Statesshould be treated as the authoritative subset ofCanonical Statesduring failure analysis.Actorsshould appear on the important edges in the HLD.Default Failure Vocabularygives you the first deep-dive talking points.Default Scale Hotspotsgive you the first bottleneck answer before concrete numbers.
Interview Shortcut #
For any prompt, once the archetype is identified, be ready to say:
The source of truth here is ...The default failure mode is ...The first thing that gets hot is ...
That is usually enough to keep the first-pass design on track.
Product Starter HLD Boxes #
Use these as the first service/store anchors when the product archetype is primary.
| Archetype | Starter HLD Box |
|---|---|
A01 Current-Value Entity | Entity Service -> Entity Store [truth] |
A02 Relation / Edge | Relation Service -> Edge Store [truth] |
A03 Append-Only Child Object | Append/Message Service -> Child Log/Table [truth] |
A04 Workflow / Lifecycle State | Workflow Service -> Workflow Store [truth] |
A05 Derived Projection | Source Write Service -> Source Store [truth], then Projector -> Projection Store [proj] |
A06 Inventory / Constrained Resource | Inventory Service -> Inventory Store [truth] |
A07 Critical Transaction Process | Transaction Service -> Transaction Store [truth], then Outbox/Effect Worker |
A08 Time-Bounded Exclusive Allocation | Hold/Booking Service -> Hold Store [truth] + Inventory Store [truth] |
A09 Future Constraint + Claimable Run | Scheduler API -> Schedule Store [truth], then Due Scanner -> Runnable Queue |
A10 Frontier + Claimable Run | Frontier Service -> Frontier Store [truth], then Workers -> Batch/Claim Store |
A11 Control Plane + Local Snapshot | Config Control Plane -> Config Store [truth], then Snapshot Publisher -> Agents |
A12 Matching / Assignment | Matching Service -> Request Store [truth] + Assignment Store [truth] |
A13 Ranking / Leaderboard | Ranker/Aggregator -> Aggregate Store [truth or proj] |
A14 Realtime Fanout | Message/Event Service -> Message Log [truth], then Fanout Service -> Session/Websocket Tier |
A15 Search-First Product | Search API -> Index/Search Store [proj], with Indexer <- Source Store [truth] as the write-side anchor |
A16 Auction / Competitive Window | Auction Service -> Auction Store [truth] + Bid Log [truth] |
A17 Shared Mutable Subject | Coordinator/Doc Service -> Subject State [truth] + Operation Log [truth] |
A18 Versioned Namespace + Immutable Content Units | Namespace Service -> Namespace Store [truth] + Version/Blob Store [truth] |
A19 Catalog + Scoped Relation | Catalog Service -> Definition Store [truth] + Scoped Edge Store [truth] |
Infra Starter HLD Boxes #
Use these as the first control/state anchors when the infrastructure archetype is primary.
| Archetype | Starter HLD Box |
|---|---|
I01 Coordination / Consensus Metadata | Coordination API -> Quorum Metadata Store [truth] |
I02 Claim / Lease / Exclusive Ownership | Claim/Lease Service -> Lease Store [truth] |
I03 Due-Time Release + Claimable Run | Scheduler API -> Schedule Store [truth], then Due Scanner -> Runnable Store/Queue [truth] |
I04 Frontier Scan + Claimable Run | Frontier Manager -> Frontier Store [truth], then Workers -> Claim/Checkpoint Store [truth] |
I05 Append Log + Consumer Progress | Producer/Broker Front Door -> Append Log [truth] |
I06 Projection / Index / Search Pipeline | Source Store [truth] -> Projector/Indexer -> Projection Store [proj] |
I07 Cache / Origin Projection / Edge Delivery | Client -> Cache Tier, with Origin Store [truth] directly behind it |
I08 Rate Limit / Budget / Token Accounting | Evaluator/Rate Limit Service -> Budget Store [truth], optionally Control Plane -> Config Store |
I09 Sequence / Identifier Generation | ID Allocator -> Counter/Range Lease Store [truth] |
I10 Membership / Presence / Registry | Registry/Presence Service -> Membership Store [truth] |
I11 Control Plane + Snapshot Distribution | Control Plane -> Config Truth Store [truth], then Snapshot Publisher -> Agents |
I12 Workflow + External Side Effect | Workflow Service -> Workflow Store [truth] + Outbox [truth], then Effect Worker -> External System |
I13 Shared Subject Coordination | Coordinator -> Subject State [truth] + Operation Log [truth] |
I14 Immutable Artifact Namespace + Delivery | Publisher/Namespace Service -> Namespace Head Store [truth] + Artifact/Manifest Store [truth] |
I15 Execution Fleet + Worker Substrate | Placement Service -> Worker/Capacity State [truth] + Execution Attempt State [truth] |