According to Statista, there were 2,870,000 apps on Google Market Play alone as of the 3rd quarter of 2020. Mobile app development is a relatively new specialization that's seen exponential growth within less than two decades.
According to AndroidRank, 296,515 of the apps have at least 10 thousand downloads, and 43,896 of the apps have more than 1 million downloads as of the early days of 2021. That's a lot of loads to withstand.
Let's see what it takes to build a scalable web application that is ready for high loads, is fault tolerant of increases and decreases in queries, and can quickly regain its working capacity.
What is scalability?
Scalability is one of the key principles of web and app design, which suggests the initial conceptualization of systems and networks in a way that the final product’s capacity can be increased or decreased on-demand by adding more components without having to change the hierarchy of the core node. Such a system set up allows sustaining high load performance without experiencing downtime. The addition of supplemental components is mostly about adding hardware (servers, nodes, processors) to increase computational power. There is a distinction between horizontal and vertical scaling.It is not uncommon to mistake scalability with a high-performance application. While both suggest the usage of extra computational power elements, only the scalable design also implies a pre-determined purposeful architecture of the app that is engineered for such usage peaks and valleys initially. However, the high-performance application can be achieved by adding more computational capacity to any poorly-conceived network. It is reactive though (unlike proactive scaling), so it will cost more than the scalable architecture and is not sustainable in the long run.
Horizontal vs Vertical Scaling
When your servers cannot cope with the number of requests and responses coming in and out when more users start wanting your software product, you can scale the capacity in 2 ways:- By adding more machines = horizontal scaling
- By adding bigger machines = vertical scaling
Horizontal scaling:
Advantages: + resilient (if one element fails, the request is redirected to another one) + unlimited scaling (you can keep adding elements on demand) Disadvantages: - it needs a load balancing element because requests have to be directed to different machines. - slower performance (network calls need to be made to process requests) - data inconsistency (transactions flow among multiple elements)Vertical scaling:
Advantages: + no need for balancing elements (single element only, nothing to balance) + faster (inter process communication, data is processed inside one machine) + consistent (data doesn’t need to travel between elements) Disadvantages: - Single point of failure as there is no additional element to redirect a request for processing if the only element fails. - Limited capacity (how ever expanded, the hardware element has a maximum limit)Why do you need to think about designing a scalable app at first sight?
Some circumstances predetermine that you can build an app that is not scalable to start with:- You need to quickly test a business theory of demand and are happy to invest quickly into the development of a new scalable application only if the idea proves popular.
- Your time-to-market is limited and you need to show the result quickly for investor and public relations purposes.
- You are creating a niche product with limited demand and no peak usage is expected due to a small addressable market.
- Prevention is better than cure. Moreover, prevention is cheaper than cure in most cases, even though it seems like you are investing in something that can be avoided at this early stage. Scalable web app design offers that very prevention that is cheaper than a cure at the end of the day.
- Not many business people create an app to sell to 10-20K users. The majority of business plans have user acquisition in hundreds of thousands of users in the first year to pay for its bills in a year or two. Consequently, creating an app that is not scalable is a waste of time and resources. Moreover, if an app proves popular but cannot sustain a significant volume of requests, you are shooting yourself in the foot: you managed to conceive a popular business idea but failed to sustain it technically.
- Traffic growth causes reduced performance and multiplies system failures.
- eCommerce inventory management and expansion, as well as order processing, become cumbersome under conditions of increased queries from users.
- Risks associated with changing the code structure grow exponentially, jeopardizing the entire operability of the application.