This is another TIL coming form Sam Newman's book — Building Microservices.

Today I learned about pattern called Tolerant Reader.

In Microservice architecture we need to take care of the communication between particular services. We want to avoid failures at all cost. Especially when our design is evolving. For example when one of the team decides to add a field to its JSON output we need to make sure that other services won't fail because of that.

That's what Tolerant Reader is about. In particular, it's about implementing our Microservices according to the Postel's law:

Be conservative in what you do, be liberal in what you accept from others.

In case of our example, we want to design our classes to take only the fields which we need and discard the rest. This way the communication won't break as long as the fields we care about won't change.