CompTIA DataSys+ (DS0-001)Database DeploymentHard
A company is planning to deploy a critical reporting database that must be available 24/7 with minimal downtime. The database will serve read-heavy analytical queries. To achieve high availability and improve read performance, the architect proposes a solution involving multiple database instances. Which deployment strategy is most appropriate?
- ASingle active-passive failover cluster
- BSharding across multiple independent database servers
- CMaster-slave replication with read replicas
- DIn-memory database for all data
Show answer & explanationAnswer & explanation
Correct answer: C. Master-slave replication with read replicas
Master-slave replication with read replicas is ideal for read-heavy workloads requiring high availability. The master handles writes and replicates data to slaves (read replicas), which then serve the analytical queries, distributing the load and providing redundancy. If the master fails, a slave can be promoted.
Why the other options are wrong
- A. An active-passive cluster provides high availability (failover) but doesn't inherently improve read performance by distributing the read workload.
- B. Sharding distributes data horizontally, which improves scalability for both reads and writes, but it introduces significant complexity and is typically used when a single server cannot hold all data, which isn't explicitly stated as the primary problem here. Its primary goal isn't just high availability or read performance but horizontal scaling of data.
- D. An in-memory database offers extreme performance but can be very expensive for large datasets and doesn't inherently provide high availability without additional replication mechanisms. It's also not suitable for 'all data' if the dataset is very large and persistent storage is required.
Master-Slave Replication with Read Replicas
A database deployment strategy where a primary (master) database handles all write operations, and one or more secondary (slave or replica) databases receive replicated data and serve read-only queries.
- Improves read scalability by distributing queries to replicas.
- Enhances high availability; a replica can be promoted to master upon failure.
- Introduces potential for replication lag between master and replicas.
- Common in relational databases like MySQL, PostgreSQL, and cloud services like AWS RDS.
Memory trick: Master 'M'akes 'M'any 'R'eads 'R'eplicate.