The Full Path into The API GateWay:

YOUSSEF ALOUANI
4 min readSep 22, 2022

--

Networking Based APIs

The Story of APIs :

basically API means Application Programming Interface . But what does this means . I always Ask my self why this name , why there’s the interface word .to understand let’s get back into the old days when everything you can do in a computre can get done only with cables . you have to put cables in ports this how developers was writing code before Visual Interfaces . from this phase the APIs building starts . it is a tool that helps us the programmers to write faster and smarter and bigger applications . now we get in a high level of this tool . we have code editors , CLI , programming langagues . all of those tools are interfaces in a specfic level .

In contrast to a user interface, which connects a computer to a person, an application programming interface connects processes in the same computre or computers to each others , or even pieces of a software to each other.

The inter-program interface . means any tools that can help our programmes to do their tasks with less code and efforts . so they use other programmes through interfaces . this communication can be happen through multiple ways of communication . network communication , memory communication if they are in the same machine .

examples :

Linux API :

is the kernel–user space API, which allows programs in user space to access system resources and services of the Linux kernel. It is composed out of the System Call Interface of the Linux kernel and the subroutines in the GNU C Library (glibc).

NodeJS API :

is a toolkit introduced in Node 8.0.0 that acts as an intermediary between C/C++ code and the Node JavaScript engine. It permits C/C++ code to access, create, and manipulate JavaScript objects as if they were created by JavaScript code. Node-API is built into Node versions 8.0.0 and later and requires no further installation .

REST API :

uniform interface between physically separate components, often across the Internet in a Client-Server architecture

Kafka Streams API :

to implement stream processing applications and microservices. It provides higher-level functions to process event streams, including transformations, stateful operations like aggregations and joins, windowing, processing based on event-time, and more. Input is read from one or more topics in order to generate output to one or more topics, effectively transforming the input streams to output streams.

HTTP based API :

an HTTP based API it the first thing that comes to web developers .

an API that uses Hypertext Transfer Protocol as the communication protocol between the two systems. HTTP APIs expose endpoints as API gateways for HTTP requests to have access to a server. For example, you use an HTTP API every time you set a Zoom meeting in your Google calendar .

The One Service To Much APIs Problem :

APIs can make or Break Our Applications . the big deal is when you are making your large monolith application as micro Services and you start having many APIs . imagine FaceBook app . how many APIs they use to communicate . When we start using microServices while building applications we face a problem in our systems . the application start having too much doors . imagine a Palace with a lot of doors . this is a big security problem . it gonna be a vulnerability for the king “the application” . and like a labyrinth for visitors “the client side “.

API GateWay :

an API gateway is like a big Door from where all the clients join the system and take what they need . one door one input where you can check if they are allow to get in .

technically an API gateway is an API management tool that sits between a client and a collection of backend services. An API gateway acts as a reverse proxy : “is the application that sits in front of back-end applications and forwards client requests to those applications. Reverse proxies help increase scalability, performance, resilience and security like Nginx ” .to accept all APIs calls, aggregate the various services required to fulfill them, and return the appropriate result .

API gateway as a Pattern :

think about microservices as classes now the API gateway pattern looks like the facade pattern of Object-Oriented Design, so it provides a single entry point to the APIs with encapsulating the underlying system architecture.

The pattern provides a reverse proxy to redirect or route requests to your internal microservices endpoints. An API gateway provides a single endpoint for the client applications, and it internally maps the requests to internal microservices.

In summary, the API gateway locate between the client apps and the internal microservices. It is working as a reverse proxy and routing requests from clients to backend services. It is also provide cross-cutting concerns like authentication, SSL termination, and cache.

API Gateway Routing With Express-gateway :

Express-gateway : is a microservices API gateway that sits at the heart of any microservices or serverless architecture, regardless of what language or platform you’re using. Express Gateway secures your microservices and serverless functions and expose them through APIs using Node. js, Express and Express middleware.

Tutorial Link : https://www.express-gateway.io/getting-started/

--

--

YOUSSEF ALOUANI
YOUSSEF ALOUANI

Written by YOUSSEF ALOUANI

junior software engineer , the performance if it was a person , intrested in microservices architecture and System Design . I believe in sharing Knowledge

No responses yet