Consistency vs Availability: Understanding Key Trade-Offs Quiz

Explore core trade-offs between consistency and availability in distributed systems with scenario-based questions. This quiz helps clarify fundamental concepts in distributed database design, CAP theorem, and real-world system behavior during network issues.

  1. Commit Failure during Network Partition

    In a distributed system, if a network partition occurs and the system chooses to remain available, what is most likely to be affected?

    1. Efficiency
    2. Redundancy
    3. Consistency
    4. Scalability

    Explanation: When prioritizing availability during a network partition, consistency may suffer because nodes may accept operations independently. Efficiency and scalability are not directly affected by the partition in this context, while redundancy relates to data copies rather than the CAP trade-off. Thus, consistency is the aspect most compromised in this scenario.

  2. Eventual Consistency Choice

    If a distributed database offers eventual consistency, what does this mean for read operations immediately after a write?

    1. They can never succeed
    2. They always fail
    3. They might return stale data
    4. They will always be consistent

    Explanation: Eventual consistency allows the system to remain available, but some reads after a write may return outdated data until all replicas are updated. Always consistent reads are not guaranteed under eventual consistency. Reads do not always fail, and the system is designed so reads can eventually succeed, not never succeed.

  3. Choosing Consistency First

    A financial transaction system is designed to never allow any two users to see different account balances at the same time, even if this means turning away requests during server issues. What is being prioritized?

    1. Latency
    2. Availability
    3. Partitioning
    4. Consistency

    Explanation: Prioritizing always correct and up-to-date data reflects consistency, especially when some requests may be denied in favor of data accuracy. Availability is not prioritized since requests can be rejected. Latency refers to speed, and partitioning is a technique, not an objective here.

  4. High Availability Example

    Which system is most likely prioritizing availability over consistency: one that always responds to queries even during server failure, or one that delays responses until it verifies data accuracy?

    1. The system that delays responses for verification
    2. The system that always responds to queries
    3. Both prioritize consistency
    4. Neither prioritizes availability

    Explanation: Responding to queries in spite of failures shows the system values availability, possibly at the expense of returning accurate data. The system that delays responses is ensuring consistency but reducing availability. Both cannot prioritize consistency at the same time, and the last option is incorrect as at least one does prioritize availability.

  5. CAP Theorem Limitation

    According to the CAP theorem, in the presence of a network partition, which two properties can be maximized at the same time?

    1. Consistency and availability
    2. Latency and scalability
    3. Availability and partition tolerance
    4. Consistency and partition tolerance

    Explanation: CAP theorem states that when a partition happens, a distributed system must choose between consistency and availability; it cannot guarantee both. Consistency and partition tolerance can be combined by sacrificing availability, but not all three together. Latency and scalability are not part of the CAP theorem.

  6. Read-Your-Writes Guarantee

    A user updates a document and expects to see their change immediately on the next page load. Which consistency model does this scenario describe?

    1. Read-your-writes
    2. Eventual consistency
    3. Availability-first
    4. Staggered sync

    Explanation: Read-your-writes ensures users always see their own updates instantly. Eventual consistency may show delays before changes appear. Availability-first is not a standard consistency model. Staggered sync is not a well-defined model in this context.

  7. System Choice for Chat Applications

    A chat application wants messages to always be delivered even if some users see them with a delay. Which is being prioritized?

    1. Isolation
    2. Consistency
    3. Transactionality
    4. Availability

    Explanation: Ensuring messages are always delivered is a sign that availability is prioritized, even though some users may experience delays or see messages in a different order. Consistency would require all users to see the same message at the same time, not delays. Transactionality and isolation refer to properties of transactions, not message delivery.

  8. Impact of Network Partition on Consistency

    What can happen to data in a distributed system that prioritizes availability during a network partition?

    1. Writes are always blocked
    2. All data remains perfectly synchronized
    3. Clients may receive conflicting versions
    4. The system shuts down

    Explanation: By keeping the system available during partitions, conflicting versions can occur because updates may be accepted without coordination. Data is not guaranteed to be synchronized. Writes are not blocked, which is why conflicts happen. The system does not shut down if it prioritizes availability.

  9. Scenario: Stricter Consistency Systems

    Which application is most likely to require strong consistency over high availability: online banking or a news website?

    1. E-commerce homepage
    2. Online banking
    3. News website
    4. Blog comment section

    Explanation: Online banking deals with critical financial data where correctness is essential, requiring strong consistency. News websites, e-commerce homepages, and comment sections can tolerate some inconsistency for better availability without major consequences.

  10. Trade-Off Recognition

    When designing a distributed key-value store to ensure it is always available, what essential trade-off must be accepted according to CAP theorem?

    1. Possible inconsistency of data
    2. Higher costs only
    3. Slower query response
    4. Reduced storage space

    Explanation: To keep the system always available, it must accept possible data inconsistency, especially during network partitions. Slower responses or reduced storage aren't required by CAP trade-offs. Higher costs may occur in practice, but inconsistency is the specific theoretical compromise.