ThreeDotsLabs / wild-workouts-go-ddd-example

Go DDD example application. Complete project to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring.
https://threedots.tech
MIT License
5.01k stars 462 forks source link

How would you transform this architecture into Microservices? #62

Open JustJakeCalifornia opened 1 year ago

JustJakeCalifornia commented 1 year ago

sup, Im currently struggling to find an appropriate architecture for building Microservices in Go. Everyone says something different - no crystal-clear standardization.

It'd be great if you can show me how you would transform this approach to Microservices, bc I pretty like this architecture

mdaops commented 1 year ago

Hey -

So for the most part the code base is already split into services..

You have

internal/Trainings internal/Trainer internal/Users

There's absolutely nothing stopping you from copying this three layers and spliting them up into single repositories and or layers. In fact that's the benefit of using something like DDD-lite because you're effectively serpeating your business logic by domain boundary whether your making microservices or not.

In general though, you should be using what ever standardisation is best for you, or your company. DDD / DDD-lite / Ports & Adapters / Hexagonal aren't sliver bullets. Start of simple, refactor when needed.

JustJakeCalifornia commented 1 year ago

Sounds coherent ty. I've found my way of structuring my project and it's pretty clean in my opinion. If you're interested, check it out: https://github.com/NicoMarksman/go-license-v2. I also use the workspace feature in VSCode to separate them.