DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for The DDD microservice with GO
FabianBG
FabianBG

Posted on

The DDD microservice with GO

Intro

Hi everybody, these last days I decided to star a base project with the basic folder structure and libraries to start easily a new microservice with GOLANG. Right now there is a lot of continuous change in the GOLANG environment so this project uses a specific tech stack but can be adapted to any tech stack due to the architecture of DDD which is an architecture that I think helps a lot to make more refactorable any project.

Tech Stack

Basically knowing that the arch gonna be Doman Driven Design I find the best suitable techs to apply this patterns to the project so at the end if you know about the current frameworks on the internet you should know (GOKIT)[https://github.com/go-kit/kit] as its definition is not a framework is a bunch of tools to develop microservices it supports a lot of advanced features like services discovering and circuit breakers. SO this is the main reason for me to choose this tech to develop this base project.
For the data persistence, I go for a mongo to keep a simple and versatile data model there is an official mongo connector for GOLANG so it is simple to make the decision of which library use.

Tech stack

Architecture

The chosen architecture will be Doman Driven Desing to keep the project well organized and very scalable.

DDD architecture diagram

Project

So there is the project it could be found on my GitHub page on clicking this link [https://github.com/FabianBG/gokit-base].

Project structure

I hope it helps you to get into Golang and any comments about how to improve the code it is welcome.

Top comments (1)

Collapse
 
anilask_63 profile image
Anilask

yeah you are doing good job.

can you post one basic project with rest api in golang

Why You Need to Study Javascript Fundamentals

The harsh reality for JS Developers: If you don't study the fundamentals, you'll be just another β€œCoder”. Top learnings on how to get to the mid/senior level faster as a JavaScript developer by Dragos Nedelcu.