📜  分布式系统中基于令牌和非基于令牌的算法之间的区别

📅  最后修改于: 2021-09-13 03:04:35             🧑  作者: Mango

分布式系统是一个组件位于不同位置的系统,这些不同位置是指联网的计算机,它们可以通过相互交换消息轻松地进行通信和协调它们的任务。这些组件可以相互通信,以作为一项任务来征服一个共同的目标。

有许多算法用于实现分布式计算,这些算法大致分为两类:基于令牌的算法和非基于令牌的算法。

分布式系统中基于令牌和非基于令牌的算法之间的区别:

S.No. Token Based Algorithms Non-Token Based Algorithms
1. In the Token-based algorithm, a unique token is shared among all the sites in Distributed Computing Systems. In Non-Token based algorithm, there is no token even not any concept of sharing token for access.
2. Here, a site is allowed to enter the Computer System if it possesses the token. Here, two or more successive rounds of messages are exchanged between sites to determine which site is to enter the Computer System next.
3. The token-based algorithm uses the sequences to order the request for the Computer Systems and to resolve the conflict for the simultaneous requests for the System. Non-Token based algorithm uses the timestamp (another concept) to order the request for the Computer Systems and to resolve the conflict for the simultaneous requests for the System.
4. The token-based algorithm produces less message traffic as compared to Non-Token based Algorithm. Non-Token based Algorithm produces more message traffic as compared to the Token-based Algorithm.
5. They are free from deadlock (i.e. here there are no two or more processes are in the queue in order to wait for messages that will actually can’t come) because of the existence of unique token in the distributed system. They are not free from the deadlock problem as they are based on timestamp only.
6. Here, it was ensured that requests are executed exactly in the order as they are made in. Here there is no surety of execution order.
7. Token-based algorithms are more scalable as they can free your server from having to store session state and also they contain all the necessary information which they need for authentication. Non-Token based algorithms are less scalable than the Token-based algorithms because here server is not free from its tasks.
8. Here the access control is quite Fine-grained because here inside the token roles, permissions and resources can be easily specifying for the user. Here the access control is not so fine as there is no token which can specify roles, permission, and resources for the user.
9. Token-based algorithms make authentication quite easy. Non-Token based algorithms can’t make authentication easy.
10. Examples of Token-Based Algorithms are:

(i) Singhal’s Heuristic Algorithm
(ii) Raymonds Tree Based Algorithm
(iii) Suzuki-Kasami Algorithm    
Examples of Non-Token Based Algorithms are:
(i) Lamport’s Algorithm
(ii) Ricart-Agarwala Algorithm
(iii) Maekawa’s Algorithm