DEV Community

Discussion on: Clean Architecture using Golang

Collapse
 
chanyut profile image
Chanyut Leecharoen

Thank you for article. I decide to apply clean architecture for my existing project. Which all model's struct supports only MongoDB. How would I design model structure to make it independent from database. My first problem is which field ID (primary key)'s type could be? since MySQL use integer, MongoDB use ObjectID.

Collapse
 
eminetto profile image
Elton Minetto

Hi, sorry for the delay to answer...

I wrote a new post about Clean Architecture:

dev.to/eminetto/clean-architecture...

In this post I'm using UUID as ID:

github.com/eminetto/clean-architec...

github.com/eminetto/clean-architec...

I think this is a good approach.