From Zero To Microservice [1]
How to Design API, Server & Client With Ease?
--
Previous article:
Next article:
From Zero to Microservice [2]
How to Dockerize Your App & Deploy using Kubernetes?
yamaceay.medium.com
What is gRPC (Again)?
gRPC is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. [1]
It lets you:
define the service interface and the structure of the payload messages using Protobuf (Protocol Buffers) in a Protobuf file named e.g. <service>.proto
, then
generate the server and client stubs automatically using <service>.proto
in a variety of languages and platforms, but also
integrate bi-directional streaming and authentication features of HTTP/2
Planning
Let’s start with the following user story:
As an end user, I want to perform read/write operations on person data.
So we want to design a microservice which looks up person by a selected identifier and/or updates person data.
I choose Go as the programming language due to its simplicity and high speed.
Instead of creating HTTP server / client from scratch, I prefer to use gRPC for code generation.
Setup
Setup folder structure (I named it person
):