Database Scaling

Piyush Gupta
2 min readJun 7, 2020

--

In these series of articles, we’ll be primarily discussing

How data can be distributed among different machines?

But the first question is Why is this even required?

  1. It’s possible that the number of requests or the amount of data stored on the machine becomes so much that one machine might not be enough for that.
  2. What if my machine goes down? If my application won’t be able to work then I’ll be needing another machine for sure.
  3. If my machine is in India but my users are from all over the world then there is going to be a high latency for the users far away from my machine.

Scaling

It’s of 2 types:-

  1. Vertical Scaling
  2. Horizontal scaling

Vertical Scaling

One approach for scaling to handle load can be to add multiple CPU’s, RAM, Disks such that they are controlled by a single OS. This is called Shared Memory Architecture. But the issue in this is that after a point adding resources eg doubling them doesn’t lead to doubling of the capability of handling load and often cost increases a lot.

Another approach can be to have separate systems like an individual set of CPU, RAM connected by an array of disks. This is often called as Shared Disk Architecture. But in this case, locks have to be introduced for Critical sections hence it doesn’t stand out to be that good for big scale.

Horizontal Scaling

Another way to approach this problem is to have multiple nodes. A node is an individual system having CPU, RAM, Disk. All the nodes are connected over the network. This is also called as Shared Nothing Architecture.

This is the architecture that will help us solve all problems that we saw earlier.

We’ll learn the techniques/steps we should follow for this architecture.

Here the second article in this series.(here)

--

--

Piyush Gupta

SDE 3 at Google | Ex-Microsoft | Ex Coding blocks, Google Code In mentor