This video belongs to the openHPI course Blockchain - Sicherheit auch ohne Trust Center. Do you want to see more?
An error occurred while loading the video player, or it takes a long time to initialize. You can try clearing your browser cache. Please try again later and contact the helpdesk if the problem persists.
Scroll to current position
- 00:00Let us now deal with the problems, how we can achieve consistency in a distributed system.
- 00:07And we had the CAP theorem in the last learning video. had met, seen, consistency,
- 00:12that the information in the distributed system is the same at all points, that the availability, namely that the system is reachable for each participant
- 00:26and that the system will work even if there are network breaks, if there are errors in the network connection and the distributed system is divided into different parts.
- 00:40We had seen, these are the challenges, that one would like to be ensured in a distributed system,
- 00:46but it can't be done, because a maximum of two of these things can be achieved.
- 00:52Here's a look, how's the consistency? for example, when it comes to a break,
- 00:59that the distributed system breaks down into two parts because a connection is broken. or a computer goes down, a connection computer goes down,
- 01:07and the various participants, who are now working in the bank, for example, work on different parts of the network.
- 01:17So if a customer here makes a transfer to another, and there's no network connection, it's gonna be hard, to perceive the corresponding change on his system.
- 01:30That's a challenge, how to achieve consistency in such cases.
- 01:35If we look at the consistency at all in the normal case, so don't even think about such a partition of the network,
- 01:45then we have situations, that the individual participants access the system.
- 01:51And what part of the distributed system they're accessing, on which computer, that's not clear at all.
- 01:58It could be local things, This may be due to network connections,
- 02:01that is, if the participant there reads his account balance in the various systems, it is of course important that this account balance is the same everywhere,
- 02:11he didn't get through the different request to different systems in such a distributed system then gets different answers.
- 02:20That is the question of consistency, and there need to be mechanisms for producing that consistency,
- 02:28so like this change made on a computer of the distributed system, for example, a new account balance,
- 02:37as it is made known to the other computers in the distributed system, will be made known as soon as possible,
- 02:45so that if the users are using a different computer, the access their information, they get the same information, regardless of which single computers they have accessed.
- 02:59So to establish the consistency between the participants, that is a very important challenge in such distributed systems, and this succeeds with so-called consensus algorithms.
- 03:10Which lead to such consensus algorithms, that lead to the synchronization of the individual computers in a distributed system.
- 03:19Such a consistency model is like a contract, a contract between the user and the distributed system. where availability and consistency issues are addressed.
- 03:34So what can the user expect from the system?
- 03:37What guarantees does the system give with regard to the answers, so in view of the fact that on all parts of the system, the same information is available on all computers in the system?
- 03:48Here you have to look, it can be a large distributed system, a globally active bank, then of course it's a big challenge,
- 04:00to ensure that a change, which is performed on a computer of the system on a computer,
- 04:05also very quickly to changes of the corresponding information on the other computers of the distributed system.
- 04:11It takes time, it's response time, it's latency, to establish this tie.
- 04:19And for all these consensus algorithms there is now a measure, how quickly it is possible to achieve consistency,
- 04:30because as long as this new information is not distributed across all computers in the distributed system, the consistency is not given.
- 04:39Because then there are quite individual computers of the system at different levels of knowledge.
- 04:46So you can now look at different requirements, i.e. the strict consistency or Strong Consistency in such a distributed system.
- 04:58There is a demand that the data must always be up-to-date, so high latency, and that fits when writing conflicts can occur,
- 05:09that both here someone on a balance is changing something as well as here on another system, you just have to make sure it doesn't lead to insistencies.
- 05:20So if we take a look here, so for example participant writes for X = 1 and another participant now reads the value of X,
- 05:30for example, the value of the account balance, well, then this information must be that X = 1, distributed over the distributed system,
- 05:40so that all other computers are able to do the same, then output the value of X.
- 05:46That is, if I read on another computer, information, that was changed on another participant in the distributed system, it must be ensured that this exchange takes place in the system,
- 06:01so it can't happen, that a participant is reading false information.
- 06:06It's very hard to make, and it takes time, until this information is then distributed across the distributed system, is propagated and consistency is established.
- 06:19Therefore, we also consider other models for consistency, the so-called weak consistency.
- 06:26They say, well, they'll take care of it, that these computers are all on the same level, but this will be done at the appropriate opportunity.
- 06:36That is, here, at this weak consistency. in the distributed system it may well be,
- 06:42that from different computers in this distributed system. different statements, different data,
- 06:52that the change of the value X hasn't spread across the entire network yet.
- 06:58That's tolerable when it comes to reading, you've read a wrong value,
- 07:07this is difficult when it comes to the writing function, because then, of course, serious mistakes are made.
- 07:16So we look at each other again, participant sets X = 1, and when the participant connects to this system, then of course he immediately gets the value X = 1.
- 07:28However, if the participant himself, another participant, with this request for example geographically to another computer in this bank's distributed system
- 07:40and since the value reads X, then he gets, as long as this exchange of data, as long as the consistency is not established, of course a wrong answer,
- 07:50that leads here to it, and now you see, this exchange is happening now. and it happens again, and if he reads it, after this consistency algorithm has been processed,
- 08:06he'd get the right answer.
- 08:09So the topic of how to ensure in such a distributed system, that these individual parts of this distributed system, these individual computers.
- 08:21have the same level of data and knowledge, that's a challenge.
- 08:27There are several ways to ensure this with correspondingly different properties.
To enable the transcript, please select a language in the video player settings menu.