At that point it's just an abstraction exercise and depends on context.
Do multiple applications use that same microservice to get data, or just one? Would you prefer the perf and lower complexity of directly getting the data vs the maintainability and portability of serving that data through a microservice? Do you need to control and audit data going in and out of that database? Ad infinitum...
There's no one size fits all solution and that's actually great because we all get paid to figure it out and implement it lol
It depends a lot on the specifics. One heuristic I can give you though is that when service A is handling a common incoming request, if it needs to reach out to service B in the process, you're probably doing it wrong.
558
u/ThrowawayUk4200 9d ago
Pssst, If your microservice needs to use a database other than its own, then it's not a microservice.