Security, reliability and operational evidence
Prove tenant boundaries and durable intent
Treat the authenticated tenant as trusted context only after identity verification; do not trust a tenant field in the request body. Every read or mutation uses tenant plus order identifier. An idempotency key scoped to the tenant allows an identical request to return the same order, but conflicting content with the same key is rejected. In the local SQLite solution the order and outbox row commit together. The simulated dispatcher may replay after a crash; the consumer records an effect with a unique key and commits status together with that effect. In a real external shipment or payment integration, database uniqueness alone cannot make an external side effect exactly once: use provider idempotency and reconciliation. The local fixture has no external side effects.
Observe the system and recover deliberately
Measure accepted-request success, p95 acceptance latency, queue age, fulfillment latency, duplicate-effect count, authorization denials and cost per order. Use CloudWatch metrics and alarms, structured logs with correlation IDs and CloudTrail for supported API audit events. Avoid logging tokens or customer payloads. Queue age growth with healthy API responses suggests a downstream bottleneck, not necessarily an API outage. Define bounded retries and a DLQ; inspect failure cause before redrive and preserve identifiers. Set concurrency and capacity limits; monitor backpressure rather than admitting unbounded work.
Separate AZ resilience, backup and regional recovery
For A enable appropriate DynamoDB point-in-time recovery and approved cross-region backup copies; for B use RDS automated backups and approved cross-region copies or a separately evaluated replication strategy. Include configuration, infrastructure definitions, artifact availability, DNS, roles and key access in recovery. A regional outage may also lose queued work; reconcile order/outbox state and reissue missing work in the recovery environment after fencing old writers. The proposed backup-and-restore path must demonstrate data age no more than 60 minutes and usable service in 240 minutes; neither service automatically meets these targets. Local backup tests prove only local database restoration. Test restoration, authorized reads, replay and integrity before reopening admission.
Release evidence and failure scenarios
Keep IaC in version control, review scoped IAM and route changes and use immutable artifact identifiers. Variant A can use SAM/CloudFormation with a reviewed Lambda version and alias; variant B can use CloudFormation or CDK with immutable ECR image digests and ECS deployment health checks. The project includes an explicit nondeployable topology contract and review checklist rather than complete provisionable IaC. Native lint, synthesis and hosted integration remain separate gates. In the local lab test duplicate submission, cross-tenant read, conflicting key, rollback of failed atomic writes, duplicate delivery and restoration. For an actual rollout test both old/new schema compatibility, rollback of traffic, reconciliation of writes and alarm thresholds. Unknown evidence means not ready.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Security, reliability and operational evidence — knowledge check
Defend architecture choices, tenant boundaries and recovery evidence.
What identifies an authorized order read?
What happens to duplicate fulfillment messages?
Which evidence proves a regional recovery target?
Which signal suggests downstream congestion?
Does the local topology contract establish deployed networking?