Wiki: Reactive by Example

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker shares practical experiences with applying the reactive manifesto to a large-scale metrics collection pipeline handling millions of events per minute. The talk details the evolution from naive client-server architectures to a custom asynchronous proxy built with Netty that protects downstream databases. The audience learns how to handle network failures, manage internal queues, and implement back pressure to maintain system stability under heavy loads.

Key points

  • 1:07 The reactive manifesto outlines key architectural tenets like responsiveness and resilience, but its abstract concepts can be difficult to apply in real-world systems.
  • 4:04 The engineering team built a metrics pipeline to ingest high-frequency data from all hosts and datacenters into Graphite for visualization and alerting.
  • 6:08 An initial naive architecture where all applications wrote directly to Graphite quickly failed under a load of 500,000 metrics, causing dropped data and holes in graphs.
  • 7:14 Experimenting with message queues and log shippers like Logstash introduced slow consumers, memory bloat, and cascading failures that dropped data onto the floor.
  • 9:39 The speaker’s team developed a custom proxy called Graphite-Proxy using Netty to handle metrics batching, buffering, and disaster recovery replication across datacenters.
  • 52:23 Hidden queues inside operating systems, event loops, and network interfaces contribute significantly to system latency and memory pressure during overloads.
  • 1:04:32 Implementing round-robin load balancing and Consul-based DNS service discovery enabled effective distribution of traffic across multiple proxy instances.
  • 1:23:03 Applying back pressure and idle connection timeouts prevents half-open sockets and unresponsive network partitions from crashing the entire logging infrastructure.

Takeaways

  • Use asynchronous networking frameworks like Netty to build low-level custom proxies and control data flow effectively.
  • Implement back pressure mechanisms to slow down clients and protect backend services from crashing under heavy overload.
  • Be mindful of hidden queues in TCP stacks and event loops that silently increase system latency.

Questions this talk answers

  • How can you protect a metrics database from being overwhelmed by high-frequency writes?
  • What strategies can be used to handle back pressure and prevent cascading failures in asynchronous Java applications?
  • How do you implement reliable disaster recovery replication for real-time telemetry data across multiple datacenters?

Technologies

Graphite, Netty, Java, Logstash, Consul, TCP, DNS, Cassandra

Tags

back pressure, load balancing, metrics, networking, reactive programming, scalability