In Data Science, distributed system is a collect of independent components located in different machines sharing messages to achieve common goals. Consistency Model is a set of rules that governs the behaviour within a distributed system.
The consistency model in distributed system plays a key role in ensuring that the system is consisten and dependable in the face of computing facilities. There are different types of consistency model and each model has its own beneficial features.
The following blog will work as a guide for you to know about Data Centric Consistency Model in distributed systems.
What is Data Centric Consistency Model?
The Data Centric Consistency Model is a set of principles and protocols used in distributed systems to define how data is accessed and updated, ensuring that all nodes in the system agree on the state of shared data.
It primarily focuses on the consistency guarantees provided to clients regarding the data they access and manipulate. In a distributed system, data is stored and managed across multiple nodes that communicate and collaborate to provide services and respond to client requests.
However, due to factors like network delays, node failures, and concurrent data updates, achieving consistency in such an environment can be challenging.
Types of Data Centric Consistency Model:
Data-centric consistency models are a set of principles and protocols that define how data is accessed and updated in a distributed system, ensuring that all nodes agree on the state of shared data.
These models primarily focus on the consistency guarantees provided to clients regarding the data they access and manipulate. Let’s explore the most common data-centric consistency models in detail:
- Strong consistency is the most stringent data-centric consistency model. It guarantees that all read and write operations on the data will appear to be executed in a single, global order.
- In other words, a read operation will always return the most recent write. This model ensures that all nodes in the system have the same view of the data at any given moment.
- To achieve strong consistency, distributed systems typically use techniques such as locking, serialization, or consensus protocols (e.g., Paxos or Raft). These mechanisms introduce additional latency and coordination overhead, which can impact system performance and availability. However, they ensure that the system behaves as if it were a single, centralized database.
- Eventual consistency is a more relaxed data-centric consistency model compared to strong consistency. It allows updates to be propagated asynchronously across nodes and promises that, given enough time and absence of new updates, all replicas will eventually converge to the same state.
- Under eventual consistency, clients might observe temporary inconsistencies or divergent views of the data during the convergence process. However, once the system stabilizes, all replicas will have the same data. This model enhances system availability and performance since it does not impose strict coordination requirements on every write operation.
- Eventual consistency is commonly used in scenarios where immediate synchronization is not required, such as content distribution systems, social media platforms, or non-critical data stores.
- Causal consistency is a more refined data-centric consistency model that preserves causality between related operations. It ensures that if one operation causally affects another, the latter will observe the effects of the former.
- For example, if a user posts a message and then later requests to view their posts, causal consistency ensures that the user will always see their own posts. However, it does not guarantee that the user will see posts from other users that were made after the request was initiated.
- Causal consistency allows for greater parallelism and performance improvements compared to strong consistency while still maintaining a partial ordering of operations.
- Read-your-writes consistency is a data-centric consistency model that guarantees that if a client performs a write operation, any subsequent read operation from the same client will always see the updated value. In other words, the client will always see its own writes.
- This model is useful for maintaining a consistent view of the data from the client’s perspective and is commonly applied in scenarios like session management, user preferences, or personal data updates.
Monotonic Reads and Writes:
- Monotonic reads and writes are data-centric consistency models that ensure specific ordering guarantees for read and write operations, respectively.
- Monotonic reads guarantee that if a client reads a particular value, it will never observe a previous value in subsequent reads. In other words, the value read by a client will only increase or remain the same over time.
- Monotonic writes ensure that writes from a client are serialized in a way that preserves their order. This means that if a client issues two write operations, the system will ensure that these writes are applied in the same order they were issued.
- These consistency models offer more relaxed guarantees compared to strong consistency but provide useful properties for applications where certain ordering requirements are essential.
Difference Between Data Centric and Client Centric Consistency Model:
|Data Centric Consistency Model
Client Centric Consistency Model
|Typical models are like Sequential Consistency or Casual Consistency
|you can find monotonic reads or read your writes as typical models
|guarantees that the results of read and write operations performed can be replicated to nearby stores immediately.
|it does not handle simultaneous updates but to maintain a consistent view different replicas can be accessed for different client processes.
|Does not guarantee that client can read latest data and may read out of date data.
|the focus is on creating a positive customer experience.
|restricts data storage for saving ine processing sequence of data.
|Believes that clients are the only reason that a business exist and ensures to keep the client satisfied.
From the above blog, you have been able to gain knowledge on Data Centric Consistency Model in a distributed system. As you come to know how data Centric Models are different from Client Centric Consistency Models, you learn the importance of both. Moreover, the Data Centric Model restricts the data storage on what can be stored therefore, ensuring complete privacy and authenticity of data.
A data-centric system is a type of information system or software architecture where the primary focus and organization revolve around data and its management.
The various types of Consistency Models include the following:
- Strong Consistency
- Pipelined Random Access Memory or FIFO Consistency Model
- Sequential Consistency Model
- Casual Consistency Model
- Weak Consistency Model
- Processor Consistency Model
Client centric model refers to the way in which data store presents the data models and values to individual clients defining how and when the client can access data across different replicas.
4.Read your writes 5.Consistency
6.Monotonic Read and Writes
Following are the points that distinguishes network model with hierarchical model:
- Data Structure:
- Hierarchical Model: In the hierarchical model, data is organized in a tree-like structure with a single root and various levels of child nodes branching out from the root. Each node can have multiple children, but each child can have only one parent, creating a parent-child relationship between nodes.
- Network Model: The network model, on the other hand, represents data as a more flexible graph-like structure. It allows each record to have multiple parent and child relationships, creating a network of interconnected records. This enables more complex and diverse relationships between data elements.
- Relationship Representation:
- Hierarchical Model: In the hierarchical model, relationships between data elements are represented through a parent-child hierarchy. Each child has only one parent, making it suitable for representing one-to-many relationships.
- Network Model: The network model represents relationships through sets, where a record can be a member of multiple sets. This allows the representation of many-to-many relationships, making it more suitable for complex data structures.
- Hierarchical Model: The hierarchical model provides a simple and straightforward representation of data with a fixed, one-to-many parent-child relationship. While it works well for certain types of data, it may be less flexible in handling more complex data structures with multiple relationships.
- Network Model: The network model offers greater flexibility in representing complex data structures and relationships. With the ability to have multiple parent and child relationships for each record, it can handle a wider range of data scenarios.
- Querying Capabilities:
- Hierarchical Model: In the hierarchical model, queries typically follow a top-down approach, starting from the root and traversing down the tree to retrieve data. While it efficiently retrieves hierarchical data, it may become challenging to navigate the tree for more complex queries involving multiple relationships.
- Network Model: The network model allows for more versatile queries due to its ability to represent many-to-many relationships. It enables more efficient retrieval of interconnected data, making it suitable for applications that require complex querying capabilities.