Skip to main content

Posts

Showing posts from January, 2022

Consensus and Paxos in Distributed Systems

Before discussing Consensus and Paxos, we need to know some basic information. So, do you know that we use various distributed systems in day-to-day life even without knowing it? Let me give you an example. You probably have to use google docs, google slides, or any similar kind of cloud service. So if you think about google docs, can it be a single application executed on a single machine? You need to know that real-time processing and concurrent processing are very expensive for performance. Therefore, definitely, it should be a supercomputer or something that can handle those expensive computations in an efficient and effective way. In reality, it is a network of a large number of connected machines and devices. A distributed system is a system that has multiple components located on different machines that communicate and coordinate actions in order to appear as “a single coherent system” to the end-user. Consensus addresses a fundamental problem in the distributed system and Paxo

Consensus and Paxos in Distributed Systems

Before discussing Consensus and Paxos, we need to know some basic information. So, do you know that we use various distributed systems in day-to-day life even without knowing it? Let me give you an example. You probably have to use google docs, google slides, or any similar kind of cloud service. So if you think about google docs, can it be a single application executed on a single machine? You need to know that real-time processing and concurrent processing are very expensive for performance. Therefore, definitely, it should be a supercomputer or something that can handle those expensive computations in an efficient and effective way. In reality, it is a network of a large number of connected machines and devices. A distributed system is a system that has multiple components located on different machines that communicate and coordinate actions in order to appear as “a single coherent system” to the end-user. Consensus addresses a fundamental problem in the distributed system and Paxo

JavaScript Infinite Loops that work on browsers

What's the big deal about JavaScript infinite loops? That's the common question that gets into your mind if you are not aware of the usefulness of infinite loops or the working context of the JavaScript inside a browser. So, let's dig into points and facts. First of all, we need to understand what an infinite loop is. In computer programming, a loop is a sequence of instructions that is repeated until a certain condition is reached. The only difference in an infinite loop is it will never reach the terminating condition or there is no one. However practical aspects are a little bit different. That means even it seems infinite, it will terminate at some point due to some reason or by a condition. Let's see about that. In general, you can achieve infinite loops using "for", "while" or other keywords as below in most of the programming languages. (Consider this as a pseudo code) while(True) {} The condition is always "True" and therefore the