Thanks to the proliferation of cloud computing providers, like Amazon, Microsoft and Google, cloud-native is a concept that has become embedded into modern app development.
In a nutshell, a cloud-native application is one that is built -- well, for the cloud. I know, I used the word in the definition, but it really is as simple as that. Cloud-native applications are designed and engineered with cloud-based infrastructure in mind. Rather than building around in-house servers, databases, connections and the like, cloud-native application development relies on services that abstract away the hardware and the maintenance -- and, in some cases, the OS itself -- so developers can focus on what actually matters: the product.
These abstractions, while great for keeping teams and infrastructure manageable, also offer significant cost reductions over standard bare-metal and virtualized solutions: Less overhead means less risk, fewer resources and fewer people. But cloud-native application development brings with it a host of different challenges -- the most common of which is tying all of that lightweight infrastructure together.
But first, an API
In traditional application development, products are built around the understanding that the code has direct access to the resources it needs. This leads to a monolithic, opinionated code base that can be difficult to decouple. While the cloud is more than up to the task of running monolithic applications like this, it can make it difficult to reap the benefits of this streamlined, scalable and distributed infrastructure.
This is where API-first development can affect big change.
For the unfamiliar, API-first development is the process of designing, documenting and building an application's API before anything else. This means that, before breaking ground on the mobile application, website, Alexa skill or internet of things device, the API must first exist. The advantage to API-first development is that it isolates and unifies the business logic away from the clients, while also establishing a single source of truth for how the product works.
I'm a big fan.
But building the API before anything else can feel like an unacceptable constraint. After all, it means that the other facets of a product can only be built to spec until the API is finished, right? Fortunately, thanks to API documentation standards, like API Blueprint, it is possible to spin up a mock API server that matches the documentation perfectly, allowing you to build and test API integrations against an actual service before the API itself is even done.
One of the biggest advantages to API-first development isn't that it encourages don't repeat yourself development or provides a reliable interface for dealing with business logic. It's that it is a reversible decision. API-first doesn't make sense every time, and if you find yourself in that situation, you can always ditch it without losing progress or productivity. On the flip side, if you build an application without planning the API out first, you may find that you've coded yourself into a hole of technical debt that will take months to crawl out of.
Make it serverless
At face value, API-first development and cloud-native application development aren't mutually exclusive. You can build a cloud-native application without an API, and you can build an API-first application without the cloud. Where these two concepts harmonize perfectly together is in serverless environments.
Serverless environments, as the name confusingly misleads one to believe, are not actually "no server" environments; rather, they're environments where you don't have to deal with the server. What this means is that, instead of developing an application or an API to run as a service on a server, you are instead abstracting your application down into individual functions that run on a designated runtime. At the time of writing, this is one of the highest levels of abstraction available within application development.
By building a serverless API, rather than a traditional representational state transfer API, in an API-first development strategy, you take full advantage of the resources made available by any cloud provider. When you take an API and turn each individual method into what is, effectively, its own micro-microservice, the end result is a widely distributed, infinitely scalable and highly reliable application back end that can handle anything you throw at it.
Developing an application should be about figuring out the what, where and why, not the how. Cloud-native application development allows you to do just that by taking care of the how with as little overhead as possible, while API-first development gives you the tools to answer the where and the why. This is the true meaning of API-first, cloud-native application development.