How do you rotate a secret without downtime?
IntermediateProductionSecrets Management Architecture
Answer
Use a dual-credential pattern so old and new are both valid during the switch:
- Create the new credential while the old remains valid (alternating users strategy or two active API keys).
- Roll the new value out to all consumers (apps re-read from the secrets manager or get restarted).
- Verify no traffic uses the old credential (DB logs, provider "last used" timestamps).
- Revoke the old one.
Apps must fetch secrets at runtime with caching and refresh, not bake them in at build time. AWS's "alternating users" rotation strategy implements this for databases.
More on Secrets Management Architecture
How would you design a secrets management architecture for a multi-cloud, multi-cluster company?AdvancedVault vs AWS Secrets Manager: how do you choose in production?IntermediateHow do you run Vault in production for high availability?AdvancedHow do you solve the "secret zero" problem?IntermediateHow do Vault dynamic database credentials work operationally, and what can go wrong?AdvancedHow does AWS Secrets Manager rotation work under the hood?Intermediate