"This week at Zumuta!" is a consice reading list about what happened in the Zumuta! universe in the past week.
This week I found out about a pattern that can help kwai with handling events: the outbox pattern. Kwai currently uses Redis streams for processing events. There are some problems with this solution. First there is no two-phase commit, when a transaction is rollbacked and the event is published to Redis, the event is not rollbacked. Secondly, it is very hard to keep track of the event data in Redis. With the outbox pattern, the event is stored in a table. The insert is part of the transaction, so there is no need for a two-phase commit. On a rollback, the event will also be rollbacked. Instead of using Redis, the kwai event worker needs to process the records from the outbox table. And it is easy to manage a table.
In the meantime I installed mise-en-place (mise). I'm checking if this can replace Task. Mise is also able to manage the tools that are used for developing: Python version, Nodejs version, ...