There's a little section in the docs describing the different compatibility models supported by avro.
Has anyone given much thought to the different kinds of applications supported by each model. Traditionally
we've tried to just make everything backwards compatible but I recently noticed that the schema registry supports
per-topic compatibility models it seems like it might make sense to think carefully about what makes sense for each
topic rather than try to force a global standard.
I'm also a little confused about how using the readerSchema works. I haven't been able to find any docs on
this but I get the impression this is about "projecting" schemas. This seems like it might be useful to protect
a consumer from changes to an upstream changes as alluded to in the link above. That description
implies that this is only applicable with forward compatibility. Does that mean you should only use a readerSchema
when the topic is marked as forward compatible?
I'm thinking of a use-case where lets say we define a topic "foo-v1", then later on decide that "foo" needs an
incompatible change (e.g. a new required field), so we define "foo-v2". Lets also assume that foo has more than
one consumer, one of which doesn't actually care about the whole foo. It can do it's job on the subset of foo's
fields that remain "backwards compatible".
In this case, it seems like it might be possible to define a 3rd schema which includes only that subset of fields
and use this schema to deserialize messages from both topics. This consumer would not need to be updated
just because the upstream producer wanted to send along some additional required fields.
Cheers,
Andy