Observability basics
Structured logs with correlation IDs, RED metrics (rate, errors, duration), distributed traces across the queue boundary. If you cannot see it, you cannot fix it.
The mental model
You are a doctor with two kinds of patients. One walks in and says "my chest hurts here, it started an hour ago" — a *known* problem you can look up. The other has a symptom you have never seen, and you need to ask questions, run tests, and follow the evidence to a diagnosis you did not have a checklist for. Monitoring is the first: pre-defined dashboards and alerts for failures you anticipated. Observability is the second: the property of a system that lets you ask new questions about its behavior — including ones you never thought to ask in advance — from the data it emits, without shipping new code to investigate.
That distinction is the whole point. Any system can be monitored for "is CPU high?" A system is observable if, when a specific customer reports their checkout is slow only on Tuesdays from mobile, you can slice the data by customer, endpoint, day, and device and find the answer — without having predicted that exact question. The reason this matters: in a distributed backend, most production problems are novel. You cannot pre-write a dashboard for every failure mode across dozens of services, so you instrument richly and query freely.
The three data types — the "three pillars" — map to three questions:
- Logs answer "what happened in this specific event?" — a timestamped record, ideally structured. Rich detail, but expensive at volume.
- Metrics answer "how much / how many / how fast, aggregated over time?" — cheap numeric time-series, great for dashboards and alerts, but no per-request detail.
- Traces answer "what was the path of this one request across all the services it touched, and where did the time go?" — the connective tissue of distributed systems.
Why any of this exists, stated plainly: **if you cannot see it, you cannot fix it.** A service with no observability fails silently, and your first signal is an angry customer, and your debugging tool is redeploying with print statements — which changes the system you are trying to observe. The classic backend-specific lesson is the one about the queue boundary: a trace that stops at "message published" and resumes as a disconnected "message consumed" has a blind spot exactly where async bugs hide, which is why propagating the correlation/trace context across the queue is the mark of someone who has actually debugged a distributed system at 3am.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision