Wednesday, December 20, 2023

Important Key Concepts and Terminologies

 System Design is the core concept behind the design of any distributed systems. System Design is defined as a process of creating an architecture for different components, interfaces, and modules of the system and providing corresponding data helpful in implementing such elements in systems.

the standard terms and key concepts of system design and performance, such as:

·       Latency, 

·       Throughput, 

·       Availability,

·       Redundancy,

·       Time

·       CAP Theorem

·       Lamport’s Logical Clock Theorem. 

Latency:

Latency is defined as the amount of time required for a single data to be delivered successfully. Latency is measured in milliseconds (ms).

There is a certain amount of time required for user input over the website and there is a certain amount of time for the response from the web application to the user. So the delay between user input and web application response to the same input is known as latency

Reasons for high Latency

Now you must be wondering about the factors that are responsible for delays. So high latency mainly depends on 2 factors:

  1. Network Delays 
  2. Mathematical Calculation Process Delays 

 In monolithic architecture, as we know there is only a single block and all network calls are local within hence network delay is zero and hence latency equals computational delays only (which if not latency equals zero in monolithic systems).

Latency = Mathematic Calculation Delays

In distributed systems, there is a networks over which signals are passed to and fro hence there will for sure be network delay.

Latency = Mathematic Calculation Delays + Network Delays 

How to Reduce latency:

  1. Use a content delivery network (CDN): CDNs help to cut down on latency. In order to shorten the distance between users and reduce the amount of time that data must travel over great distances, CDN servers are situated at various locations.
  2. Upgrading computer hardware/software: Improving or fine-tuning mechanical, software, or hardware components can help cut down on computational lag, which in turn helps cut down on latency.
  3. Cache: A cache is a high-speed data storage layer used in computers that temporarily store large amounts of transient data. By caching this data, subsequent requests for it can be fulfilled more quickly than if the data were requested directly from its original storage location. This lessens latency as well.

 Throughput:

Throughput is defined as the measure of amount of data transmitted successfully in a system, in a certain amount of time. In simple terms, throughput is considered as how much data is transmitted successfully over a period of time. The unit of measure for throughput is bits per second or bps.

 Availability:

Availability is the percentage of time the system is up and working for the needs. 

How to increase Availability?

  1. Eliminate SPOF(major and important)
  2. Verify Automatic Failover
  3. Use Geographic Redundancy
  4. Continue upgrading and improving.

 

From the above understanding, we can land up with two conclusions:

  1. Availability is low in monolithic architecture due to SPOF.
  2. Availability is high in distributed architecture due to redundancy.

 Redundancy:

Redundancy is defined as a concept where certain entities are duplicated with aim to scale up the system and reduce over all down-time

 Consistency:

Consistency is referred to as data uniformity in systems

When a user requests data, the system always returns the same data, regardless of the user’s location, time, etc. Before a user receives data from any node, the server at which the data is updated or changed should successfully replicate the new data to all the nodes.  

Time:

Time is a measure of sequences of events happening which is measured here in seconds in its SI unit. 

It is measured using a clock which is of two types:

  1. Physical Clock: responsible for the time between systems.  
  2. Logical Clock: responsible for the time within a system. 

 CAP Theorem:

Three desirable characteristics of distributed systems with replicated data are referred to as CAP: partition tolerance, availability, and consistency.

 Lamport’s Logical Clock Theorem:

Lamport’s Logical Clock is a process to ascertain the sequence in which events take place. It acts as the foundation for the more complex Vector Clock Algorithm. A logical clock is required because a distributed operating system (Lamport) lacks a global clock.

 

No comments:

Post a Comment