# Scale up your thinking- Reactive programming with Scala and Akka

- Speaker: [Yardena Meiman](/wiki/speakers/yardena-meiman.md), [Lior Shapsa](/wiki/speakers/lior-shapsa.md)
- Event: [Reversim Summit 2014](/wiki/years/2014.md)
- Video: https://www.youtube.com/watch?v=hi1pz0IPkr0
- Transcript: [/transcripts/2014/13-hi1pz0IPkr0.md](/transcripts/2014/13-hi1pz0IPkr0.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Distributed Systems](/wiki/topics/distributed-systems.md), [Software Engineering](/wiki/topics/software-engineering.md), [Functional Programming](/wiki/topics/functional-programming.md), [Scalability](/wiki/topics/scalability.md)

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

## Summary

This talk explains how a development team adopted reactive programming using Scala and Akka to build a scalable benchmarking system. The speakers discuss the motivations for moving away from traditional multi-threading and blocking I/O toward an actor-based model to handle high concurrency and resilient processing. They share real-world code examples, common pitfalls, and design patterns used during the implementation of a web scraping and data processing pipeline. Finally, the audience learns practical tips regarding supervision strategies, testing, and debugging in a distributed actor system.

## Key points

- [3:26](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=206s) The shift from increasing CPU clock speeds to multicore processors makes traditional blocking code and multithreading inefficient for scaling.
- [4:28](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=268s) Reactive programming principles focus on being responsive to load, resilient to failure, message-driven with minimal shared state, and responsive to users.
- [6:44](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=404s) The actor model handles communication via asynchronous message passing, keeping state entirely private inside each actor and processing messages sequentially through a mailbox.
- [13:47](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=827s) Supervision strategies allow parent actors to manage failures by deciding whether to resume, restart, stop, or escalate when child actors throw exceptions.
- [22:27](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=1347s) Complex actor behaviors can be organized and composed using Scala traits and pattern matching to keep code modular and readable.
- [28:38](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=1718s) Futures in Scala allow asynchronous callbacks, and integration features like pipe-to can convert a future result directly into an actor message.
- [38:08](https://www.youtube.com/watch?v=hi1pz0IPkr0&t=2288s) Best practices for Akka include giving actors descriptive names, avoiding deep class nesting, and keeping messages immutable.

## Takeaways

- Adopt the actor model to handle high concurrency without dealing with explicit locks, shared mutable state, or race conditions.
- Use supervisor hierarchies to isolate failures and automatically restart or recover crashed worker components.
- Leverage non-blocking libraries and convert asynchronous futures into actor messages to maintain a fully reactive pipeline.

## Questions this talk answers

- How do you handle shared mutable state safely in a multi-threaded application without using explicit locks?
- What is the best way to convert asynchronous operations like futures into messages that an actor can process?
- How does supervision work in Akka when an actor fails, and how should parent actors manage child failures?

## Technologies

Scala, Akka, Java, HDFS, MongoDB, JVM

## Tags

actor model, concurrency, distributed systems, error handling, reactive programming, scalability
