liveBook · Manning

Dependency

As explained in The Coder Cafe

A dependency is a requirement that one task, item, or component be completed or available before another can proceed.

A dependency is a requirement that must be completed or available before another task, item, or component can proceed. In software, dependencies determine execution order and can also become sources of operational failure. section 1.4.1 section 7.5.2

A directed graph can represent dependencies between tasks. Topological sort then converts an acyclic dependency graph into a valid execution order by tracking incoming edges, processing vertices with no remaining prerequisites, and updating the affected vertices. section 1.4.1

Classify service dependencies by their practical failure consequences:

  • A hard dependency blocks startup or normal operation when it is unavailable. A database required by a REST endpoint is a straightforward example. section 7.5.2
  • A soft dependency is intended to be optional, but missing timeouts or fallbacks can make it effectively hard. An unresponsive RPC dependency can exhaust latency, threads, or request queues. section 7.5.2
  • Dependency classification changes with operating conditions. A cache that initially allows database fallback can become essential when increased traffic makes the database unable to absorb cache misses. section 7.5.3

A cache that becomes critical

A service first treats its cache as soft because it can fall back to a database. As traffic grows, cache misses overload the database, so the supposedly optional cache becomes a hard dependency in practice. section 7.5.3

Reliability work must test dependencies under failure rather than trusting their labels. Deliberately breaking connections or adding random network delays can reveal which dependencies are genuinely non-critical. section 7.5.2

Visualize a directed dependency graph and follow how its relationships become an executable order. section 1.4.1

How The Coder Cafe covers it

How deep it goes
Explains graph-based ordering, in-degree processing, operational classification, failure modes, and dependency evolution.
Examples
Uses job graphs, REST endpoints, databases, RPC calls, caches, traffic growth, and deliberate network failures.
What you can do after
Apply topological sort to produce task order and diagnose dependencies that become operationally blocking.
How it connects
Connects dependency to topological sort, directed acyclic graphs, service reliability, caching, databases, REST endpoints, and RPC calls.

Also explained in

Compare how 35 books explain dependency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Coder Cafe. The section links point to the parts of the book it draws on.