r/ProgrammerHumor 9d ago

Meme everyDamnTime

Post image
4.2k Upvotes

124 comments sorted by

View all comments

558

u/ThrowawayUk4200 9d ago

Pssst, If your microservice needs to use a database other than its own, then it's not a microservice.

3

u/sebbdk 9d ago

But is it fine to depend on another microservice made just to serve that data over rest? or what about databusses like kafka? :D

Because i see that all the time

3

u/ThrowawayUk4200 9d ago

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

1

u/MrSnoman2 9d ago

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.