Security, Operations, Evolution and ML Data Contracts
A correct algorithm can still fail through identity, overload, restore, migration or stale data. This stage makes security and operations part of the state machine, then connects those contracts to ML data lineage and freshness.
Section 8 of 9 · 15 units · about 65 hours
By the end you can Prevent cross-tenant access, survive overload without unbounded queues, restore verified state within the declared objectives, and complete a mixed-version migration and rollback while preserving lineage, freshness and deletion contracts.
Units
- Threat models for clients, services and operators, workload identity and mutual TLS4h
- Authorization on every data path, tenant isolation and multi-tenant fault and restore tests5h
- Encryption in transit and at rest, secret and key rotation and audit integrity4h
- SLIs, SLOs, error budgets, telemetry and incident reconstruction5h
- Capacity headroom, failure reserve, overload detection and load shedding4h
- Retry budgets, circuit breaking, cascading and correlated failure and chaos scenarios4h
- Replication versus backup and verified backup and restore4h
- Recovery point and time objectives and disaster-recovery failover and failback4h
- Rolling protocol and schema evolution, mixed-version behavior and feature gates4h
- Expand, migrate and contract changes, rollback boundaries and migration tests5h
- Data classification, retention, residency and privacy-preserving analytics4h
- Deletion propagation, lineage, provenance and reproducible backfills4h
- Point-in-time feature joins and online and offline feature equivalence4h
- Model-registry state, artifact checksums, retrieval-index freshness and dataset version identity5h
- A load, chaos, backup and restore campaign with capacity, recovery and migration costs5h
Build it
Mini project · about 18 to 24 hours
Operate and evolve a governed data path
Extend loglab with the security, recovery and governance records needed to operate its data path. Reuse the stream and transaction fixtures on your machine, proving policy and restore correctness before running a measured incident campaign.
- 1Threat-model
loglabboundaries inops/; implement mTLS or a faithful verifier for validity, matching trust-domain bundles and allowed SPIFFE IDs. During rotation, test unknown domains, expired SVIDs and unauthorized IDs against an independent policy table; retain overlapping-key tenant tests across retry, cache, migration and restore. - 2Persist redacted audit events in a tamper-evident chain; test edits, deletion, truncation and restore against an independently retained checkpoint. Add bounded-cardinality W3C-context telemetry and windowed SLOs; inject an incident with skewed display timestamps, retaining causal reconstruction against the fault schedule and marking unestablished order.
- 3Record classification, retention, residency, transfer rules and deletion mechanisms per tier. Check deletion-ledger and cache-watermark propagation against a lineage inventory, including fresh-version resurrection attempts; retain fixed-snapshot backfill agreement and hand-oracle feature joins covering TTL, created timestamps and logged online-versus-offline equivalence under matching materialization state.
- 4Build immutable retrieval-index generations from content-identified datasets and per-partition frontiers; check counts and deletions against a full-scan reference. Retain before-and-after publication crash tests and retained-generation rollback; add checksum-gated artifact serving, registry alias promotion and rollback with immutable producing-run lineage.
- 5Apply sticky routing and expand-migrate-contract evolution to existing
proto/andstorage/data. Check mixed-version reads and writes, reconciled representations, readiness, drain and availability limits against a compatibility matrix; retain rollback tests and mark the irreversible boundary and roll-forward recovery path. - 6Restore base backup and archived WAL in isolation; check committed data, tenancy and current deletion policy against the ledger. After deterministic checks, drill fenced failover/failback; retain divergent tails, both fork points, acknowledged-write loss and detection, decision, restore, verification and switch timings.
- 7Model foreground, replication fan-out, backup, restore and repair costs with concurrent recovery reserves. Queue-oracle tests check bounded admission, retry budgets, breakers and bulkheads before repeated open-loop chaos campaigns including backup/restore; retain trigger/abort cards, node-loss bottleneck comparisons, versions, workloads, SLOs, backlog, capacity, recovery and migration costs.
What you hand in
- The
ops/security and governance layer with independent policy, audit, deletion, feature and artifact reference checks. - Verified backup, failover, failback and mixed-version migration runbooks with rollback boundaries and retained fault histories.
- A production dossier with causal incident reconstruction, resource reservations, repeated campaign records and evidence-labeled cost and recovery claims.
How to check it
- Self-grade with the rubric below
How it's graded
Identity and policy enforcement
Pass: Your policy-table tests reject invalid or unauthorized identities during rotation and prevent cross-tenant access on normal, retry, cache, migration and restore paths with overlapping keys.
Great: Negative controls remove endpoint or storage enforcement independently; remaining defenses and audit records demonstrate the exact residual protection and key-compromise scope.
Governed derived state
Pass: Your lineage inventory, hand join and full-scan reference check deletion, deterministic backfills, feature equivalence and index counts. Publication crashes, alias rollback and artifact corruption have retained tests.
Great: A stale source republishes erased data with a fresh version and is rejected; rollback and restore preserve current deletion policy without rewriting immutable artifact lineage.
Recovery and evolution evidence
Pass: Your ledger verifies isolated backup restore and both fenced promotions. Forks, divergent tails, acknowledged-write loss and recovery stages are recorded; mixed-version tests check rollback before the declared irreversible boundary.
Great: Broken archive continuity and an incomplete migration trigger explicit refusal or roll-forward recovery, with regression histories showing why a nominally successful job was insufficient.
Observable bounded operation
Pass: Your audit verifier detects tampering against an external checkpoint. Queue-model checks precede repeated campaigns; causal incident evidence, capacity predictions, recovery reservations and measured cost ledgers retain setup and uncertainty.
Great: The dossier distinguishes incident trigger from sustaining retry load, measures observer overhead, and explains a mistaken bottleneck prediction or losing policy without hiding the raw records.
Resources
- HLD Handbook - Reliability, Operations and Security at ScaleHLD Handbook
Read Part 6 observability, SLOs, resilience, overload, deployments, chaos, incidents and health, then Part 7 authentication, mTLS, secrets, tenancy and data governance chapters relevant to the capstone. Skip unrelated case studies.
- Google SRE Books - SLOs, Monitoring, Overload, Cascades, Incidents and RecoveryGoogle
Read SRE Chapter 4 (service level objectives), 6 (monitoring distributed systems), 21 (handling overload), 22 (addressing cascading failures), 14 (managing incidents) and 15 (postmortem culture); Workbook Chapter 2 (implementing SLOs) and 5 (alerting on SLOs); and Building Secure and Reliable Systems Chapter 5 (least privilege) and 9 (design for recovery). Convert each into one alert, limit, load test or runbook action in the capstone.
- DDIA 2e - Chapters 2, 5 and 14Martin Kleppmann and Chris Riccomini
Use Chapter 2 "Describing Performance" for percentile and response-time vocabulary and Chapter 5 for compatibility during rolling upgrades. Chapter 14 is about predictive analytics, privacy and data governance, not operations: read its "Privacy and Tracking" section for the retention and deletion units.
- Metastable Failures in Distributed Systems (Bronson et al., 2021)HotOS
Read the trigger and sustaining-effect model of metastable failure and the retry and shedding design prompts. Its model illustrates; it does not predict.
- Metastable Failures in the Wild (Huang et al., 2022)USENIX OSDI
Read the incident study for how retries and load sustain outages after the trigger ends; it is a sample of public reports, not a rate.
- Simple Testing Can Prevent Most Critical Failures (Yuan et al., 2014)USENIX OSDI
Read the findings on error-handling code and how few nodes and events reproduce most failures, as the case for testing error paths in your campaign. Its bounds come from one sample of 2014 systems.
- Gray Failure: The Achilles' Heel of Cloud-Scale Systems (Huang et al., 2017)Microsoft Research
Read the gray-failure model (differential observability between a detector and its clients) as vocabulary for telemetry and failure detection.
- The Internals of PostgreSQL - Base Backup and Point-in-Time RecoveryHironobu Suzuki
Read Chapter 10 (base backup, how PITR replays WAL, timelines and incremental backup) as the real-engine model for backup integrity, recovery points and restore verification. Note the date you read it.
- SPIFFE Workload Identity and Workload APISPIFFE Project
Read the SPIFFE ID, X.509-SVID and trust bundle specifications and the Workload API (
FetchX509SVID,FetchX509Bundles) to design service identity, short-lived credentials and bundle rotation. A local mock is sufficient unless a real SPIRE deployment answers a specific gap. - OpenTelemetry Signals and Semantic ConventionsOpenTelemetry
Read signals and context propagation (W3C Trace Context
traceparent, inject and extract, baggage rules), then the semantic conventions (1.44.0) for the RPC and messaging areas with their stability status. Define bounded attributes for request, node, partition, term and offset identities, and never infer global order from display timestamps. - Replicated Log and Stream Processor - Production ContractRoadmap-Final
Add workload identity, tenant checks, audit, SLOs, capacity limits, backup and verified restore, mixed-version migration, rollback and reduced point-in-time ML data paths. Run one compound incident from detection through recovery.
- Feast Documentation - Point-in-Time Joins and Feature RetrievalFeast
Read Point-in-time joins (entity dataframes,
get_historical_features, TTL backward scan,filter_by_created_timestamp) and Feature retrieval (event_timestampas the inclusive upper bound,get_online_featureswithout timestamps, feature services per model version, materialize refresh). Work the join logic on tiny local tables; do not deploy Feast. Page read 2026-10-15 (v0.66-branch documentation). - MLflow Model Registry DocsMLflow
Read the Model Registry page (registered models, versions, lineage to the producing run, aliases such as @champion, and tags) and the registry tutorial promotion flow. Stages are deprecated since MLflow 2.9; use aliases and tags. Page read 2026-10-15; the versioned docs move, so re-pin the version you read.
- DVC Docs - Data VersioningDVC
Read
dvc add(Description and Example: Single file) for.dvccontent-hash sidecars, thedvc.yamlpage with itsdvc.lock filesection for pipeline state, andpushandpullfor transfer. A local directory remote is enough; do not set up cloud storage. Page read 2026-10-15. - Building Distributed Systems - The Tracer, The Securitor and The MigratorBuild Distributed Systems
Only the first three tasks of each track are free: in The Tracer, trace-context propagation, span lifecycle and a collector; in The Securitor, JWTs, the OAuth 2 code flow with PKCE and sessions; in The Migrator, schema migrations, expand and contract, and zero-downtime change. Tasks are graded in the browser after login, so treat a pass as a drill and keep your local harness as the evidence.
- OWASP Threat Modeling Cheat SheetOWASP
Use System Modeling (data-flow diagrams, trust boundaries, stores and processes), Threat Identification (the STRIDE table applied to components, data flows and trust boundaries) and Response and Mitigations to build the unit threat model.
- PostgreSQL 18 Documentation - Recovery Targets, Backup Verification and RewindPostgreSQL Global Development Group
Read Section 19.5.6 Recovery Target, the
pg_verifybackupreference and thepg_rewindreference for recovery stopping points, manifest checks and rejoining a diverged primary.