1 comment

[ 1.9 ms ] story [ 20.2 ms ] thread
Despite having many separate libraries in PyPi that try to implement some of the listed patterns, few would be considered production-ready and practically useful. Most are missing important features, configurations and limits that make them inconvenient or dangerous to use in production under the scale.

This is the problem that Hyx is trying to solve.

Hyx is a slim resiliency toolkit for asyncio-based Python microservices. The idea is to implement all industry-proven stability patterns in a safe production-ready way by incorporating experience shared by industry leaders like Google, Amazon, Neflix, Microsoft. So you don't think twice what library to install to improve your resiliency situation.

It's pretty much like Hystrix, resilience4j or Polly, but for Python.

At this point, the project has been inited with the basic implementations and docs for the following components:

- retries (with several backoff and jitter strategies)

- consecutive circuit breaker

- timeouts

- bulkhead (concurrency limiter)

- Token Bucket-based Rate limiter

- fallback

On the way to make it production ready, I plan to add support for metrics dispatching (via OpenTelemetry, Prometheus, StatsD), implement more variants of circuit breakers, rate limiters, etc, make existing components more ready-to-use and tailored to the common use cases, provide examples and integrations with popular frameworks (like FastAPI/Starlette, Flask, etc)

If the idea sounds useful, feel free to give it star. If you would like some functionality to be supported, drop me a message here or in the Github Discussions. That will help me to prioritise the work.

Links:

- Github: https://github.com/roma-glushko/hyx

- Docs: https://hyx.readthedocs.io/en/latest/

- Roadmap: https://hyx.readthedocs.io/en/latest/roadmap/