C
C#2y ago
M B V R K

❔ Is Repository Pattern still recommended with Microservices and EF Core ?

Hi friends, Oh $hit, here we go again, with this funny and forever debate. When we have Microservices architecture project, where each service has its own database and uses EF Core as an O/RM in addition they uses RabbitMQ as a Message broker. The following are some questions need your experience share: Is using Repository Pattern a recommended part in this case , even if the EF Core making the Abstraction between database and App ? If the first one is not recommended, is the CQRS pattern recommended for this case ? Please do not hesitate to share your experiences with me, and massive thanks in advance.
12 Replies
codesandplays
codesandplays2y ago
No and No That's just my opinion
M B V R K
M B V R KOP2y ago
which one no Repository or CQRS or both?
jcotton42
jcotton422y ago
What kind of repository? A generic one? @MBARK
M B V R K
M B V R KOP2y ago
lets say both using Generic repository for the most repeated routines, and (Specific repository) adding custom methods if needed for custom operatons ( it depends on entities )
jcotton42
jcotton422y ago
Well the db context is already a generic repository (and unit of work)
M B V R K
M B V R KOP2y ago
Great So, repository pattern can be used to perform some custom operations that DbContext can't ?
jcotton42
jcotton422y ago
A custom repository would used to add value on top of the db context Like input verification that the db can't (or shouldn't) handle
M B V R K
M B V R KOP2y ago
Also, if I use the CQRS in each service, is this good ?
jcotton42
jcotton422y ago
I haven't used CQRS, so I can't speak to that
M B V R K
M B V R KOP2y ago
@jcotton42 I have an out of thread question but related to the topic, lets say a Service A want to get data from Serrvice B is the best practice to cunsume the API of B from A or using RabbitMQ ??
jcotton42
jcotton422y ago
¯\_(ツ)_/¯ I'd ask that in a place like #architecture
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server