Concepts > Cloud Native Applications
Cloud native applications
DISTILLER aims to help development teams in building ressources-efficient Cloud Native Applications (CNA). In this post, we will detail this notion of cloud-native application.
What is “the cloud”
One of the most remarkable phenomena in information technologies that took place over the last few years is cloud computing. Its use is increasingly so wide spread that cloud computing is claimed to be the 5th utility, joining electricity, gas, telephony and water1. The National Institute of Technologies defines cloud computing as follows2:
Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g, networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.
Different cloud models
Cloud computing providers can offer services at different layers of the resource stack. Those services are often categorized as follow:
- Infrastructure as a Service (IaaS) - It offers end users direct access to processing, storage, and other computing resources and allows them to configure those resources and run operating systems and software on them as they see fit. Examples of IaaS include Amazon Elastic Compute Cloud (EC2), Rackspace, and IBM Computing on Demand.
- Platform as a Service (PaaS) - It offers an operating system as well as suites of programming languages and software development tools that customers can use to develop their own applications. Prominent examples include Microsoft Windows Azure and Google App Engine. PaaS gives end users control over application design, but does not give them control over the physical infrastructure
- Software as a Service (SaaS) - It offers finished applications that end users can access through a thin client (typically, but not necessarily, a web browser). Prominent examples of SaaS include Gmail, Google Docs, and Salesforce.com. The end user does not exercise any control over the design of the application (aside from some minor customization and configuration options), servers, networking, or storage infrastructure
New cloud service models have recently emerged:
- Container as a Service (CaaS) - Its main feature is the utilization of container-based virtualization and the possibility to delegate container management. In comparison to FaaS, CaaS adds an additional layer in the form of a container that is deployed onto the cloud platform and when triggered, container instances are provisioned and de-provisioned on the fly depending on the current demands. Container wrapping adds additional complexity, but it also gives more capabilities for configuring runtime environments and executing applications. AWS Fargate, Google Cloud Run, and Azure Container Instances are the main examples of such elastic containers.
- Function as a Service (FaaS) - This model allows developers to write single purpose functions in various programming languages, which are then deployed onto cloud platforms and can be triggered by events to perform a specified action, as in an event-based architecture. FaaS is often referred to as serverless because of its simplicity and elasticity. The most popular FaaS implementations are AWS Lambda, Google Cloud Functions, Azure Functions, and IBM Cloud Functions. All of them can execute binary code, which makes them a viable choice for general-purpose computing tasks that form a scientific workflow, an important paradigm for e-science applications.
From “cloud” to “cloud-native” applications
The rise of the cloud ecosystem and its different offering has deeply modified the way we conceive and deploy web-based applications. Nowadays, software specificaly tailored to leverage the cloud ecosytem are called Cloud-native applications:
A cloud-native application (CNA) is a distributed, elastic and horizontal scalable system composed of (micro)services which isolates state in a minimum of stateful components. The application and each self-contained deployment unit of that application is designed according to cloud-focused design patterns and operated on a self-service elastic platform.
The distinction between native and non-native cloud application is not only its deployment environment. A CNA core design and management is specific to the cloud.
The Twelve-factor application design
Early cloud pioneer Heroku developed a set of rules for building applications that offer maximum portability between execution environments, are suitable for deployment on modern cloud platform, and can scale up without major modifications to tooling, architecture, or development techniques. They are grouped into broad categories that correlate to the stages of application development, deployment and management:
Category | 12 factors approach |
---|---|
Deployment and configuration | Strict separation of code and configuration, explicit dependency declaration, tight development iterations and parity between environments |
Runtime | Applications are run as independent, lightweight, and stateless processes with quick startup and shutdown |
Management and visibility | Execute auxiliary tasks in one-off processes and view application output via collated log-stream |
Architecture
CNA often favor microservices-based architecture. Each microservice aims to be :
- Small: developping small services, focused on one task allows each services to become indepently scalable. To put it in another way, microservices should be aligned with a bounded context.
- Autonomous: Having independently deployable and loosely-coupled services allows fined grained management. Each service can be updated regardless of the others.
Asynchronous communication
The different services making a CNA often communication asynchronously, through well-defined API. This can lead to developp an event-driven architecture. This communication architecture is a style of distributed asynchronous architecture pattern that enable high decoupling between a set of services. This architecture is made up of a set of services that emit, receive and process events in an asynchronous manner.
State management
State management is a key concept in cloud native application development. A stateless application do not store informations between transactions. With stateful application, on the contrary, informations are store as transactions are processed. Current transactions will have an impact on future ones. This distinction became important with the rise of containers, initially made to be stateless.
Stateless applications and processes can be started, replicated and shutdown easily. On the contrary, stateful applications need a more sophisticated replication strategy to ensure consistency in data.
Flexible deployment
CNA leverage flexible deployment, often made though containers.