Wednesday, 8 August 2018

A Distributed System Design Basics -- Newbie Level

What is Distributed System?

A Distributed System is an application that executes a collection of protocols to coordinate the actions of multiple processes on a network, such that all components cooperate together to perform a single or small set of related tasks.

Why build A Distributed System?

 There are lots of advantages including the ability to connect remote users with remote resources in an open and scalable way. When we say open, we mean each component is continually open to interaction with other components. When we say scalable, we mean the system can easily be altered to accommodate changes in the number of users, resources and computing entities.

Lets Dive into it...

Basic terminologies

We try to explain some of the terminologies in simple words. Lookup wiki for a more formal definition.
  • Replication: Replication refers to frequently copying the data across multiple machines. Postreplication, multiple copies of the data exists across machines. This might help in case one or more of the machines die due to some failure.
  • Consistency: Assuming you have a storage system which has more than one machine, consistency implies that the data is same across the cluster, so you can read or write to/from any node and get the same data.
    • Eventual consistency: Exactly what the name suggests. In a cluster, if multiple machines store the same data, an eventually consistent model implies that all machines will have the same data eventually. It's possible that at a given instance, those machines have different versions of the same data ( temporarily inconsistent ) but they will eventually reach a state where they have the same data.

  • Availability: In the context of a database cluster, Availability refers to the ability to always respond to queries ( read or write ) irrespective of nodes going down.
  • Partition Tolerance: In the context of a database cluster, cluster continues to function even if there is a “partition” (communications break) between two nodes (both nodes are up, but can’t communicate).
  • Vertical scaling and Horizontal scaling: In simple terms, to scale horizontally is adding more servers. To scale vertically is to increase the resources of the server ( RAM, CPU, storage, etc. ).
    Example: Let's say you own a restaurant which is now exceeding its seating capacity. One way of accommodating more people ( scaling ) would be to add more and more chairs (scaling vertically). However since space is limited, you won’t be able to add more chairs once the space is full.
    Another way of scaling would be to open new branches of the restaurant ( horizontal scaling ).
  • Sharding: With most huge systems, data does not fit on a single machine. In such cases, sharding refers to splitting the very large database into smaller, faster and more manageable parts called data shards.

Monday, 6 August 2018

A plain English introduction to CAP Theorem - A Tale of Your Own Distributed System

Professional Definition...

CAP Theorem states that in a distributed system, it is impossible to simultaneously guarantee all of the following:
  • •  Consistency
  • •  Availability
  • •  Partition Tolerance
Let's dive in and see how and why the CAP system came into existence, with a very plain and simple analogy.
You’ll often hear about the CAP theorem which specifies some kind of an upper limit when designing distributed systems. As with most of my other introduction tutorials, let's try understanding CAP by comparing it with a real-world situation.

Chapter 1: “Remembrance Inc” Your new venture :

Last night when your spouse appreciated you on remembering her birthday and bringing her a gift, a strange Idea strikes you. People are so bad at remembering things. And you’re so good at it. So why not start a venture that will put your talent to use? The more you think about it, the more you like it. In fact, you even come up with a newspaper ad which explains your idea
Remembrance Inc! - Never forget,  even without remembering!
   Ever felt bad that you forget so much?  Don't worry. Help is just a phone away!
    When you need to remember something, just call 555--55-REMEM and tell us what you need to remember. For eg., call us and let us know of your boss's phone number, and forget to remember it. when you need to know it back.. call back the same number[(555)--55-REMEM ] and we'll tell you what's your boss's phone number.
   Charges : only $0.1 per request
So, your typical phone conversation will look like this:
  • Customer: Hey, Can you store my neighbor’s birthday?
  • You: Sure.. when is it?
  • Customer: 2nd of Jan
  • You: (write it down against the customer’s page in your paper notebook )Stored. Call us any time for knowing your neighbor’s birthday again!
  • Customer: Thank you!
  • You: No problem! We charged your credit card with $0.1

Chapter 2: You scale up:

Your venture gets funded by YCombinator. Your Idea is so simple, needs nothing but a paper notebook and phone, yet so effective that it spreads like wildfire. You start getting hundreds of call every day.
And there starts the problem. You see that more and more of your customers have to wait in the queue to speak to you. Most of them even hang up tired of the waiting tone. Besides when you were sick the other day and could not come to work you lost a whole day of business. Not to mention all those dissatisfied customers who wanted information on that day.
You decide it’s time for you to scale up and bring in your wife to help you.
You start with a simple plan:
  1. You and your wife both get an extension phone
  2. Customers still dial (555)–55-REMEM and need to remember only one number
  3. A PBX will route the customers call to whoever is free and equally

Saturday, 21 July 2018

Cloud Coumputing -- What Does IaaS, Paas and SaaS Means for You ?

Today's articles will cover some very basic fund's of Cloud Computing.
These Are:

  1. IAAS (Infrastructure As A Service) 
  2. PAAS (Platform As A Service) 
  3. SAAS (Software As A Service) 

IaaS, PaaS and SaaS are cloud computing service models.

  • IaaS (Infrastructure as a Service), as the name suggests, provides you the computing infrastructure, physical or (quite often) virtual machines and other resources like virtual-machine disk image library, block and file-based storage, firewalls, load balancers, IP addresses, virtual local area networks etc.
    Examples: Amazon EC2, Windows Azure, Rackspace, Google Compute Engine.
  • PaaS (Platform as a Service), as the name suggests, provides you computing platforms which typically includes operating system, programming language execution environment, database, web server etc.
    Examples: AWS Elastic Beanstalk, Windows Azure, Heroku,, Google App Engine, Apache Stratos.
  • While in SaaS (Software as a Service) model you are provided with access to application software often referred to as "on-demand software". You don't have to worry about the installation, setup and running of the application. Service provider will do that for you. You just have to pay and use it through some client.
    Examples: Google Apps, Microsoft Office 365.
Few additional points regarding your question:
  1. AWS (Amazon web services) is a complete suite which involves a whole bunch of useful web services. Most popular are EC2 and S3 and they belong to IaaS service model.
  2. Although Hadoop is based on previous works by Google(GFS and MapReduce), it is not from Google. It is an Apache project. You can find more here. It is just a distributed computing platform and does not fall into any of these service models, IMHO.
  3. Microsoft's Windows Azure is again an example of IaaS.

Thursday, 5 January 2017

How do I get my UAN number ? - Exclusively For Indian Readers

Today's post is very important for all the youth out ther who is working in private or government owned organizations. Let's, skip the formal introduction for today and get started. 

So, what is PF account?

Quoting Wikipedia
"The Employees' Provident Fund Organisation (abbreviated to EPFO), is an Organization tasked to assist the Central Board of Trustees, a statutory body formed by the Employees' Provident Fund and Miscellaneous Provisions Act, 1952 and is under the administrative control of the Ministry of Labour and EmploymentGovernment of India.
EPFO assists the Central Board in administering a compulsory contributory Provident Fund Scheme, a Pension Scheme and an Insurance Scheme for the workforce engaged in the organized sector in India. It is also the nodal agency for implementing Bilateral Social Security Agreements with other countries on a reciprocal basis. The schemes cover Indian workers as well as International workers (for countries with which bilateral agreements have been signed. As of now 17 Social Security Agreements are operational). It is one of the largest social security organisations in India in terms of the number of covered beneficiaries and the volume of financial transactions undertaken. The EPFO's apex decision making body is the Central Board of Trustees (CBT).
The total assets under management are more than 8.5 lakh crore (US$128 billion) as of 18 March 2016."
The second's thing that we need to know is, What is UAN Number?
"The UAN is made of 12 digits allotted to all employees contributing to the EPF. The UAN is a landmark step to shift the EPF service to the online platform, making it more user-friendly. The UAN of the employee remains the same throughout the entire service life. It doesn’t change while changing jobs."

Below are the steps for activating the PF UAN number:

Step 1: The PF UAN Number will be given by your organization.

Wednesday, 7 December 2016

Best Emulator For your Personal Computer - BlueStack vs Andy vs KOPlayer

A Big Hellow to all Computer Stuffs, Lovers! How you all doing ? Hoping to be all in best of their health. You all must be thinking, what brings me on the deck again? 👀

Let me clear the air, and tell u something about my today's post!
Going short and simple, I am sick of using Bluestack as my PC emulator, as

We all wants to use all of our Mobile stuff, on our PC. But, for this, we gon need a software that converts all our JAR and APK files into PC compatible version. This is where the Andriod Emulator comes into action. 😄

So, What are the choices we have ? 😉

1. BlueStack
3. Andy
4. KOPlayer


Personally, I used BlueStack for quite some time. It is good in its own way, gives you a good environment to manage your apps and simple interface.
BlueStack Home Screen

But, when it comes to consuming your computer resources it just way ahead of all the applications that are running on your system, except those High Definition Games.

The worst part is the advertise that always makes your Bluestack hang in blue and forcing you to Install the recommended app or donate 2$. It just destroys all the fun of using our laptop as Mobile and trying to get something from our free time.

Blog Top Sites

Share Our Badge

 Computer Stuffs

Be Updated Its Free.

Subscribe via Email

Visitors Everyday

Website Security Test