Introduction

Before we start with defining cloud native applications first we should know why we are discussing this topic and why at all this is important not just in today’s world.

Let’s say I run a company called BinaryBuggs which is a huge conglomerate similar to Amazon, Alphapet etc. which i am not sure will ever happen but at the end of the day irrespective of my line of business I will care about these points

What do companies care about

  1. Respond to customer trends : Deliver on new trends in the market so that I am not left out of competition
  2. Disruption in systems : I will always want a system which is stable and not prone to disruption so that there are less problems that can harm ability to conduct operations
  3. Develop and maintain satisfactory relationships : I will always want to maintain good relation with customers and constantly deliver what they are looking for
  4. Control costs: And finally costs

So to achieve all the points mentioned above companies prefer to have multiple applications to get an idea on these expects. So from a customer point of view below are their expectation from the software/ application

  1. Valued by customers : The software should deliver results which can be used by customers
  2. Constantly and easily changed : it should be easily changed as per business requirement
  3. Available at all times : Should be available at all times or minimum downtime
  4. Scale able to meet demand : It should easily Scale for example let’s say the number of users using the application increases or decreases the application should take care of resources
  5. Secure : It should be secure because the applications can be used on multiple systems for example laptop, mobile phones or tablets etc.
  6. Maintainable at scale : It should be easy to maintain because with large organizations systems can be very complex and hard to maintain

Before we go to cloud native we will also see some of the disadvantages with normal on premise systems

  1. Datacenter and the applications have to be tightly coupled with each other because infrastructure is not scale able and lot of things has to be planned in advanced
  2. Rely heavily on manual provisioning for infrastructure and developer can run application specific to the datacenter.
  3. Applications cannot take advantage of cloud infrastructure and services i.e. they do not have flexibility on scalability etc.
  4. There will be down-time when we have to upgrade the system

So why cloud native ?

Applications developed for cloud has added advantages i.e. they take advantage of innovations in cloud computing and they are easy to  integrate and scale irrespective cloud architectures. So basically your apps are platform independent easy to scale, manage and it’s available almost all the time. Apart from that they also take advantage of infrastructure provided by Hyper-scalers i.e. Amazon AWS, GCP, Azure etc.

Benefits

  1. Cloud native apps are resilient, manageable
  2. can use innovation available in the cloud
  3. Scalable and easy to integrate

Below are some of the most commonly used definitions of cloud native

Cloud native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach.

These techniques enable loosely coupled systems that are resilient, manageable, and observable. Combined with robust automation, they allow engineers to make high-impact changes frequently and predictably with minimal toil.

The Cloud Native Computing Foundation seeks to drive adoption of this paradigm by fostering and sustaining an ecosystem of open source, vendor-neutral projects. We democratize state-of-the-art patterns to make these innovations accessible for everyone.

Cloud Native Applications — The Why, The What & The How. | by Chirag Jog |  Velotio Perspectives | Medium

So what are Traits of Cloud Native application

  1. Customer centric
  2. Learning culture : continuous feedback to figure out most important things
  3. Agile development : Continuous delivery of new features and security patches
  4. Focus on product not projects : Focus is on product rather than project which is usually delivered when the development is complete ( Waterfall model )
  5. Automation on entire delivery process : We try to automate processes so that delivery is continuous and we eliminate waste processes i.e. processes which can be automated or reduced
  6. Open source software : Use of open source software so that there is flexibility to use multiple features

Positives of cloud native

  1. More speed : Faster lead time regular deployments
  2. More scale : Low API response time, easily scale in and out, linear dev delivery
  3. More stability: Drop in impact minutes, fast , less failure rate
  4. More secure : Fully patched software, small amount of unplanned work

Application Architecture patterns for an cloud native application

1. 12-Factor application

Given by heroku which basically tells how friendly an app is to run on an cloud environment weather it is saas paas etc. and if your application is 12-factor complaint it gives you confidence that it will run properly in an cloud environment. Below are the 12 factors , this is explained nicely in the below link or you can also visit https://12factor.net/ for more information

I. Codebase
One codebase tracked in revision control, many deploys
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and graceful shutdown
X. Dev/prod parity
Keep development, staging, and production as similar as possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as one-off processes

2. Microservices Architecture patterns

Domain driven designs : Creating more discrete units for specific purposes

Loosely couples components : different components are less dependent on each other so that even in case of failure it can be easily replaces

Continuous delivery : must be updated regularly

Surgical scaling : Independently scale services for example we can scale one particular unit if the load is high

Contract driven tests : test system in reliable fashion as there are more independent units

Organized around teams : teams arranged around microservices and because of that delivery can be continuous

we need supporting Infrastructure for microservices so that it can be successfully used

  1. Service discovery : lookup services at runtime
  2. Circuit breaker : to address cross dependency for example if multiple services are connected with each other and if one service go down others will also get impacted because they are connected with each other so the idea is if one breaks down we break the circuit so other services are not impacted
  3. Externalized configuration : Environment specific configuration in remote version store so that you make sure your application uses the same configuration value
  4. token based security
  5. messaging : routing and sequencing of operations
  6. API gateway

3. Modern Data Management

  1. Scalable on demand database per microservice : we need to have an automation centric on demand database so that it can address problems on scalability because traditional databases cannot be used in this situation, we look for multiple instances of the database
  2. Favor event sourcing and CQRS pattern : collect store and query the information CQRS : Command Query responsibility segregation and gives you an audit trail
  3. Intelligent Caching to improve resilience

Cloud Application Delivery patterns

  1. Version control is must
  2. Trunk based development : using master branch to fix broken builds
  3. Test driven development : building quality product
  4. Code check in at regular interval’s
  5. Test in production like environment

Packaging up software

components which come up together which make up the software like containers or builds

Continuous delivery is always about sending small changes but at regular intervals, the same binary should be used in each environment so that it works similar in different machines and different environments. some other points to keep in mind

  1. Multiple strategies for low impact deployments like blue green environment
  2. Smoke test and watch metrics to ensure healthy releases

Application Infrastructure patterns

API driven Infrastructure

  1. Immutable infrastructure : changes should be done in a new VM and the old one should be discarded
  2. Observable systems : service should not get interrupted
  3. API’s for interacting with infrastructure
  4. chaos engineering to fight fragility

Application team patterns

  1. DevOps style teams build and running services
  2. Platform operations for managing underlying systems
  3. site reliability engineering applies software engineering approach to operations

Technologies in Cloud Native

Things to think about here

  1. External config: How can be separate code from configuration some common solutions you could use is Azure key vault, hasicorp vault or spring cloud config
  2. Code-based microservices infrastructure like spring cloud, etc. and it depends on the programming language
  3. API gateways from public cloud providers
  4. Identity management technologies like Oauth, OpenID, JWT

Database Technologies

  1. self managed , OSS databases like PostgreSQL, MYSql, MongoDB etc
  2. Managed cloud databases from Amazon ( RDS etc ) , Microsoft ( SQL, cosmosDB) etc
  3. self managed or hosted application cache based on redis etc.

Cloud messaging technologies

  1. Brokers like RabbitMQ, ActiveMQ or NATS
  2. Event stream process like APache kafka, Wso2 stream processor : log based event based
  3. cloud based event stream services like Amazon SQS, Google pub/sub or Azure Event Hub

Application Delivery Technologies

Ways to Shipping code in production

  1. continuous integration : Github, Gitlab etc.
  2. Continuous Integration workflow tools like Jenkins, concourse, circle CI etc.

Packaging and Deployment Technologies

  1. Artifact technology : store the results of a builds like Jfrog, Artifactory, maven etc.
  2. Package formats like Linux or windows containers and package manager like helm
  3. Use of CI/ CD tools like concourse , Jenkins etc.
  4. Enable feature flags with services like LaunchDarkly and analyze post deploy metrics etc.

Infrastructure Automation Technologies

  1. Config management like chef, Ansible for managing servers
  2. Create infrastructure with Terraform etc.
  3. Build and manage system with BOSH like rolling updates
  4. Run container with kubernetes mesos etc
  5. Automate app runtime with PaaS or Faas etc.
  6. Micro services infrastructure with a service mesh

Team Technolgies

Function well as a team

  1. Chat tools like slack and ms teams
  2. Kanbon boards
  3. Shared access to logging and monitoring tools to pinpoint issues
  4. video conferencing tools