.NET Architecture & System Design Interview Question #182

Why are database rollbacks difficult?

Deployment, Cloud Operations, SRE & Senior System Design Scenarios Senior Advanced

Quick Interview Answer

Application binaries can often be replaced quickly, but database changes may alter or destroy data and can be used concurrently by multiple application versions.

Detailed Explanation

Application binaries can often be replaced quickly, but database changes may alter or destroy data and can be used concurrently by multiple application versions.

Production database changes should therefore emphasize forward-compatible migrations, backups, tested recovery, and roll-forward strategies. Destructive changes should normally be delayed until they are demonstrably safe.

Code Example

Code rollback:
v2 -> v1

Database:
DROP/transform data
may not be reversible

Prefer safe forward evolution.