Skip to content

Instantly share code, notes, and snippets.

View artursouza's full-sized avatar
🇺🇸

Artur Souza artursouza

🇺🇸
  • Diagrid
  • Washington State, USA
  • 14:55 (UTC -07:00)
  • X @artursouza
View GitHub Profile

Distributed Scheduler

Problem

Dapr hosts actors but the existing implementation for reminders is not reliable and there are multiple race conditions and scalability issues (e.g. low throughput for registering reminders). It relies on the Dapr's state store eTag and transactional capabilities.

Also, Dapr has plans to implement scheduled delivery for pubsub - which would implement the outbox pattern based on a schedule for each event, with the same requirement as actor reminders: a dynamic registry of events that will be triggered in the future. The difference being that in delayed publishing, the event is deleted right away. Optionally, the delayed pubsub can also have a single scheduled trigger that will publish all due events on a fixed schedule (every 1 min, for example).

This proposal shows two different approaches to a distributed scheduler, both based on Etcd. In both approaches, we can use this library: https://github.com/Scalingo/go-etcd-cron

@artursouza
artursouza / dapr-test-badge.json
Last active October 28, 2022 00:23
dapr/dapr repo's dynamic badges on GithHub
{"schemaVersion":1,"label":"dapr-test","message":"49% pass rate","color":"red"}

Keybase proof

I hereby claim:

  • I am artursouza on github.
  • I am arturbsouza (https://keybase.io/arturbsouza) on keybase.
  • I have a public key ASDdW2I7nLwh4volZolkCmrSRJPK4g9I76ZzVk3UWdZ0VQo

To claim this, I am signing this object: