Blockchain Technology Comprehension. A Survey On Distributed Systems -Part 1
Introduction
Licensed under Creative Commons Attribution-Share Alike 4.0 International license. Source
Understanding the basics. Distributed Systems
A distributed system is a set of nodes where two or more of them work co-ordinately in order to achieve a common outcome when carrying out a certain task. Each node is capable of having autonomous behavior, i. e. each node has its own memory and processor, and ideally, each one could fail individually without affecting the global performance of the network. Also, nodes function in a way that allows final users to perceive them as a single logical unit.
For example, we perceive Ethereum network as an entity onto which Smart Contracts are coded and executed harmoniously, but it is the sum of the individual work of each node what makes possible for Smart Contracts to operate.
Distributed Systems have the following features:
- Components within distributed systems have resource sharing, both hardware and software are commonly employed to fill the needs of the network's tasks.
- Any distributed system allows horizontal-scaling. Instead of upgrading the system by investing in hardware with greater capabilities, hosters can just add another computer to improve the network's performance.
Main drawbacks of distributed systems
The CAP theorem
The last statement should be further clarified, what does it mean that a network should keep functioning in spite of several nodes having faulty or malicious behavior? The CAP theorem provides the basic foundation for the understanding of distributed systems' operation mechanism. But before reviewing the CAP theorem, some basic concepts must be taken into account:
- Consistency:
We say that a distributed network has consistency if it always gives back a response fitting the expected service specifications. - Availability:
If each not-faulty node within the network eventually gives an answer, we state that the network has availability. Nevertheless, in real systems, a response delayed for too long is equivalent to the situation where the network does not respond at all. - Partition-tolerance:
The partition Tolerance is a characteristic inherent to the system itself, it is intended to address the situation where communication between elements of a network (without including users) is not reliable. For example, when there are two nodes geographically apart and they are unable to communicate with each other to synchronize the shared state, we say that the system is partitioned. If such a system is able to keep functioning flawlessly in that scenario, it is said that the system is partition tolerant.
The CAP theorem states that in a network where communication failures occur (i. e. the system is partitioned) it is impossible to have both consistency and availability at the same time. Let's consider a system of two nodes running a distributed database service with reading/write functions allowed for users. If while receiving users requests the connection of the nodes dies, there is no way for them to know what the other node is doing. In this situation, if they attempt to respond to every request, they could start working with stale information (loss of consistency). But if a node stops responding requests in order to avoid giving a wrong response, then the network loses availability.
How Cap theorem's limitations are handled?
Consistency trade for Availability
Availability trade for Consistency
This approach is taken when there is usually a reliable network communication, data servers located in one data center are good examples of this situation. When prioritizing consistency a slave-master structure is often chosen to design the network architecture. Therefore, we would have a master node that will synch with shared replicas in order to update the global state when receiving a request. The network will first update the shared state before giving responses to the subsequent request, thus high levels of consistency are achieved.
Gluing pieces with different trade-offs
As stated earlier, some system designers choose to create a network adding up pieces with different trade-offs, some guarantee high levels of consistency whether others have high levels of availability. The system functions with several partitions, here we will summarize some of the most common ones:
- Data partitioning: In some cases, it is acceptable that some data update is delayed, for example, stock disponibility in an e-commerce service. But in other cases data must be always consistent, the clearest example should be the balance of a bank account or the bills payout.
- Operation partitioning: An example of operation partitioning happens when on a database read-only operation are prioritized out the bulk traffic to enhance the levels of availability while writing/append operations could stop functioning when the network experiments poor inner communication.
- Functional Partitioning: This strategy is adopted when a service is subdivided into several sub-services, hence each sub-service will have its particular trade-off best fitting its requirement.
- User Partitioning: Designers tend to choose this approach when a service is provided across great extensions of land or when the network should bear massive workload as in social media services. Users from different spots relay on servers located close to them, this guarantees high availability and at the same consistency is readily achieved if the communication between the servers is highly reliable.
Final thoughts
It is important to have a clear comprehension of distributed systems properties. When designing one such system the use case for what it is intended will determine the convenience for a particular level of trade-off between consistency and availability in each component of the distributed system.
In the next post we will consider the more general and theoretical cases, we will see that consistency-availability trade-off is a particular case of the more general trade-off between safety and liveness in an unreliable system. Also, we will further elaborate on the details of the distributed systems characteristics.
References
- Seth Gilbert and Nancy Lynch. Brewer’s conjecture and the feasibility of consistent, available, partition-tolerant web services. SigAct News, June 2002.
- Seth Gilbert and Nancy Lynch. Perspectives on the CAP Theorem. IEEE Computer Society Press, February 2012.
Hey, what's up my friend? It's very fascinating that you want to use this platform to develop a blockchain, step by step.
I was thinking last week that data on the internet about this technology is very voluminous, therefore if you want to immerse in this new knowledge ocean for the first time alone you can feel afraid (joke lol).
Well, I am really interested in your project, I would like to share with you my basic knowledge of the networks. But first I have a request for you:
I would like to see a roadmap for example, where you present in time concrete objectives.
And I have a question for you:
When you refer a Consisting and Availability, do you refer to TCP and UDP protocols?
Well, I am anxious for the next post and for your answer.
There is no roadmap yet to show, I only know that I will invest this last semester of 2018 to gather as much information as I can, and to invite as many talented people as possible to join this venture. I don't know yet if I am just wishfully thinking or if the goal of creating a self-governed and self-managed public budget platform is feasible in my country.
Of course, I believe it is, but I cannot state that with numbers on my hand due to being still in a design stage phase. If you want to jump in and start writing on the blackboard I will be pleased to welcome you.
Speaking about your TCP/UDP question, In my post, I wasn't pointing out a specific system design for network communication. I tried to explain in simple terms some of the theoretical limitations of actual technology for distributed system design.
Yet you can see those theoretical concepts reflected upon the functioning of TCP/UDP. Because with TCP data can only be transmitted once a connection is established, data is ordered, listed and checked to avoid errors. High consistency is prioritized over high availability. With UDP, we can see the opposite trade-off; because while using UDP data is just sent in packages around the internet without guaranteeing prior connections, error checking or listing, you have high availability preferred over high consistency.
Two simple examples to illustrate the usage of this different protocols are files downloading services and live broadcasting. When downloading a file, it is of best interest to keep the packages that add up to form the final file without errors and properly ordered; thus TCP is used in this services. While life broadcasting it is important to reduce network latency, because what matters most is to be updated with the event that is life broadcasted; since listing and error checking consume time, UDP will be used in life broadcasting services.
I hope my explanation may have fully answered your question. If not, feel free to further ask.
Hey man, I've been interested in the blockchain from his starts, and I think your project is so ambitious and exciting so I want to join you.
I've been reading about the cap theorem and it´s interesting because the blockchain apps appear to violate this theorem at first sight, but according to Mastering Blockchain book from Imran Bashir, what it really does is to sacrifice consistency in favor of availability and partition tolerance. It achieves eventual consistency(The nodes will get updated after a reasonable time) and looks like that's enough for miners to develop consensus.
I know that's true almost for bitcoin but it would be interesting to make a deeper investigation about it.
Be aware I will be posting about those themes soon, so I hope we can share our work and feedback each other.
But what really decides whether a consensus mechanism is successful or not, is its ability to economically reward trustworthy behaviors and to punish byzantine ones.
cya.
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by jasb from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.
✅ @jasb, I gave you an upvote on your first post! Please give me a follow and I will give you a follow in return!
Please also take a moment to read this post regarding bad behavior on Steemit.
Congratulations @jasb! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
You made your First Comment
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard!
Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes