Skip to content

Schema evolution (from 🐸 into 👨‍🚀)

Compare
Choose a tag to compare
@Strech Strech released this 30 Mar 23:38
· 81 commits to master since this release

This release is a fix for the schema evolution process.

Before v0.10.0 if you have Schema Registry enabled the very first schema version will be used forever, even if you update schema files and restart the service.

Starting v0.10.0 a few major changes happen.

The flow

The schema resolution flow gets changed. Now if you never resolve your schema (i.e it was not found in Avrora.Store.Memory) we always will read the schema file no matter do you have a version in the name or not.

Then, if you do have a version in a name (for instance you do the decoding of the message) we will check the registry and find schema there.

If you don't have a version in a name (for instance you do the encoding of the message) we will try register schema in the registry. Luckily, Confluent Schema Registry allows you to register the same schema many times since they verify its hash sum (i.e this is an idempotent operation).

All the described above leads to the next change, which I consider breaking

The generic name resolution

The names cache TTL was changed from 5 minutes to infinity. Why? Simply because it will be always resolved to the latest available schema and in case if it's compatible we are good. If it's not – you anyway will have to re-deploy your code (yes, hot-reload is still a question, if you have suggestions/problems – feel free to create an issue).

And in case if you want some periodic disk-reads of your schemas – set it to something lower than infinity. But nonetheless, it's a public interface change, so I call it breaking! Boooo 👻

Happy coding 👨‍💻 and don't forget to wash your hands ✋
P.S Thanks @coryodaniel for the issue report and collaboration 🤗