From back stage to front stage
You may recall that not too long ago, APIs were relegated to the realm of IT. They were appreciated simply for their ability to allow software programs or components to interact with each other. However, as companies likes Salesforce.com, Expedia.com, eBay, Twitter, Amazon, Netflix, Walgreens and many more began to open their back-end data and functionality for reuse in new application services, businesses become more aware about the powerful impact of APIs on revenue.
Not surprising then, that many companies want to speed up their digital transformation journey, and the only way these companies can achieve that objective is if they adopt the DevOps approach and practices to expose their data and services as APIs using an API management platform.
API management solution with DevOps
Companies need a robust approach for rapid development and deployment of APIs using intelligent API management platforms. (Figure 1)
Figure 1: API Management DevOps Framework
Using Agile methodology with an iterative approach in combination with DevOps tools and a culture of continuous integration and deployment can not only help build high-quality APIs but also shrink the release cycles.
Based on the principles and practices of DevOps, together with the relevant technologies, the process of API creation and management becomes more streamlined such that the overall API delivery effort can be reduced significantly, using an iterative cycle.
Let’s take a look at how this approach helps to shrink the overall API delivery times, and accelerate the digital transformation journey of a business.
The requirements for APIs need to be very specific. For example, they must specify the input and output parameters, together with datatype, location of an API, response codes and error messages. It is equally important to define the data mapping of the input and output parameters between an API consumer and API provider. Due to the technical nature of the inputs required, capturing requirements for APIs can turn into a lengthy and complicated process for business analysts.
Next is the creation of the API specification documents and the API proxy design to be built on an API management platform. By using Swagger1 or RESTful API Modeling Language (RAML)2—framework solution for describing, consuming, producing and visualizing REST API—API specifications can be generated in a machine readable format. Furthermore, when building API proxies, embedding vendor-specific extensions into the specification document can help reduce manual effort for creating API policies. Both Swagger and RAML help generate interactive API documents, which are very useful in the developer on-boarding process. Hence, frameworks like Swagger and RAML are ideal for documenting API specifications during the design phase for both Northbound and Southbound APIs.
Build and deployment
In this phase, the API proxy is developed and implementation policies pertaining to security, data format transformation, service orchestration, error handling and routing to backend services are configured. Using GitHub,3 a company can manage configuration and continuous integration. GitHub also helps in version management and easy maintenance of API configurations. Since the API management products do not provide inbuilt plugins for the source code management (SCM) repository within their respective consoles or development studios, an offline approach is needed to manage the source control. Adopting and getting used to this approach of SCM may take some time in the beginning, but it saves on time and effort in the long run. A daily or more frequent check-in and check-out helps in reducing problems with code mergers when multiple developers are working on the same branch simultaneously. It also enables a culture of continuous integration—one that finds bugs early in the lifecycle of API development. In fact, setting up Jenkins to trigger the build and deployment to a non-production environment on every check-in into GitHub and integrated sanity test allow the discovery of problems at an early stage.
Unlike conventional manual testing, API testing needs to be completely automated and comprehensive to test all positive and negative combinations of input data and their boundary conditions. Testing tools such as Apache JMeter™4 or test frameworks like Chai5 and Mocha6 can be used to create the test suite. An automated test-driven approach using Jenkins helps to identify issues immediately after testing, and it significantly reduces the coordination and communication efforts between the development and test teams.