PBDMS HW3 (2)

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

5

Uploaded by DukeFreedom11576

Report
Name: Vignesh 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. Event Diagram: Profile Picture Updates 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 Consistent prefix: This structure ensures that out-of-order writes are never seen by readers. This implies that every read of a data item will always see the first write before the second write if an edit to the data item happens before another write. The data might not always be up to date, though. For instance, even if the initial write is the most recent one, a read of the data item can return the subsequent write if there is a write to it and additional writing happens before the first write has been reproduced to every duplicate. b. Bounded staleness Bounded staleness: This paradigm ensures that clients will never see material that is older than a certain period of time. The staleness bound refers to the maximum period of time during which information can be outdated. A read of a data item will never return data that is older than five seconds, for instance, if the staleness restriction is set at five seconds. The information might not always be up to date, though. For instance, even if the first write is the most recent, a read of the data item may return the subsequent write if a write to it happens and then another writing to the same data item happens before the first write has been replicated to all replicas. c. Monotone read Monotone read: The technique ensures that reading a data item will always yield an escalating sequence of data or the same value. This implies that a read of the data item will never return the second write if the first write has already been accessed if a write to the data item happens and then another write to the same piece of data happens before the first write has been propagated to all replicas. Strong consistency ensures that readers consistently view the most current writing, and it is the stronger of all these fidelity models. Those are, nonetheless, also far more effective, and scalable than solid consistency.
(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.
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
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 essential to establishing eventual consistency in distributed databases such as Amazon DynamoDB. In distributed systems, ultimate consistency is the feature where all replicas eventually converge to the same value after all updates stop. To provide fault tolerance and high availability in DynamoDB, replicating data entails keeping several copies of the data on other servers or nodes. In DynamoDB, the write operation is first done to the "master" replica, which is the only replica. After that, the changes spread asynchronously to the other clones. Different copies may have slightly different versions of the data at any one time due to this asynchronous replication process. According to the asynchronous nature of replication, there may be a brief interval during which distinct clones have different data, giving birth to the idea of eventual consistency. When no more copying operations are being performed, DynamoDB makes sure that these copies finally converge to the same state. Alex Debrie describes in the paper you cited how DynamoDB uses eventually consistent reads, versions, and conflict resolution to achieve eventual coherence. The above steps make sure that the system assures that various imitations will ultimately approach consistency by converging to the same state, even though they may store distinct renditions of the data briefly. (b) What is the PACELC theorem? How is this related to the CAP theorem? The CAP theory, which asserts that a distributed network cannot concurrently attain high consistency, availability, and partition tolerance, is expanded upon and strengthened by the PACELC theorem. This is extended by the PACELC theorem, which inserts two more variables: inevitably consistent (E) and latency (L). The CAP Hypothesis According to Eric Brewer's 2002 introduction of the CAP theorem, no distributed system can concurrently accomplish all three properties:
Consistency (C): The most recent writings are reflected in every read. Availability (A): Regardless of the consistency of the data, all inquiries are met with a non-error response. Partition tolerance (P): In the event of a network failure or partition, the system keeps running. A distributed system is understood to have to trade-off between these three qualities by the CAP theorem. A system that puts availability first, for example, might compromise consistency, causing reads to return outdated information when a network divide occurs. On the other hand, a system that prioritizes consistency might risk availability by stopping processes in order to protect data integrity throughout partitions. Theorem PACELC The CAP theorem is extended by the PACELC theorem, which takes eventual consistency and latency into account: Latency (L): The amount of time that passes between a write and a read. Eventually consistent (E): Not always instantly, but all reads eventually match the most recent writes. The PACELC theorem underlines that distributed systems have to manage consistency and latency even in the absence of network splits. While a system emphasizing high level of consistency may have higher latency owing to replicating and synchronizing cost, a system prioritizing low latency might enable stale data to be viewed for only a brief period. Relation between the PACELC and CAP Theorems By acknowledging that the CAP trade-off is relevant under both normal operating conditions and network sections, the PACELC theorem expands on the CAP hypothesis. It highlights the importance that it is to take durability and latency into account when building networks of computers. PACELC theorem, in short, offers a more sophisticated and all-encompassing framework for comprehending the trade-offs associated with distributed system design. It assists system designers in making well-informed choices on the relative importance of latency, availability, consistency, and partition tolerance in relation to the particular needs of their applications.