Foundational API Designs
Learn about foundational design problems.
We'll cover the following...
The earlier chapters enabled learners to understand most of the preliminary concepts required to design an API. Now, we’ll utilize that knowledge to use the REDCAMEL approach to designing an API. Let's start by understanding the need to design foundational problems.
Introduction
Different applications offer a particular set of services. For example, both YouTube and LeetCode use the search functionality. To design these services, we need to include all the functionalities required for that service. Instead of repeating such functionalities in each design, we define them as foundational design problems and use them as building blocks in relevant design problems.
The foundational design problems are primarily building blocks without which the entire service is incomplete. The purpose of separately designing foundational problems is to thoroughly discuss them once and then reuse them where they are applicable. Moreover, it will be easier for learners to tackle relatively simple design problems first and get a glimpse of our approach for designing a specific API.
This lesson will outline different foundational problems we’ll design and use as building blocks for our main design problems. We’ll discuss the following outlined foundational problems in detail:
Design a Search Service: This problem allows us to design an API for the search functionality. It demonstrates how the API gateway can interact with multiple services to obtain search results with ads and recommendations based on a search query.Additionally, we discuss how to make a paginating API and perform versioning by giving an example of adding filter functionality to the search service. Almost every advanced design problem, like YouTube, Google maps, Uber, LeetCode, etc., uses search functionality.