There are plenty of options available for running your web application in the cloud, but in order to make the most of the cloud infrastructure and to avoid spending money needlessly there are some steps that should be followed.

Thinking about working in the cloud requires a somewhat different mindset, the charging model is not the same, especially if you are used to hosting your own servers and as such you need to think about your application in a new way. You should aim to ensure your code is as efficient as possible, as inefficiencies will cost real money in the cloud.

Below are five considerations for any application that will be running in the cloud, regardless of the technology or provider:

  1. Use aggressive caching.  Cache static resources and data wherever possible.  You’ll likely be paying for bandwidth, so the less data you have to transfer, the better.
  2. Consider using a content delivery network (CDN) for resources wherever possible.  A CDN will allow you to save bandwidth and will typically result in a better user experience for your visitors, as your web application will load quicker for them.  A CDN is a great way to add a little resilience to your web application.
  3. Do as little as possible.  There is no need to load resources until they are actually required by the user and in a cloud environment you simply will be spending money needlessly. Approach each piece of functionality with lazy loading in mind.
  4. Ensure the application has minimal code dependencies.  Loosely coupled code will make the transition to the cloud infrastructure a much smoother journey.  The application will be more resilient and ready to handle multiple instances, which is essential in a cloud environment.  Server affinity has the potential to negate some of the most powerful benefits offered by cloud infrastructure.
  5. Application scaling is one of the biggest benefits of cloud infrastructure, but it requires your application to be built in such a way as to be able to take advantage of it.  In order to ensure your application can take full advantage of the benefits offered by moving to the cloud you will need to minimise the data stored on the file system.  Store persistent information in the database wherever possible.

Author: Mark Pynen