What are APIs?
The term APIs refers to application programming interfaces, but what does this really mean?
When we create an API, what we’re actually doing is creating an interface so that other programmers can communicate with our application. Essentially, they can use our program. A simple example is Amazon, which has its own API for products so that affiliates can display them on their website. This is a RESTful API.
There are thousands of APIs out there that we can use for different purposes. For example, Google Maps provides the Distance Matrix API, which calculates the distance between two points.
Different Communication Models or Paradigms
Okay, we saw that both APIs mentioned earlier use REST API, but not everything is done with the REST or RESTful model. There are also SOAP, WebSockets, and others. Below is a list of the most used:
- REST, RESTful
- SOAP
- Websockets
- GraphQL
- RPC and gRPC
- Web Hooks
- And there’s another one called HTTP Streaming
But of all these, the ones you will undoubtedly use the most are REST API, followed by Websockets, SOAP, WebHooks, and GraphQL.
You will definitely use some of these technologies when using someone else’s API.
What Technology to use for Your API
The technology you use will depend on what you want to achieve. For example, for a chat application, WebSockets might be the best option. On the other hand, if you need a lot of flexibility, GraphQL would be recommended, but it may not be as suitable if the app is simple. Meanwhile, for creating a CRUD (Create, Read, Update, Delete) or ABM (Alta, Baja, Modificación) functionality, REST would be recommended.
Microservices
Microservices are a software design architecture in which an application is composed of small, independent services, each focusing on a specific task or business function.
Each microservice is independent of the others, allowing for independent development and scaling (independent changes).
Generally, REST technology is used for communication between microservices.