Skip to content

dbalduini/darko

Repository files navigation

darko

Why?

Adding a rate limiter into your application may cost a huge amount of memory increase. To avoid this, you may choose to drop the requests. This is also known as leak bucket rate limiter.

If your application is allowed to drop the requests, then you don't need darko or any other external rate limiter.

darko is a scalable token bucket rate limiter that gives you:

  • Guaranteed order on the requests
  • No data loss
  • Vertical scale
  • Horizontal scale on HA mode

Standalone Mode

darko standalone mode

High Availability Mode

darko high availability mode

Master

  • Act as writer
  • Accept writes and creates new jobs

Followers

  • Act as reader
  • Read the new jobs for its partition key

Guarantees

Order

No Data Loss

To avoid the loss of data, set the redis db persistence to AOF.

See more about redis persistence here.

TODO

  • Improve logging
  • Dynamic scale of followers
  • Monitoring (maybe Prometheus)
  • Fix standalone image

About

the scalable rate limiter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published