Hello Geeks
In a simple way, distributed systems is a Shared Architecture to achieve three aspects, terms of scalability, fault tolerance and latency for a system with multiple machines which supposed to achieve high availability of data storage and retrieval.
In a simple words, distributed systems consists of machines or virtual machines , each one of these machines is called Node , each one of these nodes use independent resources.
To build a distributed system only you need to now is the following two ways: Replication
and Partitioning
And we will talk about Replication
Let's get started!
Replication
means keeping a copy of the same data on a multiple machines that are connected via a network.
Replication has advantages:
- Allow users in different locations to access the data.
- Give the system the ability to work even if one of the nodes is down, another node will work instead and serve the users, because replication provides the redundancy.
- Improve and Increase throughput.
So how we can implement this type of distributing data, we have several ways we'll talk only about the first simple architecture, which called Leaders and Followers
Leaders and Followers
this way provide nodes, called replica, this way also called leader-based replication.
The components of the above architecture
- Leader (called active) has the replication log.
- Follower (called read replicas) they are the other replicas.
How it works
When a user need to write its data to the application, data forwarded to the leader which is the write-only replica, then the leader saves the changes and send them to the all followers using a log to tell them the changes must be applied to the database, and so far we have the same data in all nodes.
and if the user want to read its data again, the request forwarded to one of the followers.
Used in
replication used in databases like: PostgreSQL, MySQL, Oracle Data Guard and SQL
Also used in NoSQL databases like: MongoDB and Espresso
Glad you got here, this topic is an important topics for software engineers, especially for Data and Big Data Engineers, You need to read a book to gain the whole knowledge or watching a specialized course, to know more about distributed systems, so i recommend the best book as a start, which called Designing Data-Intensive Applications it is a really worth book to read.
Thanks a lot for reading this article, if you love the content, share it to help others to learn more. Bye Bye! 👋
HEADER IMAGE: Hackernoon
.
LEADER-FOLLOWER IMAGE: Designing Data-Intensive Applications
.
Top comments (0)