Service Technologies

No matter how isolated and independent your microservices are, at some point, some of them, will need to communicate with each other. There two main communication categories to achieve this are RPI (or Remote Procedure Invocation) and messaging.

Remote Procedure Invocation

Remote Procedure Invocation, or RPI for short, follows a request/response format: the client sends a request and waits for a response from the service. This is a synchronous communication that uses the synchronous protocol HTTP/HTTPS, which is the base for some of the most well known and extensively used technologies:

REST

REpresentational State Transfer, or REST for short, is a software architectural style that defines a set of constraints to be used for creating Web services. Web APIs confronting to this style are called RESTful APIs. ASP.NET Core works well with REST and there numerous guides and examples out there. Here is a tutorial from Microsoft Docs:  Create a web API with ASP.NET Core.

GraphQL

GraphQL is not an architectural style like REST but a query language designed by Facebook to cope with the need for more flexibility and efficiency. It gain a lot of attention for solving the rigidness of a RESTful API, but its far from becoming an industry standard like REST and it requires quite a learning curve. Although a microservice should be small and thus the need for complex queries obsolete, there are scenarios and project that GraphQL might worth considering, like for example a gateway or an aggregator service. Here is a “Getting Started” guide for .NET:  https://graphql-dotnet.github.io/docs/getting-started/introduction.

gRPC

gRPC was initially designed by Google for Remote Procedure Calls. It uses HTTP/2 to exchange binary messages which makes it ultra fast but at the same time more difficult to debug. There is a great guide on  how to get started with gRPC and ASP.NET Core, bear in mind though that ASP.NET Core gRPC is not currently supported on Azure App Service or IIS (it’s 2020-12-21 today!).

SOAP is another technology often used over HTTP for Web Services. SOAP (acronym for Simple Object Access Protocol) is actually an entire messaging protocol specification which uses XML only and its not as light-weight as REST, thus making it a bad candidate for microservices.

#azure event grid #graphql #grpc #kafka #microservices

Microservices Ecosystem - A 2021 Guide Of The Available Products and Services
1.75 GEEK