Member-only story

ServiceRunner, a simple framework to run microservices in Golang

Peter Gillich
9 min readJan 12, 2025

--

If the microservices are in several repo, there are several functions and features, which are the same in the repositories. The typical solution is creating a sample or template repository which is used for creating each microservice repository. The Go community tries to support this way, see the gonew and Go Developer Survey 2023 H2 Results. But it’s bad way, because it’s hard to maintain the copypasted code in several repos.

A free link to this article: https://pgillich.medium.com/servicerunner-a-simple-framework-to-run-microservices-in-golang-9706e07cfc80?source=friends_link&sk=d7f74623216d2c12e74ce5924bc44c0b

Image from https://microservices.io/post/architecture/2023/05/17/evolving-microservices-sfjug.html

A better way is creating a Go Core repo, which contains the common, non-business functions and features. The microservice repo contains only the business function, service registrations and a call to start.

The solution should support the whole lifecycle (see chapter Architecture adaptation during the whole lifecycle in my article How to set up Golang projects for microservices, Part 1: Concepts ), which is started by a quick&dirty prototype, continued by microservices in monorepo (see my article Dependency handling for microservices: monorepo vs multirepo), separated to more repos as miniservices (more microservices are running together in one container) and finally each…

--

--

No responses yet