RDBMS Flashcards
“What is database replication?”
“Replication is the process of copying and maintaining database instances in multiple locations to ensure high availability and fault tolerance.”
“What is the difference between master-slave and master-master replication?”
“In master-slave replication, one master handles writes and multiple slaves handle reads. In master-master replication, multiple masters can handle both reads and writes.”
“Which type of replication introduces potential data conflicts?”
“Master-master replication, since multiple nodes can perform write operations, leading to synchronization challenges.”
“What is the main drawback of synchronous replication?”
“It ensures strong consistency but can introduce higher latency due to the need for immediate replication.”
“Which replication method prioritizes performance over consistency?”
“Asynchronous replication, as it allows data to be written to replicas with some delay.”
“How does replication improve read-heavy workloads?”
“By directing read queries to slave databases, reducing load on the master.”
“What is database sharding?”
“Sharding is the process of dividing a large database into smaller, more manageable pieces called shards, each containing a subset of the data.”
“How is data distributed in sharding?”
“Data is distributed based on a sharding key, such as user ID or geographic region.”
“What are the primary benefits of sharding?”
“It enables horizontal scaling, reduces query response times, and allows parallel processing.”
“What challenges can arise from sharding?”
“Uneven data distribution (hotspots), complex query routing, and expensive re-sharding operations.”
“What is the difference between sharding and replication?”
“Sharding partitions data across multiple nodes, while replication duplicates the same data across multiple nodes.”
“What is a common strategy for choosing a sharding key?”
“A key with even distribution across data, such as user IDs hashed to different shards.”
“What is database federation?”
“Federation involves breaking a database into multiple independent databases that operate separately but can be queried together if needed.”
“How does federation differ from sharding?”
“In federation, each database operates independently, while in sharding, shards are part of the same logical database.”
“What are the advantages of database federation?”
“Flexibility to use different database technologies, independent scaling, and better isolation between different datasets.”