fuse  by jlouis

Erlang app implementing a circuit breaker

created 11 years ago
511 stars

Top 62.0% on sourcepulse

GitHubView on GitHub
Project Summary

This Erlang library provides a circuit breaker pattern implementation to prevent cascading failures in distributed systems. It's designed for Erlang developers building resilient applications, offering a robust mechanism to isolate failing services and improve overall system stability.

How It Works

Fuse implements circuit breakers as stateful processes that wrap calls to potentially failing services. It tracks failure rates within configurable time windows. When a threshold is exceeded, the circuit "blows," preventing further calls to the failing service for a set duration, after which it attempts to "heal." This approach decouples failure detection from the core service logic and allows for graceful degradation.

Quick Start & Requirements

  • Install and start the fuse application: application:start(fuse).
  • For production, include fuse in your release boot script.
  • Example installation: fuse:install(database_fuse, {standard, MaxR, MaxT}, {reset, 60000}).
  • Documentation: [EDoc documentation](make docs)

Highlighted Details

  • Supports standard and fault_injection fuse types.
  • Integrates with monitoring systems via fuse_stats_plugin (ETS, folsom, exometer, prometheus).
  • Raises alarms on blown circuits with hysteresis for clearing.
  • Achieves high throughput (2.1M queries/sec) with low overhead (~0.5μs).
  • Extensive testing with Erlang QuickCheck (EQC) for property-based testing.

Maintenance & Community

  • Uses semantic versioning.
  • Notable contributors include Cian Synnott, Ilya Khaprov, Jesper Louis Andersen, Thomas Arts, and Zeeshan Lakhani.
  • Thanks to Issuu, Erlang Solutions, and Quviq for contributions.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

  • The async_dirty context for fuse:ask is noted to have rare race conditions.
  • Fault injection fuses incur a slight performance penalty due to rand:uniform() calls.
  • EQC tests are not included in the CI chain due to EQC installation requirements.
Health Check
Last commit

3 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.