Difference between Token based and Non-Token based Algorithms in Distributed System
A distributed system is a system in which components are situated in distinct places, these distinct places refer to networked computers which can easily communicate and coordinate their tasks by just exchanging messages to each other. These components can communicate with each other to conquer one common goal as a task.
There are many algorithms are used to achieve Distributed Computing and these are broadly divided into 2 categories: Token-Based Algorithms and Non-Token Based Algorithms.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Difference between Token based and Non-Token based Algorithms in Distributed System:
|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