Complete the code to choose the consistency model that ensures all nodes see the same data at the same time.
consistency_model = "[1]"
Strong consistency means all nodes see the same data immediately after a write.
Complete the code to select the pattern that helps maintain data consistency across microservices asynchronously.
consistency_pattern = "[1]"
The Saga Pattern manages distributed transactions by breaking them into smaller steps with compensations.
Fix the error in the statement about consistency guarantees in microservices.
The [1] model allows temporary inconsistencies but guarantees eventual data synchronization.Eventual Consistency allows temporary differences but ensures data will become consistent eventually.
Fill both blanks to complete the code snippet that defines a distributed transaction using the Saga pattern.
def saga_transaction(): try: [1]() [2]() except Exception: compensate()
In Saga, each step is a local transaction like step_one and step_two, with compensation on failure.
Fill all three blanks to complete the code that implements a simple eventual consistency check.
def check_consistency(data_store): for node in data_store: if node.[1] != data_store.master.[2]: node.[3](data_store.master.data)
The function compares data from each node with the master and updates nodes that differ.