Why your application will crash in 2018 and how to prevent it
Are you worried about your web or mobile application crashing in the near future? If you are careful and plan accordingly you can avoid a horrible crash and ensure your application is engineered to scale. Read to learn the scalability top trends for 2018.
So what is scalability? It is the ability for your application to properly handle more and more users as it grows. For example, if your application starts off with 1,000 users and everything runs fast and smoothly, but when you add 10,000 users, your app gets sluggish and slow, your app did not scale correctly.
There are various ways to make an application scale. Some are considered engineered into the product or its infrastructure, and others will be band-aids or quick fixes, not ideal but get the job (partially) done when in times of need.
Web & Mobile Application Architecture
Trying to squeeze every single function into a gigantic application is not only bad, it is also out of style. Used to be called monolithic applications, they tend to become too big to manage and will shortly show signs of performance issues, difficult bugs and a lot of clutter. Instead, we opt now for microservices where smaller functions of an app work together but behave completely independent as miniature applications.
Using microservices has tons of advantages because it is easy to scale up only the functions that need to be scaled and not the entire system. Furthermore, it allows parts of the app to be built in one language or another that is more suitable for that specific function (see next section for more on this)
Web & Mobile Application Programming Languages
Choosing the right tool for the job is essential as it is choosing the right language, framework and services adequate for your application. There is no silver bullet or formula, so you must rely on the experience of your development team. For instance, if your application needs to perform heavy data manipulation operations you could pick a suitable language like Python. Sure, PHP can do this, but it is not the optimal pick.
If your development team only works on one language, get another team (I am not kidding). In this day and age, a developer that can’t handle a couple of the main current technologies is as useful as a rotary phone. Sure, you can dial, but you won’t get far. If your solo developer, is in-love with a single technology, invest in his education. You will do the world and your app a favour.
Get A Bigger Cloud! 🙂
If your app is built on microservices your app can live in multiple fragments around the cloud and then with little effort, scale them up. For each “layer” of an application there are specific solutions but typically they involve a load balancer and then a copy of one or many of the microservice that needs more love. A load balancer is like a hub where all requests are received and then routed to the most available micro service, so if one server is busy, the next request goes to a free server.
Sometimes just replicating the services is not easy or will require too much engineering, in this case you can opt for other solutions like just using faster, bigger servers. This will work to a certain degree but as a rule of thumb, if you are just increasing the size and speed too often, it will eventually cost you more than figuring a way to split the service apart.
For example, if your MySQL database is becoming the bottleneck, sure, you can double the memory and CPU’s and fine tune the settings but eventually, you will need to fragment the component and rely on replication and other strategies. By the way, if there are issues with a relational database, 80% (or 99%…) of the time, it has nothing to do with the memory, CPU or settings, and more to do with the overall data structure or the way it is being queried.
Be Weary of Overengineering
If your team will spend dozens of hours coming up with the perfect scalability architecture and setting up a perfect solution that will auto-scale with AI… your project will most likely cost 2x – 5x more than it should. It will be 2x – 5x later than expected and… it there will be a weakness making the stakeholders question why did all this happen.
Overengineering is probably as bad as not planning for scalability. Sure, your team should propose and implement certain strategies, but trying to do them all from the get-go with limited data on the real usage will just cause frustration and delays. Furthermore, the cost and complexity of maintaining a sophisticated infrastructure that has bee overengeered will break the bank if the project does not merit all that at the beginning.
There is no single rule for writing applications that can scale. Experience and knowledge will come into play. Be careful not to overdo it and look into microservices for your future projects.