You are deploying Vault in a local data center, but want to be sure you have a secondary Vault cluster in the event the primary cluster goes offline. In the secondary data center, you have applications that are running, as they are architected to run active/active. Which type of replication would be best in this scenario?
Correct Answer: B
Comprehensive and Detailed in Depth Explanation:
Vault supports two replication types:Performance ReplicationandDisaster Recovery (DR) Replication, each serving distinct purposes. The scenario involves an on-premises primary cluster and a secondary cluster in another data center, with active/active applications needing Vault access. Let's analyze:
* Option A: Disaster Recovery replicationDR replication mirrors the primary cluster's state (secrets, tokens, leases) to a secondary cluster, which remains in standby mode until activated (promoted) during a failover. It's designed for disaster scenarios where the primary is lost, not for active/active use. The secondary doesn't serve reads or writes until promoted, which doesn't suit applications actively running in the secondary data center. Incorrect.
* Option B: Performance replicationPerformance replication creates an active secondary cluster that replicates data from the primary in near real-time. It supports read operations locally, reducing latency for applications in the secondary data center, and can handle writes (forwarded to the primary). This fits an active/active architecture, providing redundancy and performance. If the primary fails, the secondary can continue serving reads (though writes need reconfiguring). Correct.
Detailed Mechanics:
Performance replication uses a primary-secondary model with log shipping via Write-Ahead Logs (WALs).
The secondary maintains its own storage, synced from the primary, and can serve reads independently. Writes are forwarded to the primary, ensuring consistency. In an active/active setup, applications in both data centers can query their local Vault cluster, leveraging the secondary's read capability. DR replication, conversely, keeps the secondary dormant, requiring manual promotion,which introduces downtime unsuitable for active apps.
Real-World Example:
Primary cluster at dc1.vault.local:8200, secondary at dc2.vault.local:8200. Apps in DC2 query the secondary for secrets (e.g., GET /v1/secret/data/my-secret), avoiding cross-DC latency. If DC1 fails, DC2 continues serving cached reads until a new primary is established.
Overall Explanation from Vault Docs:
"Performance replication... allows secondary clusters to serve reads locally, ideal for active/active setups...
DR replication is for failover, keeping secondaries in standby."
Reference:https://developer.hashicorp.com/vault/docs/enterprise/replication