I have heard it said many times that the cloud can solve all of our performance issues. There are two reasons why this claim is not necessarily true:
- A misunderstanding of the difference between performance and scalability.
- Performance remains application-dependent.
Performance versus scalability
The terms performance and scalability are sometimes used interchangeably, but in actuality they have very distinct differences. The important distinction between the terms is that performance is a measure of a data point, such as the response time of a request, the amount of CPU or memory that a request needs, etc. Scalability, on the other hand, measures your application’s ability to maintain its performance as load increases. In other words, if you can service a single request in 500ms, can you service 1000 requests at 500ms each or does the response time degrade as your load increases?
The cloud is primarily about scalability, not performance. It is true that you can use a very powerful virtual machine in the cloud, which may help performance, but the big deal with the cloud is that you can quickly and elastically scale out your environment to meet your user demand. The idea that deploying an existing application to the cloud will make it perform faster is simply not true. As a matter of fact, your performance may be better in your own data center where you control all aspects of the hardware on which your application is running.
My years of performance tuning and troubleshooting have taught me that we’re always at odds trying to balance performance and scalability. For example, a monolithic web application that handles a request from start-to-finish, has embedded database code, and a data model that is denormalized and maintained all in a single schema will perform better than a web application that is broken into a set of microservices with a decoupled data model. The reason is that the microservices approach may require multiple network calls from the web application to retrieve data that could be more quickly retrieved by a single query. But which one is more scalable? It will be easier to scale out a microservices application and multiple databases than a single application with a single database, but it does so by increasing deployment complexity and at the expense of performance.
But, as a cloud architect I strongly favor scalability over performance. If you can shave 20ms off an algorithm, it does not impress the cloud architect side of my brain as much as being able to scale an application to support 10 million users.
Nothing can save a poorly written application
The other reason why this claim may not necessarily be true is because of the nature of the application itself. A well written application will perform well irrespective of where it is deployed and, similarly, a poorly written application will perform poorly irrespective of where it is deployed. From a cynical perspective: asking the cloud to improve the performance of a poorly written application is really asking a lot of the cloud.
The best strategy, of course, is to design an application with both performance and scalability in mind (favoring scalability over performance), but if your application is performing poorly, then moving it to the cloud might be the worst decision you can make. The reason is that a poorly performing application will require more resources than a well performing application, which means that your cloud costs will be higher than they need to be. Furthermore, you have probably already tuned your on-premises hardware to cover up shortcomings in your application and, by moving to the cloud, you lose this hardware-level tuning capability.
If you have a poor performing application and are considering moving it to the cloud then I recommend biting the bullet and refactoring or rebuilding it. Only by getting your application “cloud ready” will you be able to maximize your application performance while minimizing your cloud cost.
Many people believe that the cloud can solve all of their application performance issues, but the reality is that while the cloud can dramatically improve application scalability, it is not designed to improve application performance. Furthermore, your application needs to be written in such a way that it can best exploit the value of the cloud, otherwise you are going to end up with an unexpectedly high cloud bill!