advancedScenario-Based & System Design Questions

After a planned database failover (promoting a standby to primary), several application instances continue trying to write to the old primary for several minutes.

This usually indicates the application is caching the database connection/hostname resolution rather than re-resolving it, or the failover mechanism didn't update DNS/service discovery promptly enough for clients to pick up the change. Diagnose connection pool and DNS TTL/caching behavior in the application's database driver configuration, and ensure the failover process actively triggers reconnection (or that connection pools have a reasonably short max-lifetime forcing periodic reconnection) rather than assuming clients will detect the change passively.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to A container build pipeline that scans images with Trivy starts failing on a base image that previously passed, with no changes made to the Dockerfile.← Back to all Docker questions