You’ve built a fantastic application, and now you want to make it available to people. How do you deploy and host it? Lately, deploying “to the cloud” has become an increasingly common approach for managing applications. There are several reasons for this, notably the cost saving potential of virtual infrastructure.
Deploying an application to the cloud can be surprisingly similar to deploying a service to physical hardware. Most cloud vendors provide virtual hardware and command line interfaces that act like a real machine. However, deploying services to the cloud using the traditional approaches will miss out on the immense cost and performance benefits that cloud services can provide.
Virtual hardware enables the opportunity for automation at a scale that can’t be achieved with physical hardware. “Cloud-native” is phrase for describing a service architected to take advantage of the unique scalability and automation capabilities of a cloud environment.
Here are three tips to help ensure your app is well designed for the cloud:
1. Use a Container
Ideally, you want to be able to install and run your application from any operating system. If you know the type and version of operating system, you also know what utilities and dependencies might exist.A container can solve this problem. Containers package an application on a server to reduce costs and make better use of your infrastructure resources. Using a container orchestration tool allows you to scale your microservices. A container runs within the context of the host machine’s operating system but behaves exactly like the operating system of the container.We recommend starting with a Docker image of the application. Next, run the container in a lower environment to run integration tests. If needed, install an orchestrator to apply health checks to establish a self-healing platform. Finally, deploy the container to production and cut-over the application to the new environment.By installing and running your application within a container, you can know ahead of time exactly what software and utilities will be available or possibly available to your application.
2. Automate Your Provisioning Process
Now, you have a known operating system. The next steps to installing your application on a host machine is downloading and installing dependencies. Maybe your application needs a database, special utilities, or packages to support the front end. If there are only a handful of these dependencies, it may not be too much effort to manually download and install them onto the container. But what if there are dozens? What happens if you get through the provisioning process only to realize you chose the wrong version of a dependency, and nothing works?Regardless of the number of tools to install, a manual process is error-prone and time consuming, which makes it more risky and costly.To reduce this risk, you could automate the provision process. There are several tools, which can automate the provision process for various technology stacks, and many of them work well with containers (examples of provisioning software include: Ansible, Chef, Azure, Puppet, and more).An automated provisioning process self-monitors and automatically reports the current state. The exact packages and versions you need are documented, automated, and gathered in your provisioning code. It usually takes a single command to kick off this process. Once completed, you have a container perfectly configured with everything your application needs.
3. Write Tests
Often, teams want to adopt DevOps practices such as CI pipelines and containers without first implementing automated test coverage. Tests are the foundation for any automation – without them, other efforts will fail.Whether you’re writing a portable, self-contained, or an enterprise-level application, you should have tests. There should be unit tests ensuring individual pieces of code function properly, integration tests validating the various pieces of your application work together properly, and end-to-end tests confirming the entire application is functioning as expected.Not only are these tests good for ongoing development, they are perfect for ensuring your portable application has set up properly. An automated end-to-end test could ensure your application was installed, provisioned, and configured correctly. Most automated provisioning tools are easily configured to run and report on tests that are part of your application.
What’s Next?
Let’s look at the differences between a traditional application and the same application that’s been updated to be portable.
With a traditional application, you must first copy your application to the host machine and download all the individual dependencies. Extra time may be required to determine the correct versions of these dependencies or finding workarounds if the host operating system doesn’t provide the necessary dependencies. Hopefully, the dependencies are exactly the same as what you used for development and testing. Once each of the previous steps is successful, you must manually test your application to ensure it is working as intended.
After updating the application to be portable, things are different. Automations not only copy the code to the host machine, but it can create the virtual host machine itself. Automated tests run to ensure everything is working as expected. This workflow enables concepts like idempotency, autoscaling, and blue-green deployments, which create a framework for cloud services that can maximize scalability, availability, and cost efficiency.
Are you a Product Manager that wants to migrate to the cloud? Learn more in our post, “5 Things Product Managers Need to Think About When Migrating to the Cloud” or download the “Cloud Migration Checklist” to see what your firm should be prioritizing during your migration.