π Design Docs & ADRs
At top companies, writing is how engineering decisions get made. Being able to write a clear design doc is a promotion-level skill, and it makes system design interviews much easier.
Design doc skeleton (1β5 pages)
- Context & problem. Why now? Whoβs affected?
- Goals / non-goals. Explicit scope
- Requirements. Functional and non-functional (scale, latency, SLOs, cost)
- Proposed design. Diagram, APIs, data model, flows (sequence diagrams)
- Alternatives considered. At least 2, with a trade-off table
- Failure modes & mitigations. What breaks, and how you detect and recover
- Security & privacy
- Rollout plan. Feature flags, migration, backfill, rollback
- Observability. Metrics, alerts, dashboards
- Open questions
ADR (Architecture Decision Record)
Short (β€ 1 page), immutable, numbered. Template: 99 Templates/ADR.
Write an ADR for every meaningful Orbit decision, e.g.:
- ADR-000: Java for the control plane, Go for the data plane
- ADR-001: A modular monolith control plane first
- ADR-003: Tenant isolation via Postgres RLS
- ADR-004: The workflow definition format (JSON DSL vs code)
- ADR-006: Our own durable engine vs Temporal
- ADR-007: Postgres
SKIP LOCKEDqueue vs Kafka for task dispatch - ADR-010: Hybrid retrieval (pgvector + FTS + rerank) vs a dedicated vector DB
Diagrams
- C4 model: Context β Container β Component (Simon Brown)
- Mermaid is native to Obsidian. Use
sequenceDiagram,flowchart,erDiagram
sequenceDiagram participant C as Client participant A as orbit-api (Java) participant E as orbit-engine (Go) participant W as orbit-worker (Go) participant G as llm-gateway (Go) participant T as Tool (payment) C->>A: POST /runs (Idempotency-Key) A->>E: StartRun(workflowVersion, input) E->>W: Task(step=agent, lease epoch=7) W->>G: chat(tools=[refund]) G-->>W: tool_use refund(order=42) W->>E: RequestApproval(step) Note over E: waits for human signal (timer: 24h) C->>A: POST /approvals/{id} approve A->>E: Signal(approved) E->>W: Task(step=refund, epoch=8) W->>T: refund(key=run/step/attempt) T-->>W: ok W->>E: CompleteTask(epoch=8)
Resources
- Design Docs at Google (industrialempathy.com)
- Michael Nygardβs original ADR post; adr.github.io
- c4model.com