actors, that can contain state • Communication done by message passing • Lock-free concurrency • Loosely coupled and distributable • Fault tolerance via Supervision
reacts on messages it receives • State (storage) - An actor is shielded from the rest of the world - no need for synchronization! • Communication - An actor interacts with other actors exclusively via messages • "One actor is no actor" - they come in systems
backend system • DroneShadow - backend “mirror” of field-deployed Drone, keeps metrics and represents drone in backend model • Backend - single MicroService, backed by Akka Cluster for resilience/load-balancing
drones • Micro-service - has a single responsibility, it absolutely does not mean “one node”! • Distributed Journal - backing datastore of the single service, often Cassandra, SQL or similar. Service should “own your data.”
Distribution via Location Transparency • Lock-free & simple Concurrency • Very powerful abstraction underneath everything we’ll talk about Akka Actors:
{} // uninstantiable @FunctionalInterface public static interface Publisher<T> { public void subscribe(Subscriber<? super T> subscriber); } public static interface Subscriber<T> { public void onSubscribe(Subscription subscription); public void onNext(T item); public void onError(Throwable throwable); public void onComplete(); } public static interface Subscription { public void request(long n); public void cancel(); } public static interface Processor<T,R> extends Subscriber<T>, Publisher<R> { } }
Subscriber is so hard! You should be using Akka Streams instead! 1) Avoiding unbounded buffering across async boundaries 2)Inter-op interfaces between various libraries
to pass Reactive Streams standard • Reactive Streams coming to JDK9 • Powerful composable ScalaDSL and JavaDSL • Open Materializer API (e.g. Intel GearPump) Akka Streams:
• Built completely on Akka Streams • Trivially exposes TCP level flow control to Akka Streams as backpressure • Simple inter-op with Actors, Futures, Streams • HTTP/2 coming very soon Akka HTTP:
Streams “Connectors” • Akka Streams == Reactive Streams impl == everyone profits! • Similar in goals to Apache Camel • “inter-op all the things!” • We’ve prepared plenty tools to make it simple
(always!) • Asynchronous all-the-way • Understandable and well-defined failure scenarios • Start local, go distributed with no or minimal changes • Highly reusable & composable code • Brought to you by leaders of Reactive Streams
(!)), (built using Akka Streams, Aeron) More integrations for Akka Streams stages, project Alpakka. Akka Typed actively progressing (!). Akka HTTP/2 Proof of Concept in progress. Akka HTTP as default backend of Play Framework. Highly Available CRDTs with Akka Distributed Data.