Chapter 5: Scaling APIs
When you are building an application or an API that several people use, it’s availability and reliability are quite important. You want to ensure that it never goes down and continues to load fast for its users. However, your API may suddenly experience a surge in usage. That may impact the quality of your service or even bring your application down.
To support increasing number of API calls, there are a number of things engineers tend to do. Database query optimization, sharding databases, adding missing indexes, utilizing caching, doing expensive operations asynchronously, writing efficient code and tuning web servers help in increasing the throughput and decreasing the latency. All these things are very important and should be done.
Beyond these optimizations, there are other set of changes that are frequently overlooked and can significantly help in scaling APIs. You need to think if there are ways you can evolve your API design, change API usage policies or help third party developers in writing efficient code while working with your API. In this chapter, we will cover these often forgotten best practices and tips that can be useful for scaling your API.
Evolving your API Design
In the real world, the API design you started with may not scale with your growth. It’s important to figure out for what use cases your developers are using your API. This can give you insights in addressing some of the scaling bottlenecks and even reducing the number ...