In general, applications are built monolithic in the beginning. Monolithic applications are well and good when there are a smaller number of users and the traffic is very low. But, when the traffic increases, the system gets overloaded and slows down which results in poor performance, latency and system crashes also.
According to the AKF Scale cube model, in order to achieve scalability, the application needs to be scaled in 3 dimensions. Namely X, Y and Z. This approach can be used to scale an application infinitely.
X Axis Scaling – Replicating and Cloning
It is an application of replicating and cloning. It comprises of running a number of applications doing the same task or cloned databases storing the same data. These copies are run behind a load balancer. The load balancer equally distributes the load amongst all the clone systems. It is a very common and easy to understand approach for scaling an application.
Advantages of X Axis Scaling –
- It is intellectually very easy
- It handles the scaling of transactions decently
- The implementation is very fast
Disadvantages of X Axis Scaling –
- The set-up cost is expensive as multiple database clones are used
- It also doesn’t support caching efficiently. Cache requires more memory.
- It doesn’t support organizational scaling
- It doesn’t support application complexity and increasing development
Y Axis Scaling – Splitting Different Things
It splits the application into a number of separate services. A service is only responsible for only one function. It can also further be fine grained and loosely coupled when these services are further distributed apart. Microservices architecture is majorly an application of Y-Scaling. There are many approaches to decompose the application. Broadly, there are two: verb based (one service responsible to implement one use case) and noun based (one service responsible to handle all operations and which pertain to a single entity). A good approach is to use a mix of both.
Advantages of Y Axis Scaling –
- It permits organizational scaling
- Fault isolation, testing and debugging is easy
- The cache hit rate increases significantly
- Transactions scale well
Disadvantages of Y Axis Scaling –
- It takes a lot of analysis and intellect to find the perfect decomposition that suits the application
- It takes time to implement
Z Axis Scaling – Splitting Similar Things
It is quite similar to X- Scaling and hence confused a lot. Here, each replica runs the same copy of code. But each replica is not doing exactly the same thing. The workload is distributed amongst them. One replica only works on a subset of data. A part of the application routes each request to the appropriate server. It can be done on a geographical basis to increase the response speed. It is also done on the basis of customer. For example, a privilege customer of an application will be routed to a faster set of servers. Just like there are a lot of download servers which limit download speed for non-paying customers.
Advantages of Z Scaling –
- It is intellectually easy to implement It reduces the amount of memory usage and traffic being handled by a server
- It also increases the cache hit very significantly
- It improves transactional scaling as requests are distributed
- It also improves fault isolation as a server failure doesn’t make all the parts of data inaccessible
Disadvantages of Z Scaling –
- It takes time to implement
- It doesn’t talk about organizational scaling
- It requires automation to reduce hops