finagle
A fault tolerant, protocol-agnostic RPC system
A networking library from Twitter for JVM apps that handles reliable communication between services, automatically managing retries, timeouts, connection pooling, and load balancing.
Finagle is a networking library originally built at Twitter to handle the enormous volume of requests that flow between internal services. It runs on the JVM, so it works with both Java and Scala code. The core idea is that when one piece of a large application needs to talk to another piece over a network, Finagle manages that conversation reliably, even when things go wrong.
The library is described as protocol-agnostic, which means it is not locked to a single way of talking over the network. It supports HTTP, HTTP/2, MySQL, Redis, Memcached, and more, using the same underlying design patterns for each. Engineers write a client or server once using Finagle's API, and the framework takes care of connection pooling, retries, timeouts, and load distribution across multiple machines.
Fault tolerance is a central theme. If a downstream service slows down or fails, Finagle tries to detect that and route traffic away from the broken endpoint rather than letting failures pile up. This makes it useful for building systems where many services depend on each other and a single slow component could otherwise bring down the whole chain.
Companies like Pinterest, SoundCloud, Foursquare, and Tumblr have used Finagle in production alongside Twitter. The project is actively maintained and publishes releases roughly monthly. Documentation lives on a dedicated website with a user guide and full API reference.
For a non-technical reader, think of Finagle as the postal infrastructure inside a large organization: it decides how messages between departments get routed, what happens when a department is temporarily unreachable, and how to avoid overloading any single team with too many requests at once. It does not provide the business logic of any service; it handles the plumbing between them.
Where it fits
- Build a fault-tolerant Scala or Java service that automatically retries failed calls and routes traffic away from slow dependencies.
- Create a high-throughput HTTP or HTTP/2 client with built-in connection pooling and load balancing across multiple servers.
- Add resilience to a JVM backend by wrapping Redis or MySQL calls in Finagle clients that detect and handle slowdowns.