SlideShare une entreprise Scribd logo
1  sur  119
Télécharger pour lire hors ligne
Konrad `@ktosopl` Malawski @ Scalapeno 2016
q
The things we don’t see
Exploring the unseen worlds of the Scala,
Akka and Software in general
Konrad `@ktosopl` Malawski @ Scalapeno 2016
The things we don’t see
Exploring the unseen worlds of the Scala,
Akka and Software in general
Konrad `@ktosopl` Malawski
akka.io
typesafe.com
geecon.org
Java.pl / KrakowScala.pl
sckrk.com / meetup.com/Paper-Cup @ London
GDGKrakow.pl
lambdakrk.pl
“The things we don’t see”
What it means (at least for me, and in this talk)
… in Software in general
… in Scala (programming languages)
… in Akka (concurrency, distributed systems)
The things we don’t see…
in Software
A world of tradeoffs
Reality
A world of tradeoffs
Reality
A world of tradeoffs
Reality
A world of tradeoffs
Reality
A world of tradeoffs
Reality
At the core of it…
This talk is about trade-offs.
Measure
Measure
What we can’t measure, we can’t improve.
And often: simply don’t improve at all.
Measure
What we can’t measure, we can’t improve.
And often: simply don’t improve at all.
“ArrayDeque surely will be faster here!”
Wha..! Turns out it isn’t, let’s see why…
Measure, to gain understanding of your system
OMG! I changed all the settings to “more”!
And it’s not improving…!
Measure, to gain understanding of your system
OMG! I changed all the settings to “more”!
And it’s not improving…!
Hmm… weird.
Where do you see the bottleneck?
Measure, to gain understanding of your system
OMG! I changed all the settings to “more”!
And it’s not improving…!
Hmm… weird.
Where do you see the bottleneck?
Measure, and don’t be that guy
OMG!
That lib is 1000x better in serving a file!!!
I’ll use kernel bypass networking for my blog!
Have & understand actual performance requirements,
don’t invent them based on high frequency trading* talks :-)
* I’m assuming here that’s not your business, if it is – carry on.
Systems, what do they do?!
Systems, what do they do?!
Systems, what do they do?!
Systems, what do they do?!
Systems, what do they do?!
Systems, what do they do?!
The things we don’t see…
in Scala
A thing about nulls
A thing about nulls
"I call it my billion-dollar mistake."

Sir C.A. R. Hoare, on his invention of the null reference
A thing about nulls
something.calculateSum(2, 2)
What does this code do?
A thing about nulls
something.calculateSum(2, 2)
What does this code do?
a) return 4
b) NullPointerException!
c) System.exit(0) // though I have a love-hate relationship with this answer…
The curious case of Options
Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165)
Guava Optional – 2011 (since v10.0)
Java Optional – 2014 (since v1.8)
Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165)
Guava Optional – 2011 (since v10.0)
Java Optional – 2014 (since v1.8)
The curious case of Options
sealed abstract class Option[+A]
extends Product with Serializable { self =>
def isEmpty: Boolean
def isDefined: Boolean = !isEmpty
def get: A
@inline final def getOrElse[B >: A](default: => B): B =
if (isEmpty) default else this.get
Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165)
Guava Optional – 2011 (since v10.0)
Java Optional – 2014 (since v1.8)
The curious case of Options
sealed abstract class Option[+A]
extends Product with Serializable { self =>
def isEmpty: Boolean
def isDefined: Boolean = !isEmpty
def get: A
@inline final def getOrElse[B >: A](default: => B): B =
if (isEmpty) default else this.get
public final class Optional<T> {


public boolean isPresent() {
return value != null;
}


public T get() {
if (value == null)
throw new NoSuchElementException("No value present");
return value;
}
public T orElseGet(Supplier<? extends T> other) {
return value != null ? value : other.get();
}
The curious case of Options
val o: Option[String] = ???
o.foreach(_.toUpperCase(Locale.ROOT)) // ok, sure
o match {
case Some(value) => value.toUpperCase(Locale.ROOT)
case None => "_"
}
We all have the same “mistake”:
get seems innocent, but it’s not…
final Optional<String> optional = Optional.of("");
optional.map(it -> it.toUpperCase(Locale.ROOT));
if (optional.isPresent()) {
optional.get().toUpperCase();
}
Can we do better than that though?
“What the eyes don’t see,
the programmer does not invoke.”
Blocking is the new “you broke the build!”
Blocking is the new “you broke the build!”
// BAD! (due to the blocking in Future):
implicit val defaultDispatcher = system.dispatcher
val routes: Route = post {
complete {
Future { // uses defaultDispatcher
Thread.sleep(5000) // will block on the default dispatcher,
System.currentTimeMillis().toString // starving the routing infra
}
}
}
Blocking is the new “you broke the build!”
// BAD! (due to the blocking in Future):
implicit val defaultDispatcher = system.dispatcher
val routes: Route = post {
complete {
Future { // uses defaultDispatcher
Thread.sleep(5000) // will block on the default dispatcher,
System.currentTimeMillis().toString // starving the routing infra
}
}
}
http://stackoverflow.com/questions/34641861/akka-http-blocking-in-a-future-blocks-the-server/34645097#34645097
The curious case of Futures
The curious case of Futures
public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
public T get() throws InterruptedException, ExecutionException {
// ...
}
public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
// ...
}
The curious case of Futures
Anyone remember the days before
scala.concurrent.Future?
Back to the Future, in which we discuss Akka and Twitter Futures in 2012 :-)
https://groups.google.com/forum/?fromgroups=#!topic/akka-user/eXiBV5V7ZzE%5B1-25%5D
The curious case of Futures
public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
public T get() throws InterruptedException, ExecutionException {
// ...
}
public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
// ...
}
trait Future[+T] extends Awaitable[T] {
// THERE IS NO GET!
// Closest thing to it is...
def value: Option[Try[T]]
// However it’s not that widely known actually
// Notice that it is non-blocking!
The curious case of Futures
public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
public T get() throws InterruptedException, ExecutionException {
// ...
}
public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
// ...
}
trait Future[+T] extends Awaitable[T] {
// THERE IS NO GET!
// Closest thing to it is...
def value: Option[Try[T]]
// However it’s not that widely known actually
// Notice that it is non-blocking!
The curious case of Futures
public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
public T get() throws InterruptedException, ExecutionException {
// ...
}
public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
// ...
}
trait Future[+T] extends Awaitable[T] {
// THERE IS NO GET!
// Closest thing to it is...
def value: Option[Try[T]]
// However it’s not that widely known actually
// Notice that it is non-blocking!
object Await {
@throws(classOf[TimeoutException])
@throws(classOf[InterruptedException])
def ready[T](awaitable: Awaitable[T], atMost: Duration): awaitable.type =
blocking(awaitable.ready(atMost)(AwaitPermission))
@throws(classOf[Exception])
def result[T](awaitable: Awaitable[T], atMost: Duration): T =
blocking(awaitable.result(atMost)(AwaitPermission))
}
The curious case of Futures
Java strongly valued fitting-in with existing types.
This forced exposing the get() method.
Scala had a clean-slate, could keep out of sight methods
we don’t want devs to call as they’re dangerous.
“If you don’t see a way at first sight…
maybe it was hidden on purpose?”
Hidden scaladoc features
Hidden scaladoc features
Akka HTTP 2.4.2
we didn’t know about the
hidden feature as well actually :-)
Hidden scaladoc features
Akka HTTP 2.4.4
Started using the scaladoc
@group feature.
Hidden scaladoc features
Akka HTTP 2.4.4
Started using the scaladoc
@group feature.
Hidden scaladoc features
Akka HTTP 2.4.4
Started using the scaladoc
@group feature.
/**
* @groupname basic Basic directives
* @groupprio basic 10
*/
trait BasicDirectives {
/**
* @group basic
*/
def mapInnerRoute(f: Route Route): Directive0 =
Directive { inner f(inner(())) }
/**
* @group basic
*/
def mapRequestContext(f: RequestContext RequestContext): Directive0 =
mapInnerRoute { inner ctx inner(f(ctx)) }
// unlocked by:
scala -groups
Trait representation
Trait representation, in Scala 2.11
trait T { def foo = "bar!" }
class A extends T
class B extends T with SomethingElse
Trait representation, in Scala 2.11
Trait representation, in Scala 2.11
./target/scala-2.11/classes/scalapeno/Example$class.class
./target/scala-2.11/classes/scalapeno/Example.class
Trait representation, in Scala 2.11
$ javap -v ./target/scala-2.11/classes/scalapeno/Example.class
Classfile target/scala-2.11/classes/scalapeno/Example.class
Last modified 25-Apr-2016; size 475 bytes
MD5 checksum fe12967b00411cde03bdc57f0ca6869b
Compiled from "Example.scala"
public interface scalapeno.Example
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
{
public abstract java.lang.String newMethod();
descriptor: ()Ljava/lang/String;
flags: ACC_PUBLIC, ACC_ABSTRACT
}
./target/scala-2.11/classes/scalapeno/Example$class.class
./target/scala-2.11/classes/scalapeno/Example.class
Trait representation, in Scala 2.11
$ javap -v ./target/scala-2.11/classes/scalapeno/Example.class
Classfile target/scala-2.11/classes/scalapeno/Example.class
Last modified 25-Apr-2016; size 475 bytes
MD5 checksum fe12967b00411cde03bdc57f0ca6869b
Compiled from "Example.scala"
public interface scalapeno.Example
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
{
public abstract java.lang.String newMethod();
descriptor: ()Ljava/lang/String;
flags: ACC_PUBLIC, ACC_ABSTRACT
}
$ javap -v ./target/scala-2.11/classes/scalapeno/Example$class.class
Classfile target/scala-2.11/classes/scalapeno/Example$class.class
Last modified 01-May-2016; size 450 bytes
MD5 checksum ea679b7db9d6275dbe9dff53475000c2
Compiled from "Example.scala"
public abstract class scalapeno.Example$class
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_SUPER, ACC_ABSTRACT
public static java.lang.String newMethod(scalapeno.Example);
descriptor: (Lscalapeno/Example;)Ljava/lang/String;
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
0: ldc #9 // String
2: areturn
New trait encoding using default methods
https://github.com/scala/scala/pull/5003
Trait representation, in Scala 2.12
./target/scala-2.12.0-M4/classes/scalapeno/Example.class
Trait representation, in Scala 2.12
$ javap -v ./target/scala-2.12.0-M4/classes/scalapeno/Example.class
Classfile scala-2.12.0-M4/classes/scalapeno/Example.class
Last modified 25-Apr-2016; size 684 bytes
MD5 checksum 07bad6e3b9c5d73b1276e5e7af937e29
Compiled from "Example.scala"
public interface scalapeno.Example
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT
{
public java.lang.String newMethod();
descriptor: ()Ljava/lang/String;
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: ldc #12 // String
2: areturn
LocalVariableTable:
Start Length Slot Name Signature
0 3 0 this Lscalapeno/Example;
LineNumberTable:
line 4: 0
The things we don’t see… in…
The things we don’t see… in ‫ַּכֹו‬‫ע‬?
The things we don’t see in… The Queen of Laponia?!
The things we don’t see… in Akka, the open source project.
Messages! Not method calls.
Akka Actor in one sentence:
Messaging as a core abstraction, not slap-on afterthought.
Messages! Not method calls.
Akka in one sentence:
A toolkit for building highly distributed and concurrent apps.
Messages! Not method calls.
http://c2.com/cgi/wiki?AlanKayOnMessaging
Messages! Not method calls.
Waldo J,Wyant G,Wollrath A, Kendall S.A @ Sun Microsystems Laboratories. 1994.
Note on Distributed Computing
Messages! Not method calls.
Methods: // locally:
val value: Long = local.calculateSum(2, 2)
// if it’s parallel then we need some middle man to handle concurrency issues hm…
// but remote will have big latency so...
val value: Future[Long] = remote.calculateSum(2, 2)
// Q1: what is actually put on the wire?
// Q2: what about retrying to different host,
// - now need magic to handle it...
// Q3: can the downstream directly respond to upstream?
// - ok, so we could build a special method that does this
// Q4: what if the networking breaks...? Do I need to try/catch?
// ... but why, if it could be a simple message send :-)
Messages! Not method calls.
Methods: // locally:
val value: Long = local.calculateSum(2, 2)
// if it’s parallel then we need some middle man to handle concurrency issues hm…
// but remote will have big latency so...
val value: Future[Long] = remote.calculateSum(2, 2)
// Q1: what is actually put on the wire?
// Q2: what about retrying to different host,
// - now need magic to handle it...
// Q3: can the downstream directly respond to upstream?
// - ok, so we could build a special method that does this
// Q4: what if the networking breaks...? Do I need to try/catch?
// ... but why, if it could be a simple message send :-)
Messages: // locally:
local ! CalculateSum(2, 2)
// I'll get a reply in a bit, or I can retry etc etc.
// Actor is can be running in parallel, on multi-core etc, same API.
// what can happen?
// JVM can crash => effectively message loss
// remotely
remote ! CalculateSum(2, 2)
// what can happen?
// message loss
// receiver of the msg can crash... => message loss
Messages! Not method calls.
class OneWayProxyActor extends Actor {
val downstream: ActorRef = ???
def receive = {
case StateQuery(q) =>
sender() ! run(q)
case req: IncomingRequest =>
downstream forward transformed(req)
}
def run(any: Any) = ???
}
Messages! Not method calls.
What do we not see in these scenarios though?
Messages! Not method calls.
What do we not see in these scenarios though?
Local synchronous methods are trivial to trace:
that’s what a StackTrace is.
But the tradeoff is very high: scalability / resilience – all lost.
Messages! Not method calls.
What do we not see in these scenarios though?
Local synchronous methods are trivial to trace:
that’s what a StackTrace is.
But the tradeoff is very high: scalability / resilience – all lost.
Tracing async / distributed systems is not quite solved yet…
Dapper / Zipkin are not a new things,
they’re the beginning of a journey – not the complete solution…
Messages! Not method calls.
I can totally do the same
with REST HTTP calls!
Messages! Not method calls.
I can totally do the same
with REST HTTP calls!
Sure you can (201, 204), but:
In Akka that’s both default,
and exactly 40bytes cheap.
Messages! Not exposing state.
Encapsulation, so nice…
Messages! Not exposing state.
class ComplexLogic {
def add(i: Item): ComplexLogic
def apply(): Effect
}
But it’s “only for testing”!
Messages! Not exposing state.
getter
class ComplexLogic {
def add(i: Item): ComplexLogic
def apply(): Effect
def state: State
}
Messages! Not exposing state.
val logicActor: ActorRef = ???
// no way to access state - for your own good.
logicActor ! Add(item)
logicActor ! Add(item)
logicActor ! Apply
expectMsgType[StateAppliedSuccessfully]
Test:
yes: behaviour and interactions,
not: raw state.
“I want my words back.”
Roland Kuhn
(former Akka Team lead)
We want our words back…!
Two examples of name-collisions causing confusion:
“Scheduler”
&
“Stream”
Naming is hard…
“Scheduler”
“Scheduler” - but is it the right one?
class CountdownActor extends Actor {
val untilEndOfWorld = 127.days // according to mayan prophecy
// oh, great, a scheduler!
val scheduler = context.system.scheduler
scheduler.scheduleOnce(untilEndOfWorld, self, EndOfTheWorld)
def receive = { case EndOfTheWorld => println("Aaaaa!!!") }
}
http://doc.akka.io/docs/akka/2.4.4/scala/scheduler.html#scheduler-scala
“Scheduler” - but is it the right one?
class CountdownActor extends Actor {
val untilEndOfWorld = 127.days // according to mayan prophecy
// oh, great, a scheduler!
val scheduler = context.system.scheduler
scheduler.scheduleOnce(untilEndOfWorld, self, EndOfTheWorld)
def receive = { case EndOfTheWorld => println("Aaaaa!!!") }
}
Into the Dungeon
Into the akka.actor.dungeon
Technically LARS is not in the dungeon,
but couldn’t stop myself from making this reference…
“Scheduler” - but is it the right one?
“Scheduler” - but is it the right one?
It’s a plain “Hashed Wheel Timer” though!
It’s a plain “Hashed Wheel Timer” though!
It’s a plain “Hashed Wheel Timer” though!
Optimised for:
• high performance
• lockless insertion
• O(1) insertion
• huge amounts of tasks

// timeouts - on each request, ask timeouts
Original white paper: Hashed and Hierarchical Timing Wheels:
https://pdfs.semanticscholar.org/0a14/2c84aeccc16b22c758cb57063fe227e83277.pdf
It’s a plain “Hashed Wheel Timer” though!
Optimised for:
• high performance
• lockless insertion
• O(1) insertion
• huge amounts of tasks

// timeouts - on each request, ask timeouts
Not for:
• preciseness
• persistence
Original white paper: Hashed and Hierarchical Timing Wheels:
https://pdfs.semanticscholar.org/0a14/2c84aeccc16b22c758cb57063fe227e83277.pdf
Akka’s Scheduler fun facts!
• Akka impl. after Netty implementation
• Akka impl. improved performance quite a bit
• Netty pulled-in the optimisations
(just one of multiple (both way) healthy interactions)

=> Yay, healthy Open Source ecosystem!
Akka’s Scheduler fun facts!
Error message you’ll likely never see:
LightArrayRevolverScheduler for short: “LARS”
Akka’s Scheduler fun facts!
Error message you’ll likely never see:
LightArrayRevolverScheduler for short: “LARS”
“LARS cannot start new thread,
ship’s going down!”
Persistent, reliable job scheduler
Ok, so what do we need for it?
Persistent, reliable job scheduler: Chronos
Ok, so what do we need?
• Persistence
• Replication
• Consensus on who executes
Persistent, reliable job scheduler: Chronos
Optimised for:
• ”Like CRON, but distributed”
• Visibility, including management UI
• Retries of failed tasks
• Far-out tasks (usually measured in days etc)
• Consensus on who executes
• Also considered Lightweight
• 2k lines of Scala
• in it’s context… well, it is!
https://www.youtube.com/watch?v=FLqURrtS8IA
Persistent, reliable job scheduler: Chronos
Definitely NOT for:
• millions of tasks inserted per second
• to be run in the next second
… that’s what the the Akka scheduler is for!
Persistent, reliable job scheduler: Chronos
Definitely NOT for:
• millions of tasks inserted per second
• to be run in the next second
… that’s what the the Akka scheduler is for!
Notable mention: Quartz 

(well known long-term scheduler,
with Akka integration and persistence)
“Stream”
What does it mean?!
* when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording.
Suddenly everyone jumped on the word “Stream”.
Akka Streams / Reactive Streams started end-of-2013.
“Streams”
* when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording.
Suddenly everyone jumped on the word “Stream”.
Akka Streams / Reactive Streams started end-of-2013.
“Streams”
Akka Streams
Reactive Streams
RxJava “streams”*
Spark Streaming
Apache Storm “streams”*
Java Steams (JDK8)
Reactor “streams”*
Kafka Streams
ztellman / Manifold (Clojure)
* when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording.
Apache GearPump “streams”
Apache [I] Streams (!)
Apache [I] Beam “streams”
Apache [I] Quarks “streams”
Apache [I] Airflow “streams” (dead?)
Apache [I] Samza
Scala Stream
Scalaz Streams, now known as FS2
Swave.io
Java InputStream / OutputStream / … :-)
A core feature not obvious to the untrained eye…!
Akka Streams / HTTP
Quiz time!
TCP is a ______ protocol?
A core feature not obvious to the untrained eye…!
Akka Streams / HTTP
Quiz time!
TCP is a STREAMING protocol!
Streaming from Akka HTTP
No demand from TCP
=
No demand upstream
=
Source won’t generate tweets
Streaming from Akka HTTP
No demand from TCP
=
No demand upstream
=
Source won’t generate tweets
=>
Bounded memory
stream processing!
Binary Compatibility
A.K.A. “The thing you think you want, but you actually want much more”
Brian Goetz, Java Language Architect, “Stewardship: The sobering parts”

https://www.youtube.com/watch?v=2y5Pv4yN0b0
Compatibilities intertwined
Scala versioning scheme is:
Epoch.Major.Minor
Technically Java too is 1.6, 1.7, 1.8 by the way.
Akka releases closely track Scala versions.
Serialization Compatibility
=> Akka Persistence, (experimental in 2.3.x)
Experimental version accidentally used
Java Serialization for Scala’s Option.
Akka now released to both Scala: 2.10 and 2.11.
Scala’s Option changed its serialised form slightly.
Akka Persistence is geared towards long-term
storage of events – even if experimental, we did not
want to block anyone from upgrading to 2.11…!
Serialization Compatibility
=> Akka Persistence, in this specific place,
provides Serialization compatibility of raw Scala
where Scala was allowed to break it.
Because we care about you :-)
// If we are allowed to break serialization compatibility of stored snapshots in 2.4
// we can remove this attempt to deserialize SnapshotHeader with JavaSerializer.
// Then the class SnapshotHeader can be removed. See issue #16009
val oldHeader =
if (readShort(in) == 0xedac) { // Java Serialization magic value with swapped bytes
val b = if (SnapshotSerializer.doPatch) patch(headerBytes) else headerBytes
serialization.deserialize(b, classOf[SnapshotHeader]).toOption
} else None
Serialization Compatibility
Plenty of work goes completely un-seen,
“if it works as it should, you don’t see it”.
The Scala ecosystem has matured,
that many projects really care and tend those aspects.
“Why don’t we just magically…”
“In terms of magic in Akka…
we prefer to have None of it.”
quoting myself in silly attempt to coin a phrase (-:
“Why don’t we just magically…”
nums.foldingLeft(0)(_ + _)
nums.foldingLeft(0)(_ + _)
// Summing up:
A hidden force behind all our successes…
Before we sum up:
A hidden force behind all our successes…
You!
The Scala community as a whole,
thank you!
Before we sum up:
Everything is a tradeoff.
If you can’t see the tradeoff, look again.
Some things…
you don’t need to see,
some things you do.
Pick wisely.
Don’t believe in “oh yeah it’s magic”.
Seek deeper understanding of things.
Keep learning: “Life is Study!”
Summing up
‫רבה‬ ‫!תודה‬
Thanks for listening!
ktoso @ typesafe.com
twitter: ktosopl
github: ktoso
team blog: letitcrash.com
home: akka.io
Thus spake the Master Programmer:
“After three days without programming,
life becomes meaningless.”
Q/A
(Now’s the time to ask things!)
ktoso @ lightbend.com
twitter: ktosopl
github: ktoso
blog: kto.so
home: akka.io

Contenu connexe

Tendances

Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Konrad Malawski
 
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Konrad Malawski
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka StreamsKonrad Malawski
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...Konrad Malawski
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemKonrad Malawski
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketKonrad Malawski
 
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka StreamsFresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka StreamsKonrad Malawski
 
Akka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignAkka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignLightbend
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Johan Andrén
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Konrad Malawski
 
The dark side of Akka and the remedy
The dark side of Akka and the remedyThe dark side of Akka and the remedy
The dark side of Akka and the remedykrivachy
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupRoy Russo
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka featuresGrzegorz Duda
 
Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)Jonas Bonér
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...All Things Open
 
Akka Futures and Akka Remoting
Akka Futures  and Akka RemotingAkka Futures  and Akka Remoting
Akka Futures and Akka RemotingKnoldus Inc.
 
Reactive Programming with Rx
 Reactive Programming with Rx Reactive Programming with Rx
Reactive Programming with RxC4Media
 

Tendances (20)

Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!
 
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka Streams
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM Ecosystem
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to Socket
 
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka StreamsFresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
 
Akka and the Zen of Reactive System Design
Akka and the Zen of Reactive System DesignAkka and the Zen of Reactive System Design
Akka and the Zen of Reactive System Design
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"
 
The dark side of Akka and the remedy
The dark side of Akka and the remedyThe dark side of Akka and the remedy
The dark side of Akka and the remedy
 
Zen of Akka
Zen of AkkaZen of Akka
Zen of Akka
 
Actor Model Akka Framework
Actor Model Akka FrameworkActor Model Akka Framework
Actor Model Akka Framework
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
 
Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
Akka Futures and Akka Remoting
Akka Futures  and Akka RemotingAkka Futures  and Akka Remoting
Akka Futures and Akka Remoting
 
Introducing Akka
Introducing AkkaIntroducing Akka
Introducing Akka
 
Reactive Programming with Rx
 Reactive Programming with Rx Reactive Programming with Rx
Reactive Programming with Rx
 

En vedette

Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016Konrad Malawski
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRKKonrad Malawski
 
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)Konrad Malawski
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceKonrad Malawski
 
Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Konrad Malawski
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsKonrad Malawski
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesKonrad Malawski
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
Logging in Scala
Logging in ScalaLogging in Scala
Logging in ScalaJohn Nestor
 
Univeristy of Michigan study: Climate change
Univeristy of Michigan study: Climate change Univeristy of Michigan study: Climate change
Univeristy of Michigan study: Climate change ourclimatematters
 
I see something in you but i don't know what it is
I see something in you but i don't know what it is I see something in you but i don't know what it is
I see something in you but i don't know what it is Malik Umar Hayat
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Timothy Perrett
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceKonrad Malawski
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsKonrad Malawski
 
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...Jamal Mirza
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceKonrad Malawski
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Konrad Malawski
 

En vedette (17)

Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
 
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka Persistence
 
Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka Streams
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
Logging in Scala
Logging in ScalaLogging in Scala
Logging in Scala
 
Univeristy of Michigan study: Climate change
Univeristy of Michigan study: Climate change Univeristy of Michigan study: Climate change
Univeristy of Michigan study: Climate change
 
I see something in you but i don't know what it is
I see something in you but i don't know what it is I see something in you but i don't know what it is
I see something in you but i don't know what it is
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open source
 
JavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good PartsJavaOne 2013: Java 8 - The Good Parts
JavaOne 2013: Java 8 - The Good Parts
 
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...
Janab e Zainab Ki Shakhsiyat (Hindi) - By: Syed ul Ulema Syed Ali Naqi Naqvi ...
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka Persistence
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014
 

Similaire à Scala, Akka & Software Tradeoffs Explored

Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insAndrew Dupont
 
Oop2010 Scala Presentation Stal
Oop2010 Scala Presentation StalOop2010 Scala Presentation Stal
Oop2010 Scala Presentation StalMichael Stal
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
 
Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Davide Cerbo
 
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...Andrew Phillips
 
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...Andrew Phillips
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Decompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationDecompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationJames Hamilton
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipseanshunjain
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8 Dori Waldman
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To ScalaPeter Maas
 

Similaire à Scala, Akka & Software Tradeoffs Explored (20)

Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-ins
 
Oop2010 Scala Presentation Stal
Oop2010 Scala Presentation StalOop2010 Scala Presentation Stal
Oop2010 Scala Presentation Stal
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)
 
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...
BASE Meetup: "Analysing Scala Puzzlers: Essential and Accidental Complexity i...
 
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...
Scala Up North: "Analysing Scala Puzzlers: Essential and Accidental Complexit...
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Scala ntnu
Scala ntnuScala ntnu
Scala ntnu
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Scala presentationjune112011
Scala presentationjune112011Scala presentationjune112011
Scala presentationjune112011
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Decompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 PresentationDecompiling Java - SCAM2009 Presentation
Decompiling Java - SCAM2009 Presentation
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
 

Dernier

Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Dernier (20)

Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Scala, Akka & Software Tradeoffs Explored

  • 1. Konrad `@ktosopl` Malawski @ Scalapeno 2016 q The things we don’t see Exploring the unseen worlds of the Scala, Akka and Software in general
  • 2. Konrad `@ktosopl` Malawski @ Scalapeno 2016 The things we don’t see Exploring the unseen worlds of the Scala, Akka and Software in general
  • 3. Konrad `@ktosopl` Malawski akka.io typesafe.com geecon.org Java.pl / KrakowScala.pl sckrk.com / meetup.com/Paper-Cup @ London GDGKrakow.pl lambdakrk.pl
  • 4.
  • 5. “The things we don’t see” What it means (at least for me, and in this talk) … in Software in general … in Scala (programming languages) … in Akka (concurrency, distributed systems)
  • 6. The things we don’t see… in Software
  • 7. A world of tradeoffs Reality
  • 8. A world of tradeoffs Reality
  • 9. A world of tradeoffs Reality
  • 10. A world of tradeoffs Reality
  • 11. A world of tradeoffs Reality At the core of it… This talk is about trade-offs.
  • 13. Measure What we can’t measure, we can’t improve. And often: simply don’t improve at all.
  • 14. Measure What we can’t measure, we can’t improve. And often: simply don’t improve at all. “ArrayDeque surely will be faster here!” Wha..! Turns out it isn’t, let’s see why…
  • 15. Measure, to gain understanding of your system OMG! I changed all the settings to “more”! And it’s not improving…!
  • 16. Measure, to gain understanding of your system OMG! I changed all the settings to “more”! And it’s not improving…! Hmm… weird. Where do you see the bottleneck?
  • 17. Measure, to gain understanding of your system OMG! I changed all the settings to “more”! And it’s not improving…! Hmm… weird. Where do you see the bottleneck?
  • 18. Measure, and don’t be that guy OMG! That lib is 1000x better in serving a file!!! I’ll use kernel bypass networking for my blog! Have & understand actual performance requirements, don’t invent them based on high frequency trading* talks :-) * I’m assuming here that’s not your business, if it is – carry on.
  • 19. Systems, what do they do?!
  • 20. Systems, what do they do?!
  • 21. Systems, what do they do?!
  • 22. Systems, what do they do?!
  • 23. Systems, what do they do?!
  • 24. Systems, what do they do?!
  • 25. The things we don’t see… in Scala
  • 26. A thing about nulls
  • 27. A thing about nulls "I call it my billion-dollar mistake."
 Sir C.A. R. Hoare, on his invention of the null reference
  • 28. A thing about nulls something.calculateSum(2, 2) What does this code do?
  • 29. A thing about nulls something.calculateSum(2, 2) What does this code do? a) return 4 b) NullPointerException! c) System.exit(0) // though I have a love-hate relationship with this answer…
  • 30. The curious case of Options Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165) Guava Optional – 2011 (since v10.0) Java Optional – 2014 (since v1.8)
  • 31. Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165) Guava Optional – 2011 (since v10.0) Java Optional – 2014 (since v1.8) The curious case of Options sealed abstract class Option[+A] extends Product with Serializable { self => def isEmpty: Boolean def isDefined: Boolean = !isEmpty def get: A @inline final def getOrElse[B >: A](default: => B): B = if (isEmpty) default else this.get
  • 32. Scala Option – 2007 (Scala 2.5, sic! http://www.scala-lang.org/old/node/165) Guava Optional – 2011 (since v10.0) Java Optional – 2014 (since v1.8) The curious case of Options sealed abstract class Option[+A] extends Product with Serializable { self => def isEmpty: Boolean def isDefined: Boolean = !isEmpty def get: A @inline final def getOrElse[B >: A](default: => B): B = if (isEmpty) default else this.get public final class Optional<T> { 
 public boolean isPresent() { return value != null; } 
 public T get() { if (value == null) throw new NoSuchElementException("No value present"); return value; } public T orElseGet(Supplier<? extends T> other) { return value != null ? value : other.get(); }
  • 33. The curious case of Options val o: Option[String] = ??? o.foreach(_.toUpperCase(Locale.ROOT)) // ok, sure o match { case Some(value) => value.toUpperCase(Locale.ROOT) case None => "_" } We all have the same “mistake”: get seems innocent, but it’s not… final Optional<String> optional = Optional.of(""); optional.map(it -> it.toUpperCase(Locale.ROOT)); if (optional.isPresent()) { optional.get().toUpperCase(); }
  • 34. Can we do better than that though? “What the eyes don’t see, the programmer does not invoke.”
  • 35. Blocking is the new “you broke the build!”
  • 36. Blocking is the new “you broke the build!” // BAD! (due to the blocking in Future): implicit val defaultDispatcher = system.dispatcher val routes: Route = post { complete { Future { // uses defaultDispatcher Thread.sleep(5000) // will block on the default dispatcher, System.currentTimeMillis().toString // starving the routing infra } } }
  • 37. Blocking is the new “you broke the build!” // BAD! (due to the blocking in Future): implicit val defaultDispatcher = system.dispatcher val routes: Route = post { complete { Future { // uses defaultDispatcher Thread.sleep(5000) // will block on the default dispatcher, System.currentTimeMillis().toString // starving the routing infra } } } http://stackoverflow.com/questions/34641861/akka-http-blocking-in-a-future-blocks-the-server/34645097#34645097
  • 38. The curious case of Futures
  • 39. The curious case of Futures public class CompletableFuture<T> implements Future<T>, CompletionStage<T> { public T get() throws InterruptedException, ExecutionException { // ... } public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { // ... }
  • 40. The curious case of Futures Anyone remember the days before scala.concurrent.Future? Back to the Future, in which we discuss Akka and Twitter Futures in 2012 :-) https://groups.google.com/forum/?fromgroups=#!topic/akka-user/eXiBV5V7ZzE%5B1-25%5D
  • 41. The curious case of Futures public class CompletableFuture<T> implements Future<T>, CompletionStage<T> { public T get() throws InterruptedException, ExecutionException { // ... } public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { // ... } trait Future[+T] extends Awaitable[T] { // THERE IS NO GET! // Closest thing to it is... def value: Option[Try[T]] // However it’s not that widely known actually // Notice that it is non-blocking!
  • 42. The curious case of Futures public class CompletableFuture<T> implements Future<T>, CompletionStage<T> { public T get() throws InterruptedException, ExecutionException { // ... } public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { // ... } trait Future[+T] extends Awaitable[T] { // THERE IS NO GET! // Closest thing to it is... def value: Option[Try[T]] // However it’s not that widely known actually // Notice that it is non-blocking!
  • 43. The curious case of Futures public class CompletableFuture<T> implements Future<T>, CompletionStage<T> { public T get() throws InterruptedException, ExecutionException { // ... } public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { // ... } trait Future[+T] extends Awaitable[T] { // THERE IS NO GET! // Closest thing to it is... def value: Option[Try[T]] // However it’s not that widely known actually // Notice that it is non-blocking! object Await { @throws(classOf[TimeoutException]) @throws(classOf[InterruptedException]) def ready[T](awaitable: Awaitable[T], atMost: Duration): awaitable.type = blocking(awaitable.ready(atMost)(AwaitPermission)) @throws(classOf[Exception]) def result[T](awaitable: Awaitable[T], atMost: Duration): T = blocking(awaitable.result(atMost)(AwaitPermission)) }
  • 44. The curious case of Futures Java strongly valued fitting-in with existing types. This forced exposing the get() method. Scala had a clean-slate, could keep out of sight methods we don’t want devs to call as they’re dangerous. “If you don’t see a way at first sight… maybe it was hidden on purpose?”
  • 46. Hidden scaladoc features Akka HTTP 2.4.2 we didn’t know about the hidden feature as well actually :-)
  • 47. Hidden scaladoc features Akka HTTP 2.4.4 Started using the scaladoc @group feature.
  • 48. Hidden scaladoc features Akka HTTP 2.4.4 Started using the scaladoc @group feature.
  • 49. Hidden scaladoc features Akka HTTP 2.4.4 Started using the scaladoc @group feature. /** * @groupname basic Basic directives * @groupprio basic 10 */ trait BasicDirectives { /** * @group basic */ def mapInnerRoute(f: Route Route): Directive0 = Directive { inner f(inner(())) } /** * @group basic */ def mapRequestContext(f: RequestContext RequestContext): Directive0 = mapInnerRoute { inner ctx inner(f(ctx)) } // unlocked by: scala -groups
  • 51. Trait representation, in Scala 2.11 trait T { def foo = "bar!" } class A extends T class B extends T with SomethingElse
  • 54. ./target/scala-2.11/classes/scalapeno/Example$class.class ./target/scala-2.11/classes/scalapeno/Example.class Trait representation, in Scala 2.11 $ javap -v ./target/scala-2.11/classes/scalapeno/Example.class Classfile target/scala-2.11/classes/scalapeno/Example.class Last modified 25-Apr-2016; size 475 bytes MD5 checksum fe12967b00411cde03bdc57f0ca6869b Compiled from "Example.scala" public interface scalapeno.Example minor version: 0 major version: 50 flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT { public abstract java.lang.String newMethod(); descriptor: ()Ljava/lang/String; flags: ACC_PUBLIC, ACC_ABSTRACT }
  • 55. ./target/scala-2.11/classes/scalapeno/Example$class.class ./target/scala-2.11/classes/scalapeno/Example.class Trait representation, in Scala 2.11 $ javap -v ./target/scala-2.11/classes/scalapeno/Example.class Classfile target/scala-2.11/classes/scalapeno/Example.class Last modified 25-Apr-2016; size 475 bytes MD5 checksum fe12967b00411cde03bdc57f0ca6869b Compiled from "Example.scala" public interface scalapeno.Example minor version: 0 major version: 50 flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT { public abstract java.lang.String newMethod(); descriptor: ()Ljava/lang/String; flags: ACC_PUBLIC, ACC_ABSTRACT } $ javap -v ./target/scala-2.11/classes/scalapeno/Example$class.class Classfile target/scala-2.11/classes/scalapeno/Example$class.class Last modified 01-May-2016; size 450 bytes MD5 checksum ea679b7db9d6275dbe9dff53475000c2 Compiled from "Example.scala" public abstract class scalapeno.Example$class minor version: 0 major version: 50 flags: ACC_PUBLIC, ACC_SUPER, ACC_ABSTRACT public static java.lang.String newMethod(scalapeno.Example); descriptor: (Lscalapeno/Example;)Ljava/lang/String; flags: ACC_PUBLIC, ACC_STATIC Code: stack=1, locals=1, args_size=1 0: ldc #9 // String 2: areturn
  • 56. New trait encoding using default methods https://github.com/scala/scala/pull/5003 Trait representation, in Scala 2.12
  • 57. ./target/scala-2.12.0-M4/classes/scalapeno/Example.class Trait representation, in Scala 2.12 $ javap -v ./target/scala-2.12.0-M4/classes/scalapeno/Example.class Classfile scala-2.12.0-M4/classes/scalapeno/Example.class Last modified 25-Apr-2016; size 684 bytes MD5 checksum 07bad6e3b9c5d73b1276e5e7af937e29 Compiled from "Example.scala" public interface scalapeno.Example minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT { public java.lang.String newMethod(); descriptor: ()Ljava/lang/String; flags: ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: ldc #12 // String 2: areturn LocalVariableTable: Start Length Slot Name Signature 0 3 0 this Lscalapeno/Example; LineNumberTable: line 4: 0
  • 58. The things we don’t see… in…
  • 59. The things we don’t see… in ‫ַּכֹו‬‫ע‬?
  • 60. The things we don’t see in… The Queen of Laponia?!
  • 61. The things we don’t see… in Akka, the open source project.
  • 63. Akka Actor in one sentence: Messaging as a core abstraction, not slap-on afterthought. Messages! Not method calls. Akka in one sentence: A toolkit for building highly distributed and concurrent apps.
  • 64. Messages! Not method calls. http://c2.com/cgi/wiki?AlanKayOnMessaging
  • 65. Messages! Not method calls. Waldo J,Wyant G,Wollrath A, Kendall S.A @ Sun Microsystems Laboratories. 1994. Note on Distributed Computing
  • 66. Messages! Not method calls. Methods: // locally: val value: Long = local.calculateSum(2, 2) // if it’s parallel then we need some middle man to handle concurrency issues hm… // but remote will have big latency so... val value: Future[Long] = remote.calculateSum(2, 2) // Q1: what is actually put on the wire? // Q2: what about retrying to different host, // - now need magic to handle it... // Q3: can the downstream directly respond to upstream? // - ok, so we could build a special method that does this // Q4: what if the networking breaks...? Do I need to try/catch? // ... but why, if it could be a simple message send :-)
  • 67. Messages! Not method calls. Methods: // locally: val value: Long = local.calculateSum(2, 2) // if it’s parallel then we need some middle man to handle concurrency issues hm… // but remote will have big latency so... val value: Future[Long] = remote.calculateSum(2, 2) // Q1: what is actually put on the wire? // Q2: what about retrying to different host, // - now need magic to handle it... // Q3: can the downstream directly respond to upstream? // - ok, so we could build a special method that does this // Q4: what if the networking breaks...? Do I need to try/catch? // ... but why, if it could be a simple message send :-) Messages: // locally: local ! CalculateSum(2, 2) // I'll get a reply in a bit, or I can retry etc etc. // Actor is can be running in parallel, on multi-core etc, same API. // what can happen? // JVM can crash => effectively message loss // remotely remote ! CalculateSum(2, 2) // what can happen? // message loss // receiver of the msg can crash... => message loss
  • 68. Messages! Not method calls. class OneWayProxyActor extends Actor { val downstream: ActorRef = ??? def receive = { case StateQuery(q) => sender() ! run(q) case req: IncomingRequest => downstream forward transformed(req) } def run(any: Any) = ??? }
  • 69. Messages! Not method calls. What do we not see in these scenarios though?
  • 70. Messages! Not method calls. What do we not see in these scenarios though? Local synchronous methods are trivial to trace: that’s what a StackTrace is. But the tradeoff is very high: scalability / resilience – all lost.
  • 71. Messages! Not method calls. What do we not see in these scenarios though? Local synchronous methods are trivial to trace: that’s what a StackTrace is. But the tradeoff is very high: scalability / resilience – all lost. Tracing async / distributed systems is not quite solved yet… Dapper / Zipkin are not a new things, they’re the beginning of a journey – not the complete solution…
  • 72. Messages! Not method calls. I can totally do the same with REST HTTP calls!
  • 73. Messages! Not method calls. I can totally do the same with REST HTTP calls! Sure you can (201, 204), but: In Akka that’s both default, and exactly 40bytes cheap.
  • 75. Encapsulation, so nice… Messages! Not exposing state. class ComplexLogic { def add(i: Item): ComplexLogic def apply(): Effect }
  • 76. But it’s “only for testing”! Messages! Not exposing state. getter class ComplexLogic { def add(i: Item): ComplexLogic def apply(): Effect def state: State }
  • 77. Messages! Not exposing state. val logicActor: ActorRef = ??? // no way to access state - for your own good. logicActor ! Add(item) logicActor ! Add(item) logicActor ! Apply expectMsgType[StateAppliedSuccessfully] Test: yes: behaviour and interactions, not: raw state.
  • 78. “I want my words back.” Roland Kuhn (former Akka Team lead)
  • 79. We want our words back…! Two examples of name-collisions causing confusion: “Scheduler” & “Stream” Naming is hard…
  • 81. “Scheduler” - but is it the right one? class CountdownActor extends Actor { val untilEndOfWorld = 127.days // according to mayan prophecy // oh, great, a scheduler! val scheduler = context.system.scheduler scheduler.scheduleOnce(untilEndOfWorld, self, EndOfTheWorld) def receive = { case EndOfTheWorld => println("Aaaaa!!!") } } http://doc.akka.io/docs/akka/2.4.4/scala/scheduler.html#scheduler-scala
  • 82. “Scheduler” - but is it the right one? class CountdownActor extends Actor { val untilEndOfWorld = 127.days // according to mayan prophecy // oh, great, a scheduler! val scheduler = context.system.scheduler scheduler.scheduleOnce(untilEndOfWorld, self, EndOfTheWorld) def receive = { case EndOfTheWorld => println("Aaaaa!!!") } }
  • 84. Into the akka.actor.dungeon Technically LARS is not in the dungeon, but couldn’t stop myself from making this reference…
  • 85. “Scheduler” - but is it the right one?
  • 86. “Scheduler” - but is it the right one?
  • 87. It’s a plain “Hashed Wheel Timer” though!
  • 88. It’s a plain “Hashed Wheel Timer” though!
  • 89. It’s a plain “Hashed Wheel Timer” though! Optimised for: • high performance • lockless insertion • O(1) insertion • huge amounts of tasks
 // timeouts - on each request, ask timeouts Original white paper: Hashed and Hierarchical Timing Wheels: https://pdfs.semanticscholar.org/0a14/2c84aeccc16b22c758cb57063fe227e83277.pdf
  • 90. It’s a plain “Hashed Wheel Timer” though! Optimised for: • high performance • lockless insertion • O(1) insertion • huge amounts of tasks
 // timeouts - on each request, ask timeouts Not for: • preciseness • persistence Original white paper: Hashed and Hierarchical Timing Wheels: https://pdfs.semanticscholar.org/0a14/2c84aeccc16b22c758cb57063fe227e83277.pdf
  • 91. Akka’s Scheduler fun facts! • Akka impl. after Netty implementation • Akka impl. improved performance quite a bit • Netty pulled-in the optimisations (just one of multiple (both way) healthy interactions)
 => Yay, healthy Open Source ecosystem!
  • 92. Akka’s Scheduler fun facts! Error message you’ll likely never see: LightArrayRevolverScheduler for short: “LARS”
  • 93. Akka’s Scheduler fun facts! Error message you’ll likely never see: LightArrayRevolverScheduler for short: “LARS” “LARS cannot start new thread, ship’s going down!”
  • 94. Persistent, reliable job scheduler Ok, so what do we need for it?
  • 95. Persistent, reliable job scheduler: Chronos Ok, so what do we need? • Persistence • Replication • Consensus on who executes
  • 96. Persistent, reliable job scheduler: Chronos Optimised for: • ”Like CRON, but distributed” • Visibility, including management UI • Retries of failed tasks • Far-out tasks (usually measured in days etc) • Consensus on who executes • Also considered Lightweight • 2k lines of Scala • in it’s context… well, it is! https://www.youtube.com/watch?v=FLqURrtS8IA
  • 97. Persistent, reliable job scheduler: Chronos Definitely NOT for: • millions of tasks inserted per second • to be run in the next second … that’s what the the Akka scheduler is for!
  • 98. Persistent, reliable job scheduler: Chronos Definitely NOT for: • millions of tasks inserted per second • to be run in the next second … that’s what the the Akka scheduler is for! Notable mention: Quartz 
 (well known long-term scheduler, with Akka integration and persistence)
  • 99. “Stream” What does it mean?! * when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording.
  • 100. Suddenly everyone jumped on the word “Stream”. Akka Streams / Reactive Streams started end-of-2013. “Streams” * when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording.
  • 101. Suddenly everyone jumped on the word “Stream”. Akka Streams / Reactive Streams started end-of-2013. “Streams” Akka Streams Reactive Streams RxJava “streams”* Spark Streaming Apache Storm “streams”* Java Steams (JDK8) Reactor “streams”* Kafka Streams ztellman / Manifold (Clojure) * when put in “” the word does not appear in project name, but is present in examples / style of APIs / wording. Apache GearPump “streams” Apache [I] Streams (!) Apache [I] Beam “streams” Apache [I] Quarks “streams” Apache [I] Airflow “streams” (dead?) Apache [I] Samza Scala Stream Scalaz Streams, now known as FS2 Swave.io Java InputStream / OutputStream / … :-)
  • 102. A core feature not obvious to the untrained eye…! Akka Streams / HTTP Quiz time! TCP is a ______ protocol?
  • 103. A core feature not obvious to the untrained eye…! Akka Streams / HTTP Quiz time! TCP is a STREAMING protocol!
  • 104. Streaming from Akka HTTP No demand from TCP = No demand upstream = Source won’t generate tweets
  • 105. Streaming from Akka HTTP No demand from TCP = No demand upstream = Source won’t generate tweets => Bounded memory stream processing!
  • 106. Binary Compatibility A.K.A. “The thing you think you want, but you actually want much more” Brian Goetz, Java Language Architect, “Stewardship: The sobering parts”
 https://www.youtube.com/watch?v=2y5Pv4yN0b0
  • 107. Compatibilities intertwined Scala versioning scheme is: Epoch.Major.Minor Technically Java too is 1.6, 1.7, 1.8 by the way. Akka releases closely track Scala versions.
  • 108. Serialization Compatibility => Akka Persistence, (experimental in 2.3.x) Experimental version accidentally used Java Serialization for Scala’s Option. Akka now released to both Scala: 2.10 and 2.11. Scala’s Option changed its serialised form slightly. Akka Persistence is geared towards long-term storage of events – even if experimental, we did not want to block anyone from upgrading to 2.11…!
  • 109. Serialization Compatibility => Akka Persistence, in this specific place, provides Serialization compatibility of raw Scala where Scala was allowed to break it. Because we care about you :-) // If we are allowed to break serialization compatibility of stored snapshots in 2.4 // we can remove this attempt to deserialize SnapshotHeader with JavaSerializer. // Then the class SnapshotHeader can be removed. See issue #16009 val oldHeader = if (readShort(in) == 0xedac) { // Java Serialization magic value with swapped bytes val b = if (SnapshotSerializer.doPatch) patch(headerBytes) else headerBytes serialization.deserialize(b, classOf[SnapshotHeader]).toOption } else None
  • 110. Serialization Compatibility Plenty of work goes completely un-seen, “if it works as it should, you don’t see it”. The Scala ecosystem has matured, that many projects really care and tend those aspects.
  • 111. “Why don’t we just magically…” “In terms of magic in Akka… we prefer to have None of it.” quoting myself in silly attempt to coin a phrase (-:
  • 112. “Why don’t we just magically…”
  • 115. A hidden force behind all our successes… Before we sum up:
  • 116. A hidden force behind all our successes… You! The Scala community as a whole, thank you! Before we sum up:
  • 117. Everything is a tradeoff. If you can’t see the tradeoff, look again. Some things… you don’t need to see, some things you do. Pick wisely. Don’t believe in “oh yeah it’s magic”. Seek deeper understanding of things. Keep learning: “Life is Study!” Summing up
  • 118. ‫רבה‬ ‫!תודה‬ Thanks for listening! ktoso @ typesafe.com twitter: ktosopl github: ktoso team blog: letitcrash.com home: akka.io Thus spake the Master Programmer: “After three days without programming, life becomes meaningless.”
  • 119. Q/A (Now’s the time to ask things!) ktoso @ lightbend.com twitter: ktosopl github: ktoso blog: kto.so home: akka.io