Avro schema : is adding an enum value to existing schema backward compatible?

后端 未结 2 836
盖世英雄少女心
盖世英雄少女心 2021-01-27 03:18

I have an enum field for status in my Avro schema in which the possible statuses currently are

PENDING
APPROVED
REJECTED

I want to add one mor

相关标签:
2条回答
  • 2021-01-27 03:51

    No, it is not. Here's why: If you are using this new schema to, let's say, emit events to Kafka, then all clients will try to deserialize the value. When event with new type will appear, there would be 2 cases:

    1. clients with new schema will deserialize successfully
    2. clients with the old schema will fail to deserialize, because they don't have such value in their enum

    So, no, this is not backward compatible.

    0 讨论(0)
  • 2021-01-27 03:55

    I don't think it is, but you are welcome to use the Schema Registry API to verify compatbility

    https://docs.confluent.io/current/schema-registry/develop/api.html#id1

    0 讨论(0)
提交回复
热议问题