Microservices Data Consistency u0026 Transactions Quiz Quiz

  1. Two-Phase Commit (2PC) Limitations

    What is a primary limitation of using the Two-Phase Commit (2PC) protocol for transactions across microservices?

    1. It guarantees eventual consistency in all scenarios.
    2. It introduces tight coupling between services, hindering independent deployments.
    3. It eliminates the need for compensating transactions.
    4. It supports asynchronous communication seamlessly.
    5. It offers built-in scalability and performance optimization.
  2. Eventual Consistency and Data Loss

    In a microservices architecture relying on eventual consistency, what is a potential risk that developers must carefully mitigate?

    1. Data is always consistent across all services.
    2. Complete data loss is impossible with event sourcing.
    3. Temporary inconsistencies may occur, requiring strategies to handle them.
    4. Transactions are always ACID compliant.
    5. Services can only be updated via direct database modifications.
  3. Saga Pattern - Definition

    Which of the following best describes the Saga pattern for managing transactions across microservices?

    1. A centralized transaction manager coordinating all service operations.
    2. A sequence of local transactions, each updating a single service, with compensating transactions to undo previous operations if needed.
    3. A distributed cache that guarantees data consistency.
    4. A message queue used to ensure transactional message delivery.
    5. A read-only replica of a database optimized for reporting.
  4. Choreography vs. Orchestration - Sagas

    When implementing Sagas, what is the key difference between choreography and orchestration?

    1. Choreography requires a central coordinator, while orchestration relies on individual services communicating directly.
    2. Orchestration relies on asynchronous message queues, while choreography uses synchronous API calls.
    3. Choreography defines the workflow in a central orchestrator, while orchestration relies on each service knowing when to act based on events.
    4. Orchestration defines the workflow in a central orchestrator, while choreography relies on each service knowing when to act based on events.
    5. Both are the same thing, just named differently.
  5. Compensation Transactions

    What is the purpose of a compensation transaction in a Saga pattern?

    1. To permanently delete data from all services.
    2. To reverse the effects of a previously completed local transaction in case of failure.
    3. To apply updates to multiple services simultaneously.
    4. To guarantee ACID properties across all services involved in the Saga.
    5. To improve the read performance of the system.
  6. Outbox Pattern

    What problem does the Outbox Pattern solve in the context of microservices data consistency?

    1. Ensuring data is written to multiple databases simultaneously.
    2. Guaranteeing that events are reliably published after a database transaction commits.
    3. Preventing unauthorized access to sensitive data.
    4. Optimizing the read performance of a database.
    5. Simplifying the deployment process of microservices.
  7. Idempotency Key Importance

    Why is idempotency important when designing compensating transactions or event handlers in microservices?

    1. To ensure that transactions always succeed.
    2. To prevent a single operation from being executed multiple times, leading to unintended side effects.
    3. To reduce the amount of data transferred between services.
    4. To improve the performance of database queries.
    5. To simplify the monitoring of microservices.
  8. BASE vs. ACID

    Which set of properties does the acronym BASE represent, in contrast to ACID, in the context of distributed systems and microservices?

    1. Basic Availability, Soft state, Eventual consistency
    2. Begin, Abort, Soft, End
    3. Basic, Application, Service, Endpoint
    4. Bottom, Architecture, Scale, Efficiency
    5. Binary, Asynchronous, Simple, Extensible
  9. Handling Conflicts in Eventual Consistency

    What strategies can be employed to handle conflicting updates in a microservices system using eventual consistency?

    1. Rollback all transactions to a previous state.
    2. Last-write-wins, optimistic locking, or conflict resolution algorithms.
    3. Prevent updates from occurring concurrently.
    4. Force all services to use the same database.
    5. Disable eventual consistency and use ACID transactions everywhere.
  10. Distributed Lock Implementations

    Which technology is commonly used to implement distributed locks for coordinating access to shared resources across microservices?

    1. Local JVM locks
    2. Redis, ZooKeeper, or etcd
    3. Operating System file locks
    4. Web browser cookies
    5. Compile time code analysis