# API Gateway

## Introduction

* It acts as bridge between client and backend services
* It performs authentication, load balancing, circuit breaking, service discovery, protocol translation, monitoring and logging, but also caching

## Flow

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2FJ2tl7FsPbagwRFiqUh1t%2Fscreenshot-www.youtube.com-2022.11.15-14_39_37.png?alt=media\&token=9f5149db-57ba-4c02-9113-236f7193ab21)

* Firstly, receive the request from client and check that it is in correct format
* Then, check that the domain is in allow-list and the identity of the user
* But also check the request rate is over the limit or not&#x20;
* With the help of service discovery to locale the corresponding backend registered by path matching of API gateway
* Transform the suitable protocol to communicate with backend services, and finally transform back to http protocol to send back the response back to client

## References

{% embed url="<https://www.youtube.com/watch?v=6ULyxuHKxg8>" %}
