In real world we do have a lot of data to handle on the server side . SO to distribute the data we can have 2 types of server configuration on node level
1)Horizontal scaling (But more machines) : When we distribute the bulk of data among multiple servers/nodes.This is horizontal scaling
Note : Because there are lot of nodes distributed to handle the request’s. So the request can fall on any node randomly.
a)In horizontal scaling , we need load balancer .
c)RPC (Remote process call): The communication between the nodes/servers are over network. so communication between the nodes are slow
d)Data consistency problem occurs. May be some node is fast while other is slow
e)scalability : As in horizontal scaling we can add n number of nodes so it is salable
2)Vertical Scaling (Buy bigger machine) : In this type of configuration we do have only single server. As the amount of data increases, we go increasing the hardware asset for the system.(RAM + hard disk + processor)
a)In Vertical scaling no load balancer required.
b)Single source of failure
c)IPC (Inter process call): Because in vertical scaling we have single machine so there is inter process communication . so it is fast
d)Data consistent : Because there is a single machine so we do have the data consistency there
e)Not salable : Hardware limit
Which is better ?
Both scaling types has their own benefits as well as drawbacks
1)Vertical scaling : In vertical scaling 2 things are good.
a)Inter process communication
2)Horizontal scaling : In horizontal scaling 2 things are good :
a)Resilient : It means if one system crashes the other is ready to be used
b)Scalable : As more and more request’s are coming we can add more and more nodes