Explore the core principles and practical aspects of consistency models in global distributed databases, including how data remains accurate and up-to-date across geographically dispersed nodes. This quiz is designed to help learners understand strong and eventual consistency, transaction guarantees, and related concepts in distributed database systems.
Which statement best describes strong consistency in a global distributed database scenario?
Explanation: Strong consistency ensures that after a write completes, any subsequent read will reflect that write in all regions. The other options are incorrect because data being available in only some regions describes availability trade-offs, eventual consistency allows for delayed synchronization, and ignoring writes during latency does not define consistency.
What does eventual consistency guarantee in global distributed databases?
Explanation: Eventual consistency means that given enough time without new updates, all replicas will converge to the same value. Immediate visibility is false, as delays can occur. Real-time completion and nearest node consistency do not accurately describe eventual consistency's behavior.
In a global database, how does leader-follower replication help achieve consistency?
Explanation: Leader-follower replication centralizes writes on a leader node, which then synchronizes followers to maintain consistency. Requiring all followers to approve writes is not standard and reduces efficiency. Selecting nodes at random can break consistency. Followers performing uncoordinated writes risks divergent data.
Which scenario best demonstrates the difference between strong and eventual consistency?
Explanation: Seeing different profile data in various regions after an update is a hallmark of eventual consistency, which does not guarantee immediate propagation. Transaction failure describes availability, offline mode is unrelated to consistency, and automated scaling pertains to performance, not consistency.
According to the CAP theorem, what can be compromised in favor of consistency and partition tolerance in distributed systems?
Explanation: CAP theorem states that during a network partition, a system can choose either consistency or availability, not both. Concurrency and atomicity refer to transaction characteristics, not CAP. Bandwidth is unrelated to the theorem.
What does read-your-write consistency guarantee for a single client?
Explanation: Read-your-write consistency allows clients to read their own updates right away, reinforcing correctness for the user's actions. It does not guarantee synchronization across clients, nor does it prevent others from seeing changes. Allowing overwrites of recent updates by old data is a conflict, not consistency.
How does a quorum mechanism contribute to consistency in global distributed databases?
Explanation: A quorum ensures that a write is only committed when most nodes have acknowledged it, promoting consistency across the system. Processing every operation twice or limiting to one node contradicts distributed principles, and ignoring failed acknowledgments risks inconsistency.
Why can strong consistency increase latency in multi-region global databases?
Explanation: Ensuring strong consistency often means waiting for confirmation from multiple regions, adding to response time due to network delays. Storing data in one region avoids multi-region latency, manual conflict resolution is part of conflict handling, and random delays do not guarantee consistency.
What happens to consistency guarantees when a node fails in a strongly consistent, replicated database?
Explanation: When a node fails, strong consistency systems still enforce correct data but might limit availability until redundancy is restored. Data does not become completely unavailable, writes are not ignored, and reads do not return random results as these all contradict strong consistency.
What is a 'stale read' in the context of global distributed databases?
Explanation: A stale read occurs when a node returns outdated data that does not include the most recent updates. Writing without confirming affects durability, not consistency. Overwriting before synchronization and accessing data during maintenance are different operational concerns.