March 16–17, 2015: Training
March 17–19, 2015: Conference
Boston, MA

Error Handling in Reactive Systems

Dean Wampler (Lightbend)
3:30pm–5:00pm Thursday, 03/19/2015
Reactive and its variants
Location: 304
Tags: reactive
Average rating: ***..
(3.00, 4 ratings)
Slides:   1-PDF 

Prerequisite Knowledge

This is a talk for developers and architects. No prior experience with reactive programming concepts or systems will be assumed, although it will be helpful.

Description

There are many libraries and systems that support some or all of the Reactive Manifesto’s traits, Responsive, Resilient, Elastic, and Message Driven. Often, robust failure recovery, a hallmark of the Resilient trait, is limited at best.

I’ll examine several tactics for handling or preventing failures and look at example libraries that support them:

  • The logic for failure handling is embedded in the logic for normal control flow: We’ll see how this approach is used in Go and Clojure’s core.async library, both inspired by Communicating Sequential Processes (CSP). We’ll also see the approach in Reactive Extensions.
  • Minimize common failures: Common failures include message buffer overflows. Reactive Streams implement back pressure (flow control) between producers and consumers, making it possible to implement a global flow control strategy.
  • Use Types to prevent failures: CSP-style channels are typed, so unexpected message types can’t be used. Functional Reactive Programming also leverages type safety and it eliminates error-prone mutation logic required to propagate state changes “downstream”.
  • Manage failures with separate components: Actor systems, such as Akka and Erlang use special supervisor hierarchies to manage the lifecycles of worker actors, enabling strategic failure handling. Other systems, such as Netflix’s Hystrix are used in a similar way at the process level. Other benefits include decoupling of failure handling from normal control flow and the ability to make failure handling pluggable and configurable.
Photo of Dean Wampler

Dean Wampler

Lightbend

Dean Wampler, Ph.D., is the Architect for Big Data Products and Services for Typesafe. He builds scalable, distributed applications using Spark, Hadoop, Mesos, Scala, and the Typesafe Reactive Platform. He is the author of several books for O’Reilly on Scala, Hive, and Functional Programming. Dean is a contributor to several open source projects and he co-organizes several technology conferences and Chicago-based user groups. Follow Dean on Twitter @deanwampler.