# API Gateway

## About

An API Gateways is a management tool, inserted between Clients and the Backend API Services, acting as a Single Entrypoint.

<img src="https://3062501519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcYwIfPqe2ekSEqpmZWXe%2Fuploads%2F6EwyVhDC820Dq2L435jG%2Ffile.excalidraw.svg?alt=media&#x26;token=8646d9b8-f3fd-4676-a6bc-6dfc919a27f9" alt="" class="gitbook-drawing">

Usually an API Gateway acts in the Network Layer, and can have these responsabilities:

* Abuse control ([Microservices #Rate Limiting](https://app.gitbook.com/s/nlFsbFv50eNWeHeOyBFh/#rate-limiting "mention"));
* Standardized Authentication/Authorization;
* Log control;
* API management (routing);
* Standardized Metrics (ops team);
* Distributed tracing.

| Advantages                                                    | Disadvantages                                                              |
| ------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Standardization of orthogonal features. *(logging, security)* | It needs extra care, regarding availability, as it it a single entrypoint. |
| It helps on company's network governance.                     |                                                                            |
| As a single entrypoint, it facilitates management.            |                                                                            |

### Applications as API Gateway

#### Nginx

`Nginx` can act as an API Gateway being able to handle, `routing`, `load balancing`,  `encryption`, `rate limiting`, `security`, `basic authentication` and others.

It is really good for handling `routing` as it is capable of handling concurrent requests.

Not recommended for Enterprise applications, as some important features are not available by default.

#### Kong

`Kong API Gateway` is an Opensource and [#micro-gateways](#micro-gateways "mention"), check more on its docs.

## Types of Gateways

### Enterprise Gateways

### Micro Gateways
