R
R
ReallyNoob2020-11-14 21:15:19
go
ReallyNoob, 2020-11-14 21:15:19

How to organize a Go microservice architecture?

Hello! I've been studying Go for a couple of weeks and trying to figure out the microservice architecture.

My service has fairly standard inputs: there are several entities (posts, blog categories) that can be created / edited, updated, deleted.

There are needs to communicate with other services. For interservice communication I use gRPC.

The question is how to competently create the architecture of such a microservice so that:

  1. It was convenient to work with CRUD operations on entities
  2. It was convenient to write/maintain requests to other microservices
  3. It was convenient to make selections from the database as part of your microservice
  4. It was convenient to decompose some helper functions
  5. It was convenient to structure the business logic of my microservice requests


Something like this. I apologize for the chaotic description, but how did it happen.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
uvelichitel, 2020-11-14
@uvelichitel

If you are using gRPC, then the architecture starts with inter-service communication. You describe the message structure in the .proto language and compile it into Go data structures. Then write logic handlers for these structures. That is, the starting point is the message exchange architecture. And microservices for that and micro, that they do not require internal architecture in general.

B
basrach, 2020-11-14
@basrach

It was comfortable
it only depends on straight arms. You can memorize all sorts of uncle beans, eric evansevs, etc., to the crust, but realize it in such a way that blood will flow from the eyes.
It is definitely possible to say that in go you do not need to build a service design in the same way as in RR, Java or .Net. The best way to understand how a go application should work is to study well-known projects, for example: https://github.com/gomods/athens , https://github.com/google/exposure-notifications-server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question