Building Massively Scalable Applications With Akka

Post on 10-May-2015

2,954 views 6 download

Tags:

description

Session presented at the 6th IndicThreads.com Conference on Java held in Pune, India on 2-3 Dec. 2011. http://Java.IndicThreads.com --- Historically writing correct concurrent, scalable and fault-tolerant applications has been very hard. Akka is an attempt to simplify writing concurrent, scalable and highly available software for the JVM. Akka has an API both for Scala and Java. Akka uses the Actor Model together with Software Transactional Memory (STM) to raise the abstraction level. For fault-tolerance it adopts the “Let it crash” model which help in building self healing always on systems. The presentation walks through the Akka features for building a web scale system. We would look at a real world case study in which Inphina developed a web scale framework using Akka which is capable of processing 150 million streaming messages a day. We would discuss the architecture and key design decisions. http://www.indicthreads.com/9241/scalable-applications-with-akka/

transcript

1

Building Massively Scalable Applications with Akka

Vikas Hazrati

Inphina Technologies

2

what?

Platform for next generation, event driven, scalable and fault tolerant architectures on the

JVM.

3

akka

A actor-based concurrency framework

Provides solutions for non blocking concurrency

Written in Scala, also works in Java

Open source

Now at 1.3-RC2 (to be released this weekend)

Lead developer and founder: Jonas Boner

JRockit, AspectWerkz, AspectJ, Terracotta

4

issues

concurrency

scalability

fault tolerance

5

why akka

simpler concurrency

event driven

scale up or scale out

fault tolerance

remoting

scala and java api

6

aha actors!

message-Passing Concurrency

share NOTHING

isolated lightweight processes

communicates through messages

asynchronous and non-blocking

7

actors

defined in the 1973 paper by Carl Hewitt

popularized by Erlang

alleviates the dev

from explicit locking

and thread management

easy to write concurrent and parallel systems

actors like objects BUT dont share state

8

actor models

Thread-based

Event-based• Very lightweight

• can easily create millions on a single

workstation

(6.5 million on 4 G RAM)

9

10

defining an actor

11

firing messages

bang bang bang

12

send anything

13

fault tolerance

let it crash

linked set of actors

14

all for one

15

one for one

16

supervisor hierarchies

17

fault management

18

other concepts

Remote Actors

Akka STM

Akka Serialization

Persistence

19

problem statement

20

considerations

21

hmm...

STM – X

Serialization – X

Persistence – X

Remoting – ?/X

22

23

24

25

issues

maxing out on the os threads

26

dispatchers

thread based – dedicated os thread bound

event based – backed by pool of threads

priority event based

work stealing

27

28

ala carte'

29

used in ...

30

more information

http://akka.io/docs/akka/1.3-RC1/intro

http://thoughts.inphina.com/tag/akka/

31

Everyone ! “Thanks”

vhazrati@inphina.com@vhazrati