> For the complete documentation index, see [llms.txt](https://kdongs.gitbook.io/kdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kdongs.gitbook.io/kdocs/api-gateway/api-gateway.md).

# 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&amp;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](/kdocs/microservices/microservices.md#rate-limiting));
* 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
