Web APIs or application programming interfaces allow communication between the client and a remote resource (for example, an API server) over the Internet. APIs have been around for a while, and they have been most commonly used to facilitate easier integration between systems.
Until recently, the traditional code-first approach to software development led the field. However, as organizations were moving to the cloud and adopting cloud services, an API-first approach came to the forefront. It has since proven to be an effective way to add more clarity and flexibility to the development process, supporting a reactive event-driven programming model.
In this post, we will focus on the benefits of an API-first approach and how it works in real life.
What is an API-first development approach?
In 2020, chances are the application that a team develops is intended to work in the cloud as part of a large ecosystem of services. And in this scenario, API first means that programmers focus on developing their services in a reactive, agile way. However, if we talk about a monolithic platform, it is very unlikely that it treats APIs as its top-priority products. As a rule, only a few features are enabled by APIs there. They are more like extra capabilities that the platform possesses. Therefore, it is rarely if ever that the development of APIs takes priority over the infrastructure built upon them on monolithic systems.
Nevertheless, as we mentioned above, an app most often exists within an ecosystem of services. There are web, mobile, and other, more unusual forms of experience building. Throughout all these channels, users want to have an excellent connected experience. This is one of the drivers of API-first approach popularity – APIs enhance the experience for the end consumer.
An API-first approach and APIs, in general, are not so much about technology but more about the product strategy and philosophy. The main principle of an API-first approach claims that the design and development of an application programming interface (API) should come before the implementation. According to an API-first approach, it is not the code that you start with. The team starts with designing, planning, mocking, and testing an interface for their application. Before focusing on designing feature UI, the team builds a robust API for this feature.
API first means that an API is an application’s first interface. Instead of focusing on core functionality and writing code upfront, the team works on an API layer following agile software development principles. As a first step, the interface mockups of the different front-ends of the application are created and distributed among all the team members. This helps get a general overview of the underlying API of the app being built and eventually design service-oriented applications in an agile way.
An application programming interface is about how an app exposes its functionality. So, unless one or the other feature is covered by an API, it is not an actual part of the product. In fact, by designing an API first, the development team facilitates the discussion of the app functionality with stakeholders yet before the coding itself begins. This opens up an opportunity for early feedback gathering and removes constraints that could go against the team's vision for the app.
Benefits of an API-first approach
The idea of application development guided by an API-first approach in a modern business environment is becoming increasingly popular. It is primarily due to the focus on the rapid implementation of functionality that yields a visible business value. But also there are other positive aspects of this approach that are not so easy to detect and acknowledge without some expertise and understanding of what to give consideration. Let's look into the many benefits that the practice of API-first development has brought to the fore.
1. Parallel software development
One of the biggest advantages of API first for developers and project stakeholders is the possibility of parallel development. An API is the surface area that, once established, changes rarely and deliberately. So, beginning with designing APIs, you can be sure that this will result in a solid foundation for your product. Thus, the development team can already in early iterations focus on the IT infrastructure of the product. But do not be afraid – it doesn’t mean you will lose precious time building up this framework. APIs can be developed and tested simultaneously. Teammates can work in parallel, which means real-time collaboration and faster feedback cycles. As a result, APIs are quickly designed, implemented, and documented before the channels that will use them are set up.
Besides, with an API-first strategy, the consolidation of common functionality and resources for different application platforms at the service layer allows for parallel development of application front-ends for different devices (e.g. cell phones, tablets, PCs) even without the need to set up a back end.
2. Improved developer experience
When developing an API, it is essential to keep the developer experience a priority. DX perceives a developer as a consumer, an intermediary, or an end-user of a product (of an API). This renders developers a key element of the value delivery chain. They create APIs and leverage them for both the consumer's benefit and the business's benefit.
An API-first approach is about APIs being more like the product and less like the technology. Thus, it makes sense to have an API that is functional and easily usable by developers. The goal of an API is to create a rich ecosystem, where developers can effortlessly get some information and create applications on top of it. Designing API first helps internally structure the IT system and architecture developers use to build applications. So, by defining APIs first, you automatically prioritize developer experience, as API availability from the outset is a way to boost efficiency and speed of innovation.
3. The accelerated development process
APIs speed up the development process. From first sight, it may seem an API-first strategy causes delays in time to market: instead of going ahead and beginning coding, the team spends time on a blocking task of API development. However, it is not like that. This approach allows reusing existing software and infrastructural power, which makes for faster software deliveries in the future. Through the integration of existing components, processes can be improved to enable the acceleration of time to market.
Thus, an API-first approach allows businesses to optimize their total development time. Agility can be achieved even if the APIs don't cover all of the features of the system. Quickly generating an initial API for an application, one also speeds up the initial iterations in the development of the interface. Once the initial API has been defined, it is easier to extend and enhance it, adding new features. The key is to offer solutions for the most common use cases and create an intuitive interface for working with multiple data sources.
4. Reduced risks of failure
An unsustainable system that offers inconsistent customer experience usually faces a high risk of failure. This is no problem for teams developing APIs first. APIs are not only the way in which businesses express themselves, but they also enable organizations to grow rapidly and adapt to the changing user needs. It is the agility, inherent to an API-first strategy, that allows adapting quickly to changing requirements and including end-users more extensively in the development process.
Teams following an API-first approach usually have the product mindset. It means they realize that the product may evolve in the future, as well as that the full spectrum of use cases for their API may be not clear from the beginning. But they are ready to iterate their products in order to eventually give users what they require. Also, they are skilled enough and prepared to first create a consistent and self-descriptive API to rely on. Thus, developers can find themselves in a less vulnerable position. Instead, they have the advantage of flexibility allowing them to better understand customers’ behavior and go on refining the product with a substantially reduced risk of failure.
5. Optimized development costs
Usually, APIs themselves do not reduce costs. However, they support broader internal refactoring of value chains. And that is what actually helps reduce costs. Building an ecosystem of APIs as products and channels makes your code more extensible and reusable. Thus, when app development begins with building APIs, the team ensures the reusability and efficiency of code. This makes APIs the core technology in the digital value chain and puts them in the center of value-creation activities. Successful companies perceive their APIs as resources that can enable other functions in the value chain, and not for nothing.
When it comes to an API-first approach, one of the most important metrics is the velocity at which digital experiences are being created. Sometimes it directly influences the development costs, sometimes it does not. The bottom line, however, is that designing APIs first to deliver business instead of focusing on the nuts and bolts of implementing those APIs, a team pays more attention to the core, the foundation of their project. It renders a baseline architecture to work with, and by doing so, insures oneself against overspending in the future.
How do modern organizations use API first?
An increasing number of companies worldwide are becoming API oriented. These companies are different in how big they are and what vertical they operate in but their experience in switching to API first can and should be used to guide other software companies.
Amazon. Amazon proved that the earlier the API-first initiative is linked to the organization’s growth strategy, the better. Thus, they made everything they did in internal systems via APIs. Over 10 years ago, a company-wide mandate requiring all tech staff to embrace APIs was issued. Soon, API-first strategies became woven deeply into an organization's culture. Internally, business units now communicate only via API. Meanwhile, API-first design has become the key principle of microservice implementation on AWS. This resulted in the API developer experience improvement and the spread of innovation.
Netflix. Netflix is one of those companies whose business model is powered by a solid API architecture. In 2008, they introduced their first public API. It allowed public developers to write software that communicates with the streaming service. The API architecture has steadily been evolving and Netflix’s application programming interfaces have solidified as the mechanism supporting not only public but also private, internal requests. They let Netflix not so much reach new audiences as make the overall business strategy better. Netflix’s customizable API has made multiple endpoints more manageable on the server and accelerated innovation through fast, decoupled development cycles.
Etsy. Etsy opted for an API-first transformation after facing the challenges of concurrency handling, code generation, and API design. At some point, they had much of their business logic implemented repeatedly. That was the starting point for changing and perfecting the company’s API framework. As a result, they managed to build an API-first architecture from scratch. This new architecture has empowered clients to make customized complex requests so that even no new endpoints were needed. They increased extensibility for new devices and features, achieved consistency between the web and API, reusability of components and the cohesion of the logic, contributing to their API maturity and trust.
An API-first approach can have a powerful effect on how reliable internal and external clients interact with services. The approach offers transparency, scalability, performance, and cost benefits. The way your APIs are adopted, perceived, and consumed matters a lot. And an API-first approach can actually change the way enterprise companies organize their infrastructure for the better. Consider designing and building your API first and join those who have already managed to induce positive changes by following this strategy: saved time, reduced spendings, boosted performance, improved experience for all, and made their value proposition crystal clear.
© 2020, Vilmate LLC
for monthly digest