Operating Services
Question: what does each service need in order to be deployed, configured, observed, secured, and tested, and which of these needs are solved once for all services?
Interviews usually touch this only briefly. It grows with the number of services: each new deployable unit repeats these needs. Most of the material lives in the engineering notes; this hub collects the options and points to them.
Forces
- Number of services: each concern is paid once per service unless it is shared.
- Speed and safety of change: frequent independent deployments need automation and progressive delivery.
- Diagnosability: a request that crosses several services can fail in any of them.
- Trust between services: each service must know who the original caller is and what that caller may do.
Deployment
Release techniques such as blue/green deployment, canary releases, feature flags, and parallel runs are in the deployment notes. Platform details are in Kubernetes, infrastructure as code, and GitOps; the platform and delivery notes collect them. The code deployment case designs such a system.
Cross-cutting concerns
A service mesh moves some of these concerns out of the chassis into infrastructure, independent of language.
Externalized configuration is factor III of the Twelve-Factor App. For its rationale and the frameworks that followed it, see Twelve-Factor and its descendants.
Observability
- Log aggregation: collect logs from every instance in one searchable place.
- Application metrics: instrument operations to gather statistics such as rate, errors, and latency.
- Distributed tracing: give each external request an identifier that travels between services, and record timed spans of the work done for it.
- Exception tracking: report exceptions to a central service that groups them and notifies developers.
- Health check API: an endpoint that reports whether the instance can serve requests. Load balancers and registries use it to route traffic (see service discovery).
- Audit logging: record user actions for later review.
- Log deployments and changes: record deployments and configuration changes so incidents can be matched to them.
Study backlog: there are no observability notes yet. Start with instrumenting distributed systems for operational visibility (AWS Builders’ Library) and Newman, chapter 10.
Security
Access token: the API gateway authenticates the caller and passes a token, such as a JWT, that carries the caller’s identity and roles. Each service uses the token to authorize the request without calling an identity service.
The original notes frame security as a trade-off between total safety and total convenience. They separate authentication (who is calling) from authorization (what the caller may do).
Password storage:
- The problem: a fast hash such as SHA-256 lets an attacker who steals the table try billions of guesses per second on GPUs. Without a salt, precomputed tables, including rainbow tables, crack common passwords in bulk, and identical hashes reveal users who share a password.
- The approach: give each password a unique random salt, stored next to the hash, and use a slow, memory-hard function. Argon2id is the first choice, then scrypt or bcrypt. Set the cost parameters from current OWASP guidance rather than fixed numbers in a note.
- Additional measures: a pepper, a secret key held outside the database in a secrets manager, means a stolen table alone is not enough. Rehash at the next login when the parameters change.
- Better still: avoid storing passwords. Delegate authentication to an identity provider over OpenID Connect, or use passkeys.
Study backlog: usability trade-offs; service-to-service authentication; secrets management (see the secrets section of the GitOps notes and the Twelve-Factor critique of environment variables). The security note in the engineering topics is still an empty placeholder. Sources named in the original notes: Newman’s book (chapter 11 in the second edition) and the interviewing.io system design guide.
Testing
- Consumer-driven contract test: the team that consumes a service writes tests that the provider runs, so the provider learns when a change would break a consumer.
- Consumer-side contract test: tests that check a client can communicate with the service it depends on.
- Service component test: tests a service in isolation, with test doubles for the services it calls.
See the test strategy notes for the broader approach.
UI composition
Two patterns build one screen from parts owned by different teams:
- Server-side page fragment composition: the server assembles HTML fragments produced by several capability-specific web applications.
- Client-side UI composition: the client assembles UI components, each owned by a team.
No notes yet; see Newman, chapter 14.
Leads to
- Health checks feed the request path.
- Tracing is what makes asynchronous communication diagnosable.
- Access tokens are issued at the API gateway.
- Contract tests protect the contracts between services.
- A deployment platform, a mesh, and feature flags are each managed through a control plane.
- Solving these needs once for every team is platform engineering.
Seen in cases
- Code deployment: a case about building the deployment system itself.
- AI and RAG: the golden-path templates (observable RAG, deterministic agent, eval harness) are service templates. They choose copied scaffolding over a shared library and read configuration from the environment. Design pressure asks for observability by design, replayable runs, and gradual release of versioned prompts, models, indexes, and tool schemas.
Sources
- microservices.io pattern groups:
- deployment: multiple services per host, service per host, service per VM, service per container, serverless, deployment platform;
- cross-cutting concerns: microservice chassis, externalized configuration, service template;
- observability: log aggregation, application metrics, audit logging, distributed tracing, exception tracking, health check API, log deployments and changes;
- security: access token;
- testing: contract tests, component test;
- UI: server-side page fragment composition, client-side UI composition.
- Richardson 2019: chapters 9-10 (testing), 11 (production-ready services), 12 (deployment).
- Newman 2021: chapters 8 (deployment), 9 (testing), 10 (observability), 11 (security), 14 (user interfaces).
- Password Storage Cheat Sheet – OWASP: algorithms and current cost parameters.
Library sources
- Richardson 2019, Microservices Patterns: With Examples in Java – chapters 9-12
- Newman 2021, Building Microservices: Designing Fine-Grained Systems, Second Edition – chapters 8-11 and 14
- Xu 2023, Password, Session, Cookie, Token, JWT, SSO, OAuth – Authentication Explained, parts 1 and 2 – on Password storage and access tokens
Further reading:
- Nygard 2018, Release It! Design and Deploy Production-Ready Software, Second Edition – parts II-III
- Beyer et al. 2016, Site Reliability Engineering: How Google Runs Production Systems