I've been struggling for a while of what would be the "recommended" approach for a microservice itself.
There are quite of top architecture designs that are the holy sacred for a lot of craftsman devs, such as CQRS, Hexagonal, DDD, etc...
But from my point of view, depending of how "big" is the microservice, because you know the word itself it's giving you a hint... "micro"!!
Should I consider build all the packages, interfaces, divisions between layers such as Hexagonal, or split the content of the microservice based on DDD (its supposed that 1 microservice its 1 domain??? if not... :| kind of WTF??)
Or just keep it on its essence like split the entrypoints(rest,queues)-core(business logic)-outpoints(DB,queues, or whatever) and let it open for a "little" extension.
If its too big, think on a split? In order to avoid "minimonolits" and what would be the limit to consider an "app"/API a microservice or a little monolit?
Maybe to be more clear.
i.e:
Microservice/API
├── Product
│ └── DDD/CQRS/Hexagonal stuff
| └── ....
├── Sells
│ └── DDD/CQRS/Hexagonal stuff
| └── ....
└── Customer
└── DDD/CQRS/Hexagonal stuff
└── ....
Microservice with basic crud -> Product-Sells-Customer(with patterns such as CQRS, Hexagonal, etc...?) -> Its a minimonolit for me.
The kind of what I look forward...
Gateway microservice
├── Product
│ └── routing stuff
| └── ....
├── Sells
│ └── routing stuff
| └── ....
└── Customer
└── routing stuff
└── ....
Product
Product Microservice
├── Product
└── Basic separation layer(REST/SERVICE/ORM-QUEUE)
└── ....
Sells
Sells Microservice
├── Sells
└── Basic separation layer(REST/SERVICE/ORM-QUEUE)
└── ....
Customer
Customer Microservice
├── Customer
└── Basic separation layer(REST/SERVICE/ORM-QUEUE)
└── ....
The previous ones should have patterns such as CQRS, Hexagonal, etc...???