API Architecture Types


[36]
What is an API?
It is a mechanism to communicate and exchange data between two services or applications. API stands for Application Programming Interface.
Let’s take an example of a restaurant. A customer is a client application and a chef is an application running on the server. A waiter acts as an API who takes an order from the customer and communicates it to the chef. Once the food is ready, the waiter collects and delivers it to the customer.
In technical terms, the client application makes a HTTP request call to another application to retrieve some data via an API call. The application running on the server processes the request, sometimes fetches the data from the database and sends the response in the format (generally, JSON) that client application wants.
REST (REpresentational State Transfer)
It follows six REST architectural constraints and can use JSON, XML, HTML or even plain text. It is flexible, light-weight and scalable. It is the most used API format on the web and employs http
. More on REST here.
GraphQL
It is a query language for APIs and uses a schema to describe the data. It uses a single endpoint to fetch specific data and is used in applications that require low bandwidth.
SOAP (Simple Object Access Protocol)
It is a strictly defined messaging framework that relies on XML. It is secure, extensible and protocol-independent. It is mainly used in secure enterprise environments.
RPC (Remote Procedure Call)
It is an action-based procedure and is great for command-based systems. It only uses HTTP GET and POST. It has light-weight payloads that allow for high performance. It is utilized in distributed systems.
Apache Kafka
It is used for live event streaming and communicates over TCP protocol. It can publish, store and process data as it occurs. It captures and delivers real-time data, for example, stock markets.
Subscribe to my newsletter
Read articles from Pranav Bawgikar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Pranav Bawgikar
Pranav Bawgikar
Hiya 👋 I'm Pranav. I'm a recent computer science grad who loves punching keys, napping while coding and lifting weights. This space is a collection of my journey of active learning from blogs, books and papers.