HW 3

docx

School

University of Missouri, Kansas City *

*We aren’t endorsed by this school

Course

5560

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

4

Uploaded by DukeFreedom11576

Report
Name: Jyothi krishna mannava Section:3 1. [ 20 points ] Suppose you logged in your social network website and updated your profile picture and called one of your friends to check. Your friend joins the website and still sees your old picture you had. Draw an event diagram like the one shown in class to show how this can happen in a replicated data system. Client Server 1 Server 2 Two servers keep the user credentials (replicated data). Password is updated in one server, but the login is attempted in the other server before the password is updated in the second one. Friend Me Update Picture Failed to see the Updated Picture Updated Picture Sign In Picture Updated Not Updated Picture
2. (a) [ 15 points ] What does the following three consistency models mean? a. Consistent prefix This consistency model assures that the order of operations done on data by various nodes is preserved consistently. It assures that if a client sees a sequence of activities, any subsequent operations will reflect the effects of those prior operations in the same order. b. Bounded staleness Bounded staleness defines a level of consistency in which the data being read may not be completely up to date but falls within a preset "staleness" bound. In this approach, systems ensure that a read operation will return data that is within a specified time bound of the most recent change. c. Monotone read Monotonic read consistency ensures that once a client has seen a specific value for a data item, it will never view an older value for that same item. In other words, the data a client reads will either be the most current or a newer value, maintaining a monotonic evolution of data visibility. Each of these consistency models provides different trade-offs in terms of ensuring consistency across distributed systems, catering to different requirements based on the application's demands and the system's design. (b) [ 15 points ] Suppose your changed your profile picture to these fruits in this order: d. On Monday, “Apple” e. On Tuesday, “Orange” f. On Friday, “Mango” g. On Sunday, “Pineapple” Your friend saw your updates in the following listed orders: Which consistency models do these updates satisfy? (it can be zero or more models)? Explain your answer in short. (i) “Apple”, “Orange”
This order matches the update order and satisfies the constrained staleness and monotone read consistency Prefixes. (ii) On Monday “Apple”, on Sunday “Mango”. This order satisfies the bounded staleness and monotone read consistency models, but not the consistent prefix consistency model, because the friend observed the "Mango" update before the "Orange" update. (iii) On Monday “Pears”, On Wednesday “Watermelon”, on Sunday “Pineapple”. This order fulfills the bounded staleness consistency model because the buddy observed all of the updates, but it does not satisfy the consistent prefix or monotone read consistency models because the updates were observed in a different order than they were applied. 3. [ 20 points ] Based on this article ( https://www.alexdebrie.com/posts/dynamodb-eventual- consistency/ ), answer the following questions: (a) How is data replication related to “eventual consistency”? Data replication is critical in the context of distributed systems such as DynamoDB for achieving eventual consistency. If no more updates are made, all replicas of a piece of data will eventually converge to the identical value. In the case of DynamoDB, data is replicated across several nodes in various availability zones to achieve fault tolerance and high availability. When a write happens, DynamoDB immediately acknowledges the write to the client but, because to the distributed nature of the system, it may take some time to propagate the write across all replicas. During this period of propagation, different nodes may have slightly different versions of the data, which will eventually result in consistency. The replication process in DynamoDB requires synchronizing updates across several nodes across a network, and there may be delays in updating all replicas simultaneously owing to factors like as network slowness or node failures. This delay results in temporary discrepancies between replicas, which are gradually rectified as the system continues to propagate changes until all nodes reach the same consistent state.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Thus, in DynamoDB and other distributed systems, data replication is inextricably linked to attaining eventual consistency by ensuring that all replicas eventually converge to the same consistent state over time. (b) What is the PACELC theorem? How is this related to the CAP theorem? The PACELC theorem is a generalization of the CAP theorem, which stands for "Partition-tolerance, Availability, and Consistency, Else (or Latency, or Cost)." It adds subtlety to the CAP theorem by taking into account the trade-offs between consistency and latency during network splits. The CAP Theorem states that in a distributed computer system, it is impossible to concurrently ensure all three of the following: Consistency (C): All nodes in the system have the same data at the same time. Availability (A): Every request sent to the system receives a response, even if some nodes fail. Partition-tolerance (P): The system continues to run despite network partitions, which means messages between certain nodes may be delayed or lost. The CAP theorem states that a distributed system must choose between consistency (C) and availability (A) in the event of a network partition (P). Having both absolute consistency and absolute availability during a partition is not conceivable. PACELC Theorem: It expands the CAP theorem by incorporating two new factors: Otherwise (or Latency, or Cost): Represents the trade-offs made when the system is not partitioned. This aspect evaluates how the system behaves under regular (non- partitioned) conditions, focusing on issues such as latency and cost. PACELC essentially implies that during regular operations (no partitioning), the system may prioritize latency, cost, or some other parameter over consistency. In the absence of a network partition, the PACELC theorem accepts that a system may choose to prioritize other characteristics such as low latency or cost-effectiveness over rigorous consistency. In summary, while the CAP theorem outlines the trade-offs between consistency and availability during a network partition, the PACELC theorem extends this by considering how systems behave when there is no partition, including factors other than consistency and availability, such as latency or cost.