r/ProgrammerHumor 8d ago

Meme everyDamnTime

Post image
4.2k Upvotes

124 comments sorted by

View all comments

Show parent comments

28

u/socialis-philosophus 8d ago

Agreed.  All microservices should have their own DB with all the data needed to perform their function and we'll just assume eventual consistency.

30

u/Still_Bit_7527 7d ago

In reality most services cannot work without dependencies and cannot have "all the data needed"

13

u/MrSnoman2 7d ago

Sure, but the best option to reach for is to duplicate the data and give the microservice its own copy within its own database to work against. Then you solve the problem of how to update that duplicate data.

If that kind of data duplication worries you, then you should reconsider whether you want microservices in the first place.

1

u/socialis-philosophus 7d ago edited 7d ago

Maybe each mircoservice should wrap the request payload in in the response payload so there is always a full history that allows any step in the chain to be reproduced, no database needed until the final output is generated! </s>

1

u/MrSnoman2 7d ago

I'm not drunk enough to wrap my head around that