System Design Atlas

Shift planning with qualifications and time tracking

06 / 10Worked example

The overall architecture

One datastore supports two domain modules. Which conditions ensure a valid result?

Planners and time reviewers need a shared person identity.

Starting point The time account remains independent.

Assumptions for the example case

A fictional maintenance operation with a defined qualification for each shift. The example requires 11 hours of rest between planned shifts; this is an exercise assumption and does not replace an employment-law review. All quantities, thresholds and operational objectives are illustrative assumptions.

Planning API and synchronization

Planning API and synchronization

Scheduling interfaceShifts
Offline applocal buffers
Scheduling APIEligibility + commands
Relational datastorePlan · Time records · Inbox
Synchronization workerAssigning device events
Qualification registerVersioned Q-47
Scheduling interface → Scheduling APIShift command
Offline app → Scheduling APIAuthenticated submission
Scheduling API → Relational datastorePlan + event inbox
Relational data store → synchronization workeraccepted device events
Synchronisation worker → Relational datastoreAssign time records
Scheduling API → Qualification registerVersioned Q-47
Qualification register → Scheduling APIValidity end

The interface and offline app use the authenticated API endpoint; planning and time records remain separate modules sharing a datastore.

The API and synchronisation worker share a datastore; the register is external, and the offline app has a local buffer.

Responsibilities within the application

Modules of the planning application

Staffing planningTracks qualifications and staffing
Eligibility checkChecks qualification evidence and rest periods
Shift assignmentSecures conflict-free intervals
Time recordsPreserves time entries and corrections
Bedarfsplanung → EignungsprüfungRequired qualifications
Eignungsprüfung → SchichtbindungEligible person
Schichtbindung → ZeitkontoPlan reference for deviation

Staffing needs, eligibility, assignment and time records remain separate responsibilities within the same API process.

Internal modules: Staffing planning maintains required qualifications and staffing levels. Eligibility checks verify qualification evidence and rest periods. Shift assignment protects confirmed intervals against conflicts. Time records preserve actual entries and corrections. The architecture maps these responsibilities to runtime processes and datastores.

Runtime components and authoritative data

Runtime boundary
Planning interface and offline app → scheduling API → relational datastore. A synchronisation worker associates durably accepted device events; eligibility checks read versioned qualification evidence from an external register. Shift planning and time records are separate modules sharing the datastore.
Module responsibilities
Staffing planning maintains required qualifications and staffing levels. Eligibility checks verify qualification evidence and rest periods. Shift assignment protects confirmed intervals against conflicts. Time records preserve actual entries and corrections.

One datastore supports two domain modules.

One datastore supports two domain modules.

The modules remain separate within the relational datastore.

Planners and time reviewers need a shared person identity.

Shift assignments and time accounts own different data. The API accepts input; the synchronisation worker associates device events.

Alternative considered
A common status mixes plan release and time release.
Trade-off
More states need to be explained.
Reassess
Independent load can justify later separation.

Try it yourself

Organize modules and processes.

A hint for your attempt

Planners and time reviewers need a shared person identity.

Compare with a possible solution
Modules
Shift assignment and time records own different data.
Processes
The API accepts input; the synchronisation worker associates device events.

Apply to your project

How does this principle apply in your own project: One datastore supports two domain modules.

Step 7: Resolve concurrency when confirming. Which conditions ensure a valid result?