Reactive tools

What are some of the most interesting tools to help you go Reactive?

If everything in life goes async, awkward silences will go extinct. The closest solution we had until recent times was texting. Unfortunately our texting apps are turning the experience more and more synchronous with “last seen”, “typing…” and “read” certificates, so awkward silences now have a matching textual digital form. Yay technology! </rant>

The upside of this whole thing is that the systems these texting platforms rely on are heading towards the exact opposite direction, by turning more and more async and message-driven.

Hope I’m not the only one seeing the irony here.

Async goes mainstream

The Reactive manifesto has set its sights on finding the words to put the software industry’s best architectural practices in writing. The kind of insight that comes from hard-earned experience, making complex systems dance and move around data in a matter of milliseconds under high load. The text distills what it means to build a modern application that meets today’s requirements, and gives a way to define its features. The manifesto was published by Jonas Boner with contributions from Martin Odersky, Roland Kuhn, Martin Thompson, Dave Farley and many others. So far it has been signed by… 9,795 9,809 9,831 9,851 developers. First off, if you haven’t already, sign the manifesto and let’s push it over to 5 figure numbers. You can do it right now, I’ll wait right here.

What it actually means to be Reactive?

It all comes down to creating a responsive application – an application which responds in a timely manner and builds user confidence. Responsiveness also means a system that knows how to detect problems and deal with them effectively. To achieve responsiveness, the application should be both Resilient and Elastic. Resilient meaning that it ensures any failure in one part of the system is recoverable and doesn’t compromise the system’s responsiveness. Elastic means that it can scale up or down to remain responsive under varying workloads. The best way to enable this is a Message Driven architecture based on asynchronous messages to build loosely coupled components.

You could argue that these ideas aren’t new at all and have already existed in different shapes and sizes. *cough* Erlang *cough*. And… you’d be right. While Personally, I think that’s the beauty in it, a new mutual language collecting the cream of the crop practices, clearing up the principles we rely on, and making them easier to communicate and pass on.

Reactive Manifesto Principles

The Reactive Principles: How they relate to one another?

While there are no specific tools or frameworks required to build Reactive applications, we’ve chosen to highlight some unique solutions on the frontier of production proof high scalability systems. Hope you have an appetite for some deliciosus tech, here come the specials on today’s menu:

1. Akka

Actors and Akka, the open source Reactive toolkit by Typesafe, are pretty much synonyms by now. It’s one of the most advanced yet stable approaches to software development today.

Akka

Akka features

What’s unique about it?

  • Message-Driven Actors & Futures – Actors communicate by exchanging messages that go to each other’s “mailbox”. An hierarchy is created so that each actor has only one supervising actor at most. Each actor can either take care of the task, break it down event further with delegation to another actor or in case of failure, escalate it to his supervisor. Async kicks in with Futures which receive a result when the processing of a task if finished, without the need to wait for it.
  • Distributed by design – In development, an Actor system is independent of any hardware architecture and can be later configured to fit a certain topology
  • Built for the JVM – Akka is built specifically for Java and Scala

The Reactive connection

From the developers who wrote the Reactive manifesto, comes this toolkit which addresses all its principles.

What next?

The best way to start would be to poke around the Activator Akka templates right here. If you’re on twitter, you can also follow the Akka / hAkkers team to stay up to date.

Find the Crap in Your Java App

Show me how >>

Fred

2. ReactiveX

Keeping up with modern development practices, here’s another approach to Reactive programming with Observable streams. It’s open source and awaiting contributions, used by companies like Github, Trello and Microsoft. With a Java version strongly back by the Netflix OSS team.

ReactiveX

ReactiveX

What’s unique about it?

  • Observable streams – Unlike the Actors and futures message passing example, Observables are the ReactiveX way of implementing asynchronous programming. An Observable emit objects similar to a stream, and an Observer subscribes to it and reacts to the events in a non-blocking way. And so on, like a chain reaction.
  • Scheduler – The way to handle multithreading and Observable, providing instructions to Observables and the operators they’re connected with to run on specific Schedulers.
  • Language agnostic – Rx is a specification that doesn’t depend on any language. Implementations are available for Java, JS, Scala, Ruby, Python, C#, .NET and the list continues.

The Reactive connection

Rx defines its Reactive approach by creating new design patterns that act as a framework for modern applications, promoting the principles described in the Reactive manifesto.

What next?

The RxJava Github wiki is a great place to get started. And don’t miss out on the twitter stream.

3. Typesafe ConductR

The most recent addition to this list, just released and provides a huge promise: Reactive DevOps. Implementing the Reactive principles we understand well on the development front to fellow Ops teams.

ConductR

A diagram of ConductR in action

What’s unique about it?

  • Distributable and trackable by default – Cluster-friendly out of the box, and designed to host distributed systems under heavy loads.
  • Immutable deployments – Versioned environment parameters with a unique fingerprint verified by ConductR.
  • Load balancing and replication – Balancing loads at high scale and distributing queries across the cluster to get information about what new services are coming online.

The Reactive connection

Reactive Ops with a strong focus on maintaining the Reactive Resilience trait.

What next?

To give ConductR a go you’ll have to contact Typesafe first through the product’s page. An interview around the tool with Kevin Webber, a Developer Advocate @ Typesafe, is available right here.

4. Takipi

While we try to to build error proof systems, life usually has other plans for us. So when errors do happen, we need to identify and analyze them as quickly as we can to deploy a hotfix. If you’re only relying on log files for this purpose, the next tool can set you free from the chains.

Takipi
The Takipi Error Analysis Screen

What’s unique about it?

  • Spend less time and energy debugging – Takipi automatically reproduces each error and displays the code and variables that led to it – even across servers.
  • Know which errors affect you the most – Detect 100% of code errors in production, including JVM exceptions and log errors without relying on log files.
  • Deploying without risk – Recognizes code deployments and alerts you when they introduce new errors.

The Reactive connection

As far as Reactive and error handling goes, apart from containing and handling errors without affecting the system as a whole, it means that you’re able to fix issues in your code effectively when they arise.

What next?

In less than 10 minutes from now you can get your first exception analyzed: Start here.

5. Kamon.io

Kamon is an open source set of tools to help monitor Reactive applications, enriching the ecosystem of Reactive tools.

Kamon dashboard
The Kamon Dashboard

What’s unique about it?

  • Akka actors metrics and tracing – Message processing time, time waiting in mailbox, mailbox sizes and more.
  • Reporting to external services – Connect Kamon to services like StatsD, Datadog and New Relic.
  • No code changes – Kamon instruments your bytecode to report the metrics.

The Reactive connection

Keeping on with the Ops angle, this is a specific tool designed to monitor Reactive applications and report on what’s going on with Actors behind the scenes.

What next?

If you’re already using Akka, Spray or Play!, you’ll need to install the Kamon core and then choose the modules you need to start reporting metrics to the Kamon dashboard. Check out the getting started guide and don’t forget to follow the team on twitter. Also, here’s a recent blog post about the new 0.4 release.

6. Aeron

Moving on to hyper-speed! Aeron is an open source messaging library designed to deliver millions of messages per second, with microsecond latencies between machines. Created by Martin Thompson, Todd Montgomery and Richard Warburton.

Aeron

Aeron Architecture Design Overview

What’s unique about it?

  • Low latency – Microsecond latencies, shaving off message passing time to a minimum.
  • Predictable Performance – Steady and replicable response times to rely on.

The Reactive connection

Taking Message Driven and Responsive to the extreme.

What next?

A talk by Martin, who’s also a great speaker among other things, covers Aeron and available on YouTube. Another good resource covering this is this post on HighScalabiliy. The Aeron Programming guide is available on Github.

7. LMAX DIsruptor

Back to single machines, and single threads, the LMAX Disruptor is a messaging library for low latency Inter-Thread communication.

LMAX Disruptor

LMAX Disruptor

What’s unique about it?

  • Multicast events – All events are published to all consumers in contrast to a queue where a single event will only be sent to a single consumer.
  • Pre-allocate memory for events – Allows for even lower latency messaging.
  • Optionally lock-free – Implemented with lock-free algorithms.

The Reactive connection

Sometimes I wonder just how close to maximum speeds these things can go, the financial industry is like the Fast & Furious car modding of Java performance. It’s also worth checking out OpenHFT on that front.

What next?

Learn more about the motivation behind it and the way it’s implemented here. A getting started guide is available on the Github wiki.

Conclusion

We’ve seen some of the more advanced tools, libraries and frameworks available to support and debug Reactive applications. Now we can hope for a future where all systems are responsive, even though Louis CK already says now that everything is amazing and nobody is happy 🙂

btw, a new session of the Coursera Reactive Programming course by Martin Odersky, Erik Meijer and Roland Kuhn starts in April so it’s worth checking out to learn the ins and outs from the source.

email
Some kind of monster @ OverOps, GDG Haifa lead.