✦ For everyone, free.

Practical knowledge for real and everyday life

Home

12.1.3.5 Dev Dependency Topology

A focused guide to Dev Dependency Topology, connecting core concepts with practical Docker and container operations.

Dev dependency topology refers to how an application's various services and their dependencies are connected within a development environment, ideally mirroring the actual architecture the application will have in production, even if individual services are configured somewhat differently for local convenience.

Why Matching the Overall Topology Matters More Than Matching Every Detail

While individual configuration details (exposed ports, simple credentials) reasonably differ between development and production, the overall shape of how services depend on and connect to each other should remain consistent, since this structural relationship is what an application's actual code logic depends on.

services:
  frontend:
    depends_on:
      - api
  api:
    depends_on:
      - db
      - cache
  worker:
    depends_on:
      - db
      - queue

This dependency topology — which services talk to which others — should reflect the application's actual production architecture, even though individual services within it are configured with development-appropriate specifics.

Why a Mismatched Topology Risks Missing Architectural Issues

If a development setup omits a service that exists in production, or connects services differently than production actually does, certain integration issues specific to that real topology might never surface during local development at all.

services:
  api:
    depends_on:
      - db

If production's api actually also depends on a queue service not represented at all in this simplified development topology, an issue specific to that missing interaction could go entirely unnoticed locally.

Periodically Validating Topology Alignment

Comparing a development Compose file's service relationships against an architecture diagram or production's actual deployment configuration helps catch any structural drift.

docker compose config --services
Why Dev Dependency Topology Matters

Maintaining structural alignment between a development environment's service topology and production's actual architecture is an important, often underappreciated aspect of environment parity, helping ensure architectural issues are caught locally rather than only surfacing once deployed against the real, complete topology.