What are Cloud-native apps?
As the name suggests there are two things here: Cloud and the native apps. First of all Cloud, Cloud is a concept/technology(Cloud computing) where all storages, memory, networking, and databases are available on the internet or virtually. Hold on, Cloud computing and cloud-native apps are not the same. Now, native apps run on a particular device/OS, you might have heard of React Native, so you can relate. So, cloud-native apps are run on top of the cloud (which is obvious). It's built on 4 pillars: DevOps, Cloud Native Open Standards, Containers and Orchestrators, and Microservices Architecture. So, what's the difference between Cloud computing and cloud-native apps? Cloud computing is a way to host your application in the cloud (via different cloud providers like AWS, GCP, Azure, Civo, Linode, etc.) and cloud-native apps are other because it's not the way, these are the applications that are specifically designed to run efficiently on top of the cloud. So, there is a seeming difference between those. Cloud is a broader thing. But on the other side, there is something Open Application Model which focuses on application rather than scheduling and orchestration.
What's OAM?
Open Application Model (OAM) is a specification for defining cloud-native applications in a vendor-neutral way. It is an open-source project that was initiated by Microsoft and is now managed by the Open Web Foundation.
Kubernetes was never going to be the endgame for application deployment, moreover, Kubernetes does not allow you to deploy all your apps, other factors such as storage, scalability, etc need to be taken care of too.
OAM provides designers, developers, and operators with a common way to describe the application using a set of Kubernetes-native API objects. These API objects allow you to describe the app's intent and deployment without being tied to the specifics of the underlying infrastructure or platform. This makes building, deploying, and managing complex applications easier across different environments.
How does the magic happen?
Open Application Model (OAM) is designed to simplify application development by providing a familiar and vendor-neutral language for developers, operators, and infrastructure providers to describe, deploy, and manage cloud-native applications. Here are a few ways OAM simplifies application development:
Separation of concerns: OAM separates the concerns of application design and management, allowing developers to focus on building the application more efficiently while operators focus on managing the infrastructure.
Standardized application components: OAM provides a set of standardized components that can be used to build cloud-native applications, which reduces the complexity and makes it easier to develop, deploy, and manage applications.
Cloud-agnostic: OAM is cloud-agnostic, which means applications built with OAM can run on any cloud without changing the application code.
Built-in reconfigurability: OAM enables the development of configurable applications, which means you can define the application's parameters and dependencies separately from the application logic. This makes it easier to make changes without modifying the application code.
Reusability: With OAM, developers can create and reuse standardized components across different applications and projects, which reduces duplication of effort and speeds up development.
A use case
In the following use case, we will deploy an application using the FastAPI web framework (Backend service) to the Napptive platform from Codespaces.
Here are the key files and folders that make it happen:
- webapp/: The HTTP API code, built with the FastAPI framework.
- deployments/: the OAM definition (YAML files)
- .devcontainer/Dockerfile.prod: Dockerfile to create the application image in the container
-.devcontainer/devcontainer.json, A configuration file used by Codespaces to configure the dev container features.
The OAM definition to deploy our application to Napptive has the following files
deployments/
├───fastapi.app.yml # Main file for OAM application definition
└───fastapi.metadata.yml # Metadata file that defines what the application is so that it can be searched in the catalog
└───README.md # The content that will be shown when browsing the catalog to describe what the application does and how to use it
In the following video, we show how we can deploy an application to Napptive using Codespaces
Conclusion
OAM is still a relatively new and evolving specification, but it has the potential to simplify the development, deployment, and management of complex cloud-native applications across different platforms and clouds.
In summary, OAM simplifies application development by providing a standardized way to describe, deploy, and manage cloud-native applications, allowing developers to focus on building the application while operators manage the infrastructure, ensuring that the application runs efficiently and is easily scalable.