Smart Healthcare System
Architectural drivers, option comparison, and a defensible architecture decision - quality attributes made concrete.
advanced3-4 hours
What you will produce
- Driver list
- Architecture comparison
- Architecture sketch
- Deployment outline
- Justification report
St. Vera Health runs four hospitals and a network of outpatient clinics. The board has approved a remote patient monitoring program: discharged cardiac patients wear devices that stream heart rate, blood pressure, and oxygen saturation every few seconds. Clinicians need live dashboards, and — the part everyone underlines in the contract — automatic alerts when vitals cross patient-specific thresholds. A delayed alert is not a UX annoyance; it is a potential clinical incident.
Two constraints make this harder than a greenfield startup app. First, the hospitals already run an electronic health record (EHR) system that is not going away; monitoring data and alert history must flow into it. Second, healthcare regulation demands auditability — who accessed which record, when — and strong protection of patient data at rest and in transit.
You are the architect. The deliverable is not a diagram; it is a decision you can defend. In this project you will turn the scenario into measurable architectural drivers, compare three candidate architectures against those drivers, sketch the chosen structure in Studio, outline its deployment, and write the justification report. There is no correct architecture for this system — only defensible ones. The report is the real product.
Before you start
- Read layered architecture and microservices trade-offs — Steps 2 and 3 lean on both.
- Be comfortable drawing dependency arrows; Step 4 is a module diagram, not a class model.
- Skim the dependency inversion principle — you will use it to keep the alerting path isolated.
- Open DiaGO Studio's component editor for Step 4 and the deployment editor for Step 5. Steps 1-3 and 6 are text and tables — do them on paper or in a document.
Step 1: Identify the architectural drivers
"Fast alerts" and "secure data" are wishes, not requirements. A driver must be concrete enough that two architectures can score differently against it. Use the format stimulus -> response measure: an event the system experiences, and a measurable statement of how it must respond.
Write at least six drivers. Cover: availability of alerting, a latency bound on the vitals-to-alert path, auditability, data protection, and integration with the legacy EHR. Here is a start — finish the table yourself:
| Driver | Stimulus | Response measure |
|---|---|---|
| Alert latency | Device reports oxygen saturation below a patient threshold | Alert visible on a clinician device within 60 seconds, 99th percentile |
| Alerting availability | One ingestion node fails during normal operation | Alert processing continues; no gap longer than 30 seconds |
| Auditability | Auditor requests the access history of one patient record | Complete who-what-when trail produced within one business day, tamper-evident |
| Data protection | ... | ... |
| Legacy integration | ... | ... |
The numbers can be invented — you are the architect, and someone has to propose them — but they must be written down. A driver without a measure cannot discriminate between options, which makes Step 2 impossible.
Step 2: Compare architecture options
Compare three candidates:
- Layered monolith — one deployable, internally layered as described in layered architecture.
- Modular monolith with an extracted real-time alerting service — records, dashboards, and EHR integration stay in one deployable; the ingestion-to-alert path runs as a separate service.
- Full microservices — every module its own service, with all the costs cataloged in microservices trade-offs.
Score each option against your drivers from Step 1 — not against generic pros and cons. "Microservices scale better" is meaningless; "microservices let the ingestion path scale independently, which driver 2 requires" is an argument. Build a table on paper; two rows are filled in to show the level of specificity expected:
| Driver | Layered monolith | Monolith + alerting service | Full microservices |
|---|---|---|---|
| Alert latency (60 s, p99) | At risk: alert evaluation shares a process and database with dashboard queries and EHR sync jobs | Strong: dedicated path with its own resources, tunable in isolation | Strong, but each extra network hop must be budgeted inside the 60 s |
| Auditability | Simple: one database, one audit log, one clock | Moderate: two audit sources to correlate | Hard: distributed log correlation across many services |
| Alerting availability | ... | ... | ... |
| Operational cost for a hospital IT team | ... | ... | ... |
Step 3: Select and justify
Pick one. For this scenario, the middle option is usually the strongest: records, dashboards, and EHR integration have ordinary web-application requirements and gain little from being split, while the vitals-to-alert path has a hard latency and availability profile that justifies its own process, its own scaling, and its own failure domain.
Reach for it
- One path through the system has hard latency or availability requirements the rest does not
- The team is small enough that a single deployable for everything else is cheaper to run
- The boundary around the extracted path is crisp and needs little synchronous data from the rest
Avoid it
- Every module has similar quality requirements and none dominates
- The extracted path would need constant synchronous calls back into the monolith
- The organization already operates a mature microservices platform and one-off hybrids fight it
But the middle option is a default, not an answer. If you choose the layered monolith, show how it meets the latency and availability drivers anyway (perhaps your measures are looser than the sample ones). If you choose full microservices, show why the operational cost is worth paying here. Whatever you pick, you must defend it against every driver in Step 6 — that is the actual exercise.
Step 4: Model the modules/services in the component editor
Open the component editor. Draw one component per module and connect them with dependency connectors — here each arrow means "knows about and calls", not a class-level association. Where a module offers a contract others consume, give it a provided interface and let the callers require it. Suggested modules: Device Ingestion, Alert Evaluation, Clinician Notification, Patient Records, Dashboards, EHR Integration, Audit Log.
Two structural rules to enforce:
- The alerting path (Ingestion -> Alert Evaluation -> Notification) must have no arrows pointing at Dashboards or EHR Integration. If Alert Evaluation needs patient thresholds from Records, depend on a narrow interface it owns and let Records implement it — that is dependency inversion applied at module scale.
- Every module writes to Audit Log, so give it no outgoing arrows at all.
Step 5: Model the deployment
Build this in the deployment editor: a node per runtime (device or execution environment), the artifacts each hosts, and labelled communication paths between them. See the Smart Library deployment example for the shape. Trace the alert path node by node and state the redundancy at each hop, because that is where your availability driver becomes real:
Wearable device
-> Ingestion gateway (2+ instances, separate availability zones)
-> Alert evaluation (2+ instances, rules cached in memory, warm standby)
-> Notification dispatch (redundant; push notification with SMS fallback)
Monolith (records, dashboards, EHR integration):
2 instances behind a load balancer
Data:
Vitals time-series store (replicated)
Records database (primary + replica)
Audit log (append-only, written synchronously on record access)For each node on the alert path, write one sentence: what happens when it fails, and how the 30-second gap bound from Step 1 is still met. If you cannot write that sentence, the driver is not satisfied — no matter how the diagram looks.
Step 6: Write the justification report
One page. For each driver: how the architecture satisfies it (name the mechanism, not an adjective) and what was traded away to get it. Example entry:
Alert latency (60 s, p99). Satisfied by a dedicated ingestion-evaluation-notification path that shares no process, database, or deploy cycle with dashboards. Traded away: a second deployment pipeline, a second on-call surface, and eventual consistency between live alerts and the records database.
Close with a short "risks accepted" section. An architecture whose costs you cannot name is not a decision — it is a guess with a diagram attached. Reviewers at St. Vera will trust the report precisely because it admits what it gave up.
Check your work
- Does every driver have a stimulus and a numeric response measure, not just a quality-attribute name?
- Could another team read your Step 2 table and see why each score follows from a driver, rather than from taste?
- Is the alerting path free of dependencies on Dashboards, EHR Integration, and Records internals?
- Does the deployment outline state, for each alert-path node, what happens when it fails?
- Does the report name at least one concrete cost for every driver it claims to satisfy?
- If the latency bound tightened from 60 to 10 seconds, do you know which part of your design breaks first?
- Is the audit trail written on every record access, including reads by the alerting path?
Going further
- Scale shock. The network acquires twenty more hospitals. Re-read your drivers: which measures change, which stay fixed? Re-score the Step 2 table and check whether your decision survives.
- Audit log design. Model the audit log's data in an ER diagram: does an append-only, tamper-evident log want the same normalization you would apply to the records database, or different rules?
- Alert fan-out. Several clinicians may watch one patient. Sketch the notification module in Studio using the Observer pattern, and note where the pattern's class-level form differs from a distributed publish-subscribe channel.