Go microservice: API gateways pattern

1. Requirements:

It doesn’t require you must have experience in microservices before. But I highly recommend you should read to understand some basic concepts.

2. What we build:

  • This article will focus on building the authentication service which includes login/signup and user profile endpoints.
Postman

3. System architecture:

3.1. API gateway pattern:

4. Happy scenario:

In this architecture, a happy scenario would be:

  • user logins and we return a Jwt token.
  • user get their profile by sending the Jwt token.

5. Our microservices:

  • Protobuf:
user.proto
user.go
user_dao.go

7. Conclusion:

This article explains how to use gRPC to transfer data between services and Gin framework as a front controller to consume the message and returns to the client. For viewing the complete code go to:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store