Corrosion is our distributed database built on top of SQLite that every machine in our fleet uses. I’m new at Fly, and what better way to learn the internals of the platform than to break stuff? I’ve started writing some tests for Corrosion’s subscriptions API. Subscriptions allow other components of our stack to get real-time updates on query results they’re interested in. Thanks to these tests, I discovered some funky behavior.
Turns out that if you tried to resubscribe to a non-existent subscription like this:
curl http://corrosion.rules/v1/subscriptions?from=1337 \
-H "content-type: application/json" \
-d "\"SELECT * FROM fresh_produces\""
then it would become impossible to subscribe to that query at all in the future! This got fixed.
There was also another edge case around resubscriptions on empty tables.
To improve observability of the API, new metrics got added.
You might expect up-to-date docs on Corrosion in the near future and hopefully some performance improvements.