Typesafe Releases First Implementation of 'Reactive Streams' Spec
Typesafe, the chief commercial backer of the open source Scala project, has announced the availability of the first draft specification of Akka Streams, an implementation of the open source Reactive Streams project.
Akka is Typesafe's asynchronous, event-driven middleware implemented in Scala, a general purpose, multi-paradigm language that runs on the Java Virtual Machine (JVM). The Reactive Streams project aims to provide a standard for asynchronous stream processing on the JVM with non-blocking back pressure.
The Akka Stream spec is an attempt to "find a minimal set of interfaces and methods that will describe the necessary operations and entities to achieve asynchronous streams of data," the company said.
Akka Streams uses Actors as its mechanism of execution, distribution and resilience, explained Typesafe's chief architect Viktor Klang and Akka Tech lead Roland Kuhn on the company's blog. Actors are Scala's primary concurrency construct (concurrent processes that communicate by exchanging messages). "The current implementation runs every step within its own Actor," they wrote, "to make full use of the available parallelism, but in the future we will add other variants -- for example, that optimize for lower latency by fusing multiple operations to run within a single Actor."
"The idea behind Akka Streams is to leverage the battle tested Akka Actors to provide a straightforward execution model for statically typed streams of data that consume system resources in a predictable way," Klang, who is one of the original authors of the Reactive Steams spec, said in a statement
Both of these projects are efforts to help developers who are struggling with challenges presented by streaming data, including real-time content delivery and bulk data transfers. The main challenge: keeping the data flowing while limiting the resources consumed on the systems through which the stream passes.
"The idea on which Reactive Streams are built is to protect each consumer of data from being overwhelmed by its producer by propagating back pressure," Klang and Kuhn wrote. "This is done in an asynchronous, non-blocking fashion in accordance with the principles laid out in the Reactive Manifesto."
The Reactive Manifesto describes reactive applications, which are apps that better meet the "contemporary challenges of software development," in a world in which applications are deployed to everything from mobile devices to cloud-based clusters running thousands of multicore processors. The manifesto defines the four "critical traits" of reactive apps: event-driven, scalable, resilient, and responsive. By embracing these traits, developers produce apps that are highly responsive to user experiences, provide a real-time feel, and are backed by a "scalable and resilient application stack" that can be deployed just about anywhere.
"We needed a way to explain what we're talking about that wasn't full of geeky buzzwords and ended up just being confusing," Jonas Bonér, CTO and co-founder of Typesafe, told ADTmag in an earlier interview. "The manifesto distills things down to the essence of these new applications, which are being built right now, and provided a vocabulary that would allow developers to talk about these things."
Typesafe's other co-founder, Martin Odersky, created Scala to integrate features of object-oriented programming and functional programming. Typesafe is also responsible for the Play Web app framework, a development and runtime environment billed as "a clean alternative to legacy Enterprise Java stacks." Play compiles Java and Scala sources directly and "hot reloads" them into the JVM. Last year the company acquired of Spray.io, a suite of lightweight Scala libraries that provide client- and server-side REST/HTTP support on top of Akka. The company hoped to broaden the appeal of the Typesafe Platform to Java developers with "one of the best performing REST/HTTP libraries in the Java ecosystem," Boner said.
Typesafe is part of a group of organizations involved with the Reactive Streams project that includes Twitter, Oracle, Pivotal, Red Hat, Applied Duality, Netflix, Spray.io and the State University of New York at Oswego.
Kuhn will be hosting a Reactive Streams webinar on May 7, 2014.