tce introduction (scalability with scala and akka)

Post on 02-Jul-2015

461 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

The intro talk for Tikal Community Event on September 2013. Intended to be a warm-up for the next lectures on Akka and Scala for creating applications which utilize modern multicore systems.

TRANSCRIPT

Scala-bility

martes 10 de septiembre de 13

Puzzle: what is on the Y axis???

martes 10 de septiembre de 13

OMG, these MHzes don’t grow

anymore :(martes 10 de septiembre de 13

But imagine a beowulf cluster of

these!!!martes 10 de septiembre de 13

Is it possible to handle multiple tasks and not suffer?!

martes 10 de septiembre de 13

DEMO

martes 10 de septiembre de 13

We do it for ages!UNIX pipes connect parallel processes

easily:* Deterministic* Composable

martes 10 de septiembre de 13

Why is it so easy to be parallel with *nix CLI?

Designed to be parallel from the ground up

Designed to be functional from the ground up

Autonomic composable units of execution

martes 10 de septiembre de 13

Pipe example in Java

martes 10 de septiembre de 13

Are we there yet?Reliability?

Availability?Diagnostics?Distribution?

martes 10 de septiembre de 13

Doing it in Java built-inssynchronize, volatile

Collections.synchronized*

java.util.concurrent

java.nio

fork/join

martes 10 de septiembre de 13

High-level tools for Java async

Camel

Spring Integration

GridGain

Akka

martes 10 de septiembre de 13

Today we cover only two

Akka: you can stay in Java and scale vertically/horizontally - transparently

Scala: being functional allows to be parallel - easily

martes 10 de septiembre de 13

Scala: being functional

High order functions

Immutable data

Referential transparency

Lazy evaluation

Recursion (RecursiveAction, anyone?)

martes 10 de septiembre de 13

Scala: if you’re functional, you can be

parallel

import Math._

val r = 0 until 10000000 def f(x: Int) = log10 (pow(3,x *sin(x))) val m = r. map ( f )

r. forall ( i=> f(i)==m(i) ) //10seconds r. par. forall ( i=> f(i)==m(i) ) //5seconds

martes 10 de septiembre de 13

Same JVM, different languagesYou don’t have to choose. You can mix

them in the same project.

martes 10 de septiembre de 13

Right guys to follow ...Martin Odersky

Rod JohnsonJonas Bonér

martes 10 de septiembre de 13

... they already use it in

production

martes 10 de septiembre de 13

top related