Search This Blog

Thursday, June 16, 2022

SPOF (Single Point of Failure)

A single point of failure(SPOF) in computing is a critical point in the system whose failure can take down the entire system. A lot of resources and time is spent on removing single points of failure in an architecture/design. 



Single points of failure often pop up when setting up coordinators and proxies. These services help distribute load and discover services as they come and leave the system. Because of the critical centralized tasks of these services, they are more prone to being SPOFs.


One way to mitigate the problem is to use multiple instances of every component in the service. The graph of dependencies then becomes more flexible, allowing the system to resiliently switch to another service instead of failing requests.


Another approach is to have backups which allow a quick switch over on failure. The backups are useful in components dealing with data, like databases.


Allocating more resources, distributing the system and replication are some ways of mitigating the problem of SPOF. Hence designs include horizontal scaling capabilities and partitioning.

Wednesday, June 15, 2022

CDN (Content Delivery Network) Explained

 Let's discuss about CDN in details and below are the points you would consider generally while serving static pages, images etc.

Use-case

  • An example of your server serving static and dyanamic html pages, images etc.

Caching

  • To make it more fast and efficient, first approach you would take is cache the details and serve it accordingly.

Device Customised Data

  • Different type of html pages and images that would serve to different devices (desktop, mobile etc). Let's say 5 diff devices and 100 diff countries so 1000 diff data points to be served by cache.

Performance Consideration

  • You want to serve your pages fast to the users else they would lose interest in the product if it takes time to load.
Global Cache
  • You would cache the information outside server to serve the content fast and to avoid single point of failure, you would go with distributed cache and data is spread across multiple servers of cache.
Shard Caches
  • To serve the requests even faster considering many combinations like 1000 data points discussed above, you might go with sharding and shard it based on locations, countries etc and diff type of request like probably request from US would go to diff set of cache box which would serve US related requests etc.
Localized Caches
  • One more problem would be let's say company is from US and cache servers are sitting in US and our user-base is across countries so to serve requests efficiently for diff countries etc we have to make localised cache say for India one data centre in India to serve requests and so on.
Why should you use a CDN?
  • Well If you have to design by your own, you have to take case of all above points and majorly concluded as below
    • Available in different countries
    • Follows regulations
    • Serves the latest content
What are the benefits of a CDN?
  • Specialised solution like CDN takes care of all of the above points and you can focus on your business logics to expand it further.
    • One of the good example if Akamai and specialiases in as below
      • Hosting boxes close to the users.
      • Follow regulations
      • Allow posting content in the boxes via UI.
      • Expiry time in CDNs
        • Something like sometime you need cache for 60 sec or 60 min only etc. Everything handled provided via UI.
    • Another good example for the same is Amazon S3.
      • Super cheap
      • Very reliable
      • Easy to use

In details explanation of CDN : https://learnwithnitin.blogspot.com/2014/02/content-delivery-network-cdn.html


Happy Learning :) 

My Profile

My photo
can be reached at 09916017317