Interview Prep/Docker/Volumes, storage and data

A legacy app needs persistent state, but the team wants to scale it to 3 replicas.

AdvancedScenarioVolumes, storage and data
Answer

Situation read → Shared local state blocks horizontal scaling.

What I'd do →

  1. Identify what state it holds (sessions, uploads, cache).
  2. Move sessions to Redis, uploads to S3-compatible storage, DB state to a managed database.
  3. If state must stay on disk, use per-replica volumes (StatefulSet in Kubernetes) rather than a shared writable volume.

Why → A shared volume with several writers risks corruption and creates a single point of failure.

Interview tip → Externalizing state is the real fix, not a clever volume.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data