Posts

Redundancy

Image
  Redundancy It is duplication of nodes or components so that when a node or components fails duplicate node is available to service customers. Active Redundancy When each unit is operating/active and responding to the action. Multiple loads are connected to load balancer & each unit receives an equal load. Passive Redundancy When 1 node is active/operational and the other is not responding. During the breakdown of active node , passive node maintains availability by becoming the active node.

Caching Eviction Techniques

Image
 Caching Eviction Techniques 1. LRU - Least Recently Used : It delete the cache not used in a very long time. 2. MRU - Most Recently Used : It delete the cache most recently used in a very long time. 3. LFU - Least Frequently Used : It delete the cache space among all which is least used 4. LIFO - Last In First Out :                                       5. FIFO - First In First Out : 6. RR - Random Replacement : 

Caching

Image
 Caching For Example : Instagram profile page which is a static information ,retrieve same information by clicking 10 times , for 1st time its retrieved from server ,for getting information next time onwards it can be store in cache ,inorder to reduce latency for getting response in lesser time.                                                                      Instagram profile page Data Retrieval Two Types: Memory / Locale Cache : Example: Memcached When to be use ? 1. Read Intensive : 2. Static Contents Distributed / Extended Cache: Example: Redis Two Types: 1. Application Server Cache : DB query response query server in cache. 2. CDN

Scalability

Image
  Scalability When number of requests increases ,it determines strength of system is up or down, response time should decrease or it should be maintained. Vertical Scalability 1 machine having 1 server with high configuration , RAM we can increase , DB Hard Disk we can increase. PROS                                                                  Easy Implementation                                                                                                                                    ...

Designing Instagram

Image
  Designing Instagram

Lamport Logical Clock

Image
Sequence of events are taken into count , when server are at different geographical regions of the world . Different geographical regions have different timestamp. Different server at different place with different timestamp Two process P1,P2 process ,events are taking place :  New event take place: increment the count Received event: Maximum of event1 & event2 ,by increment of 1

Examples of CAP Theorem:

Image
  CAP Theorem: For a distributed System, CAP Theorem states that it is possible to attain only two properties and the third would be always compromised.  Examples of CAP Theorem: Note: Partition Tolerance is important part .So we have option to choose either Availability or Consistency inorder to achieve CAP Theorem statement. Which is more important? Availability or Consistency a) Blog Website :  Availability   Reason:   It is necessary for it to be available. b) Multiplayer online game  :  Availability  Reason:   It is necessary for it to be available for user experience. c) Bank : Consistency Reason: Amount /Data inserted should be consistent.                               This should not happen balance after cash deposit of amount 100 still showing 0 d) Ticket Booking System :   Consistency Reason: Ticket booked for a seat should be updated fo...