Cloud Native - A Beginner’s Guide
What is Cloud Native?
If you want to be updated in the technology industry and if you are the type of person who attends tech conferences, you certainly have heard about Cloud Native applications/technologies.
Cloud native is a lot more than just signing up with a cloud provider and using it to run your existing applications. Cloud native affects the design, implementation, deployment, and operation of your application.
The Cloud Native Computing Foundation, an organization that aims to create and drive the adoption of the cloud-native programming paradigm, defines cloud native as:
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.
Containers
The basic idea of containers is to package your software with everything you need to execute it into one executable package, e.g., a Java VM, an application server, and the application itself. You then run this container in a virtualized environment and isolate the contained application from its environment.
The main benefit of this approach is that the application becomes independent of the environment. An added benefit is that the container is highly portable. You can easily run the same container on your development, test or production system. And if your application design supports horizontal scaling, you can start or stop multiple instances of a container to add or remove instances of your application based on the current user demand.
Orchestration
Deploying your application with all dependencies into a container is just the first step. It solves the deployment problems you had previously, but if you want to benefit from a cloud platform fully, you’ll experience new challenges.
Starting additional nodes or shutting down running application nodes based on the current load of your system won’t be easy. You’ll need to:
- Monitor your system
- Trigger the startup or shutdown of a container
- Make sure that all required configuration parameters are in place
- Balance the load between the active application instances
- Share authentication secrets between your containers
Doing all of that manually requires a lot of effort. Additionally, it is too slow to react to unexpected changes in system load. You need to have the right tools in place that automatically do all of this for you. Different orchestration solutions are built to automate reactions to unexpected changes with popular options including Docker Swarm, Kubernetes, ECS, AKS and GKE etc.
Microservices
Now that we have all the infrastructure and management in place, it’s time to talk about the changes that cloud native introduces to the architecture of your system. Cloud-native applications are built as a system of microservices. I’m sure you’ve heard about that architectural approach already, and I’ve also written a series of posts about it here on this blog.
The general idea of this architectural style is to implement a system of multiple, relatively small applications. These are called microservices and work together to provide the overall functionality of your system. Each microservice realizes exactly one functionality, has a well-defined boundary and API and gets developed and operated by a relatively small team.
This approach provides several benefits:
- Scalability
- Availability
- Security
- Fault tolerance
- Portability
Cloud native infrastructure
To take advantage and inherit the cloud native features and capabilities is not only about defining a new way of developing and architecting cloud applications, it’s about creating and implementing an environment and infrastructure to deploy and run cloud native applications. We will not have much gain in developing cloud applications and running a legacy infrastructure, that is why cloud native infrastructure is important in the cloud native world.
Nowadays, cloud native infrastructure provides lots of resources that allow packaging and distribution of cloud native applications (containerization like Docker), deployment and management/orchestration (Kubernetes), communication (Consul), monitoring (Prometheus), logging (Fluentd)etc. For each type of resource you will find more than one option. Choose which use is up to you. The Cloud Native Computing Foundation is the entity that manages all those cloud native infrastructure components. I advise you to take a look at their website to have more information about it.
Conclusion
To finish this article, it is important to note that although the best way to develop cloud native applications is by implementinga microservices architecture, it is still possible to use legacy architecture like monolithic to develop cloud applications and deploy them in a cloud native infrastructure, but it will be less reliable.