DEV Community

Cover image for The DDD microservice with GO

Posted on

The DDD microservice with GO


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)[] 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


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

DDD architecture diagram


So there is the project it could be found on my GitHub page on clicking this link [].

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)

anilask_63 profile image

yeah you are doing good job.

can you post one basic project with rest api in golang