Looking Inside the Contemporary Application Architecture for the Cloud Age

Date:   Tuesday , January 26, 2016

Businesses today are increasingly moving away from fixed infrastructure and turning to the cloud when it comes to hosting their applications. The reasons behind this change are manifold. Cloud offers many benefits to enterprise users, but unlimited to more control over infrastructure, flexibility, speed and scalability. Cloud deployments come in various forms - public, private, and hybrid. There is an entire range of players offering advanced cloud computing services and frameworks. This includes Amazon Web Services, Microsoft Azure, Google App Engine, Docker open platform, Open Stack software, Heroku platform, Deis open-source platform, Cloud Foundry industry-standard for cloud apps and, more recently, Mesos.

Alongside the advent of the cloud, we are also witnessing the rapid adoption of software development methods such as agile and continuous integration & continuous development (CI-CD). It is important to separate them from a development and operations (DevOps) perspective, which lays emphasis on closer collaboration between software developers and operations teams.

Let\'s take a scenario wherein a new e-Commerce web application needs to be implemented on the cloud. There are three key areas we need to be concerned about in this implementation - Infrastructure & application code, Integration & Deployment and Operations.

Infrastructure and Application Code
It is important to ensure the source code is separated into infrastructure and application code. The purpose of the infrastructure code is to set up an immutable (permanent) infrastructure on a chosen cloud provider. The infrastructure component of an e-Commerce application takes the shape of servers, storage, networks, databases, load balancers, security controls, as well as the content delivery network (CDN). This ensures that even where the organization switches from one cloud provider to another, the application is portable between the cloud providers. To make migration between cloud providers flexible, one can look at tools like Terraform or Mesos. Like application code, infrastructure code can also be tested using frameworks like Test Kitchen.

Moving to application design, 12 Factor App, a manifesto of sorts by Adam Wiggins, one of the founders of the Heroku cloud platform service for building apps, proves very handy. Once the code is built in line with this guide, the e-Commerce application can be deployed almost effortlessly on any infrastructure created by the infrastructure code.

Integration and deployment
Once the infrastructure or application code is ready, developers can resort to continuous integration as an approach to building and testing the application. On completion of successful testing, the application can be deployed in an environment of choice using continuous delivery as the software engineering approach. The tools of choice must have the capability to deploy as many cloud providers or frameworks as possible. The e-Commerce app is then deployed. But wait, it\'s not over yet.

Post the deployment, the operations teams require monitoring and alerting. There are four areas that we need to keep in mind at this stage, namely - Logging, Application Performance, Alerting and Operations.

Customers go through a typical journey in an e-Commerce website like browsing, adding products to basket, making payments and many more. As a retailer, it is important to ensure that the customer experience on the website is smooth. One must ensure that the key business events are logged along with the appropriate severity level. These logs should be shipped to a centralized log management tool which employs tools like correlation analysis to transform these into useful insights. This helps a retailer get clear view of the overall activity happening in the e-Commerce website and identify hotspots of customer activities or problem areas.

Application performance
Even if the application is deployed on an \'elastic\' and \'stretchable\' infrastructure, it is imperative for the operations teams to keep an eye on usage of resources like CPU, memory, storage, and networks. These resources are typically tracked using an application performance management tool. Some of these tools also help cull additional intelligence from data by applying the science of machine learning and analytics.

Often, retailers will have key performance indicators (KPIs) to manage operations. The KPIs could include metrics like number of customer visiting the site, rate of orders per day, marketing campaigns that prove successful and others. Business and operations teams can be notified based on these KPIs and depending on the use case, the nature of the alert could range from SMS, email to chat.

The unenviable task of keeping the lights on in respect of any application falls upon operations teams. While a significant number of tasks related to deployment and support can be automated, some manual intervention is obviously required. These manual tasks may include things like - performing health check on the application, creating operational, management reports, and troubleshooting issues. A recent trend has been to automate some of these tasks using ChatOps or group chat rooms. Tools are now readily available for codifying operational tasks and tribal knowledge that is resident within a team.

I hope the above how-to note will help application developers to build contemporary applications, which are also scalable and portable, very quickly.