System Design Atlas

Sensor monitoring with late measurements

06 / 10Worked example

The overall architecture

Which decision must remain explicit outside the ingestion process?

The domain tasks from the overview appear as an ingestion component, raw event log, projector, and time-window data store. This is a runtime view; the component view then separates their internal responsibilities.

Starting point Step 5 separates raw events, windows and alert states.

Assumptions for the example case

Example design with 10,000 temperature devices, one value every 10 seconds. An example of a time period ranges from 12:00 to immediately before 12:01. The evaluation will be completed at 12:03 at the earliest. The waiting time of 120 seconds after the end of the time period is an evaluation rule and not a permitted deviation of the instrument clock. Numbers and temperatures are illustrative design assumptions.

Locate the gateway, ingestion, raw log, projector and result store

Runtime view · Durable ingestion, replayable projection and separate display

Gatewaysends QoS-transported measured values
Building teamReviews history and alerts
Notification serviceProvides communications; external delivery commitment

System boundary · Sensor monitoring

Ingestion and team APIProcess: accepts, reads history, acknowledges with access protection
Raw event logAuthoritative immutable input
ProjectorWindow, timer, rule TEMP-3
Result storeTime indexes; atomic updates to windows, alerts, checkpoints and outbox
Gateway → Ingestion: messageIngestion → Raw log: commitProjector ← Raw log: replay from checkpointProjector → Result store: window, alert, checkpoint and outbox atomicallyBuilding team → Team API: Read history / acknowledge AL-17Team API ↔ Result store: authorised reads and acknowledgementsTeam API → Building team: history and AL-17Projector → Notification service: outbox request for AL-17Notification service → Building team: notification, repetition possible
  • Gateway, Team, Notification
  • Ingestion and projector
  • Raw log, time series and result store

Ingestion acknowledges after persisting the raw log. The projector can resume from its checkpoint and updates windows and alerts idempotently.

The runtime view shows process boundaries, durable acceptance and the replayable data path.

Dividing the input and projector processes into domain modules

Component view · Collaboration within two processes

Ingestion process

Device authenticationCheck keys and D-17
Acceptance inboxWrite the key and raw value permanently
QuarantineConflict, future clock, unknown device
Team APICheck tenant, read history and acknowledge alert

Projector process

Window projectorTrack event time and timers
Alert ruleApply TEMP-3 only at final status
Checkpoint and deliveryCommit finalisation atomically; retry outbox deliveries
Device Authentication → Acceptance Inbox: Verified IdentityAcceptance inbox → Quarantine: Conflict or time errorWindow projector → Alert rule: final measurement count and meanAlert rule → Checkpoint and delivery: commit result and outbox atomicallyTeam API → Result store: authorised query / acknowledgement
Joint Data ContractDevice · Boot session · Raw event · Window · Alert · Checkpoint
  • Domain modules
  • Joint contracts
  • Device and team

The ingestion module creates no alerts. The projector evaluates only durably accepted raw values and protects result updates with a checkpoint and unique keys.

The component view separates device authentication, ingestion, quarantine, window projection, alert rules and checkpoints.

Map domain responsibilities to technical components

Technical taskComponentCooperation
Assign devicesDevice authenticationChecks keys and tenants before writing the raw log.
Reliably accept valueIngestion and raw event logWrites deduplication and raw value before confirmation.
Apply time ruleWindow projectorReads from Checkpoint and runs processing timers.
Explain alertsAlert rule and result storeWrites the final result with TEMP-3 and makes it readable.
Reading and acknowledgingAPI in the input processChecks tenant and building-team permissions; reads the result store and updates acknowledgement atomically.
NotificationNotification delivery module in the projectorReads the durable delivery request; the external service receives AL-17 as a stable reference.

Assign devices

Component
Device authentication
Cooperation
Checks keys and tenants before writing the raw log.

Reliably accept value

Component
Ingestion and raw event log
Cooperation
Writes deduplication and raw value before confirmation.

Apply time rule

Component
Window projector
Cooperation
Reads from Checkpoint and runs processing timers.

Explain alerts

Component
Alert rule and result store
Cooperation
Writes the final result with TEMP-3 and makes it readable.

Reading and acknowledging

Component
API in the input process
Cooperation
Checks tenant and building-team permissions; reads the result store and updates acknowledgement atomically.

Notification

Component
Notification delivery module in the projector
Cooperation
Reads the durable delivery request; the external service receives AL-17 as a stable reference.

Product neutral start

A common backend
Ingestion with the team API and the projector are two explicitly named processes. The raw log and transactional result store are separate logical stores; initially, they may share a database. An append-oriented raw log supports replay; relational transactions protect windows, alerts and checkpoints; time indexes support range queries.
Later distribution
Separate scaling or further projections require measured evidence of backlogs, isolation needs or different query patterns.
Notification and service
Where needed, the transaction writes a unique alert delivery request to an outbox, a durable list of pending deliveries. The projector sends it to the external notification service and retries with the same reference after an uncertain outcome. Without provider deduplication, the notification may arrive twice; AL-17 remains a unique domain object visible through the API.

Terms in this step

Checkpoint
Saved processing progress. It allows restart without blindly repeating the business effect.
Modular process
A runtime unit with clear domain components. A module does not automatically require a separate service.

Try it yourself

Assign acceptance, window finalisation and the alert rule to ingestion or the projector. Add a storage test.

A hint for your attempt

Ingestion knows the message; time-based domain evaluation requires replayable raw measurements and the timer.

Compare with a possible solution
Input
Authenticates D-17, checks the key and persists raw value plus deduplication. Test: no confirmation before commit; after commit, M-17 is readable.
Projector
Forms W-17, waits 120 seconds after the window ends and applies TEMP-3. Test: restarting from a checkpoint does not finalise the window twice.
Boundary
The result store separates the raw log from team queries. Test: a history read error must not create a new alert.

Apply to your project

Which process boundary separates acceptance from replayable domain effects in your design?

Step 7 tests this boundary with the critical sequence: duplicates, delays and restart.