Understanding Enterprise Systems: Understanding API Gateway and Service Mesh with the Airport and City Analogy

Today I'm going to talk about two of the most confusing topics of the last years (API Gateway and Service Mesh), which are difficult to answer the question “when should we use which one?” We're going to take a fun journey to explain the complex computer systems used by large companies. If we compare these systems to something we all know, we can think of a giant city or country. How is it? Let's discover it together!
API Gateway and Service Mesh are two different structures that manage the communication of modern systems. However, without getting bogged down in technical terms, it makes things much easier to explain these two concepts with a scenario that everyone can encounter in daily life. So, can we simply explain the functions of API Gateway and Service Mesh through the airport and city taxi system? Of course we can!
Our City's Airport: API Gateway
In the systems of large companies, there is a special gate that enables communication with the outside world. This is technically called “API Gateway”. We can liken it to the big, international airport of our city. Why? Here are a few reasons:
- Main Entrance Gateway: Just as everyone coming from abroad has to pass through the airport, all computer requests from outside also pass through this API Gateway.
- Security Checks: Airports have passport control and security screening, right? API Gateway works exactly the same way. It checks every incoming request, authenticates it and makes sure it is secure.
- Congestion Control: Sometimes airports get very crowded and have to limit flights. Similarly, API Gateway can limit the requests coming into the system. This is called “rate limiting”. In Apinizer, we do this in detail with API Based Throttling and API Based Quota policies. This protects the system from overloading.
- Wayfinding Assistance: At the airport, there are signs directing passengers to the correct terminals. API Gateway also directs incoming requests to the correct services.
- Language Translation: International airports have translators for people speaking different languages. API Gateway also “translates” between different technologies. That is, it converts an external request into a format that internal systems can understand.
- Record Keeping: Airports keep records of passengers coming and going. Similarly, API Gateway keeps logs of all incoming requests. This is crucial for understanding what is going on later on.
- Surveillance: Airports have cameras everywhere and the security team monitors everything. API Gateway also constantly monitors the performance and security of the system. If there is a problem, it will be noticed immediately.
- Baggage Arrangement: At the airport, your luggage is sometimes rearranged or packed. API Gateway also organizes the incoming data, sometimes removing unnecessary information or reshaping it according to the needs of internal systems.
City Transportation: Service Mesh
Now, we're inside the city, where there's another technology that enables communication between the company's internal systems: Service Mesh. We can liken this to a city transportation system.
- Pervasive Mesh: Just as bus stops or subway stations are spread throughout the city, Service Mesh is spread throughout the company's internal systems.
- Fast Communication: Like buses moving people from one place to another in the city, Service Mesh moves information quickly from one system to another.
- Traffic Management: Just as traffic lights and road signs regulate traffic, Service Mesh regulates data traffic between systems.
- Safe Journey: Just as public transportation provides a safe journey, Service Mesh makes communication between systems safe.
- Condition Monitoring: Just as transportation companies constantly monitor the condition of their vehicles, Service Mesh constantly monitors the status and performance of systems.
Differences
The API Gateway controls all requests from the outside world, such as the airport terminal, and is the system's gateway to the outside world. It secures, filters and routes all external traffic to the relevant services.
Service Mesh manages and optimizes how microservices inside the system communicate with each other. It is a system that regulates how taxis in the city communicate with each other and which roads they will use.
Result
This, dear readers, is how we can describe the complex systems of big companies. The API Gateway provides communication with the outside world, such as our city's airport, and maintains security. Service Mesh provides fast and secure communication between internal systems such as city transportation.
With these technologies, large companies can serve thousands of customers at the same time, keep their systems secure and make sure everything runs smoothly. Just like a well-run city!
I hope this article has helped you understand these complex systems from a non-technical perspective. If you have any questions, I'm waiting for you in the comment section!