How to boost the performance of your APIs - Part I
There are several problems that surface after a business going through Digital Transformation (DX) launches it’s first few APIs. One key problem is the poor performance of these APIs especially if the API is consumed at a rate of more than 10 TPS (Transaction per Second).
Typically when poor performance is investigated for a root cause, it almost always lead back to:
This article is one in a multi-part?series?which aims to outline the three key pillars to boost API performance.
Why do you need to care about the performance of your APIs?
Customer expectations are shaped by the best digital experiences delivered by companies like Apple, Facebook, Google, AirBnB, Uber, and Amazon. Fulfilling these high expectations demands that your App be powered by highly performing APIs.
Multiple occurrences of delays in the APIs powering your app is likely to lead users to abandon it in favour of another better performing app. With millions of Apps on iOS and Android App stores, receiving only a few bad ratings or negative reviews on your app would have a negative impact on the app in-terms of discoverability, conversion and effective advertising.
As you can see from the above illustration, low rating and bad feedback negatively affects your company's image and customer perception of your ability to deliver better Apps. The above screenshots are real ones taken for three different slow Apps developed by three of the top organisations in Australia.
APIs are the backbone of the products and services your company delivers to their customers, thus they need to perform very well in order for your App to deliver the best customer experience possible.
How to overcome the challenge? The Solution
The 3 key pillars to boost API Performance are:
In this part of the series, Part I, I will be focusing on the first pillars one and two, while in Part II of the same series, I will discuss the third pillar in detail.
1. Assess, measure & define target performance metric
Assuming you already have APIs that are already being consumed, the first thing we need to do is to assess whether we have a performance problem or not. If there are any performance problems, which APIs are impacted? how degraded the performance is compared to the target performance metric that need to be achieved. For the APIs impacted we need know:
If you haven’t published your APIs for consumption yet, then you need to go through an exercise of making some assumptions about the expected usage of your APIs after publishing. The assumptions still need to answer the key questions mentioned above.
To continuously assess and measure API performance, it is paramount that some type of API Operational Intelligence capability be stood-up. Please refer to my article How API Operational Intelligence solves critical business challenges for more details.
At this point, you know what the performance problems are and you have a target performance metric that need to be achieved. The best way to achieve high performance metric is ensure that performance is designed into the solution powering your APIs (Performance by design).
领英推荐
Assuming you have the design that can deliver high performing APIs, you will still need to do the QA on the APIs to assess it against the target performance metrics. So you would need to standup the Automated API QA first. In Part II of the same series, I will be focusing on how to design highly performing APIs that can continuously perform without interruptions even with unexpected load or unplanned outages.
2. Standup Automated API QA capability
To Standup an End-2-End Automated API QA capability, we need to develop an Automated API DDT (Data Driven Test) Framework. The API DDT Framework contains re-usable test logic that reads test data from a spreadsheet, makes API calls, and asserts on the response of those API calls. The Framework also logs test step details to be used in the generation of the test report.
The digram below outlines the design of the Framework at a high level.
Now you have the framework, you need to embed it into your CI/CD Pipeline?to make it fully automated with your code releases. The digram below outlines the End-2-End architecture design for the Automated API DDT Framework embedded in the CI/CD Pipeline. Here I'm assuming you are using AWS CodePipeline but you can also use any other CI/CD Pipeline.
As part of standing up the automated API QA, you would need an API DDT (Data Driven Test) framework to make things super easy at implementation and cut down on the time taken to develop automated test case.
Bonus: Automated API DDT framework
With this article, I'm giving away a tested Automated API Framework based on DDT (Data Driven Test) so that you can get a head start in standing up the Automated API QA capability.
The framework caters for functional, security and performance testing of APIs. The framework can be accessed and downloaded from GitHub. The Framework was built using SmartBear ReadyAPI test QA software.
Conclusion & Takeaways
Customer expectations are shaped by the best digital experiences delivered by companies like Apple, Facebook, Google, AirBnB, Uber, and Amazon. Fulfilling these high expectations demands that your App be powered by highly performing APIs.
Assessing and defining target API performance metrics along with standing up an Automated API QA capability are two of the 3 key pillars to boost the performance of your APIs.
In Part II of the same series I will be focusing on how to have a highly pefroming API by design.
The same article published on my blog can be found?here.
All of my articles can be found here.
Notice of Non-Affiliation and Disclaimer: The author of the article is not affiliated, associated, authorized, endorsed by, or in any way officially connected with any of the product vendors (Apple, Facebook, Google, AirBnB, Uber, Splunk, Amazon AWS, or SmartBear) mentioned in this article, or any of its subsidiaries or its affiliates.
Information Technology Security Adviser at Healthdirect Australia
6 年Great article! Automated API testing is certainly still a challenge for a lot of developers this certainly helps solve this problem in a neat way. Well done