akka presentation schule@synyx

38
Florian Hopf http://blog.florian-hopf.de

Upload: florian-hopf

Post on 26-Jan-2015

120 views

Category:

Technology


2 download

DESCRIPTION

Demonstration of a web crawler implemented using Akka. Link to the sources coming soon.

TRANSCRIPT

Page 1: Akka Presentation Schule@synyx

Florian Hopfhttp://blog.florian-hopf.de

Page 2: Akka Presentation Schule@synyx

DownloadPage

IndexContent

Parse Links& Content

Link downloaded already?

Page 3: Akka Presentation Schule@synyx

Sequential Example

Page 4: Akka Presentation Schule@synyx

1. Scale Up

Page 5: Akka Presentation Schule@synyx

Thread A Thread BPageStore

Page 6: Akka Presentation Schule@synyx

Thread A Thread BPageStore

Synchronize and Suffer

Page 7: Akka Presentation Schule@synyx
Page 8: Akka Presentation Schule@synyx
Page 9: Akka Presentation Schule@synyx
Page 10: Akka Presentation Schule@synyx
Page 11: Akka Presentation Schule@synyx

Actor-Framework

Page 12: Akka Presentation Schule@synyx

Message PassingConcurrency

Page 13: Akka Presentation Schule@synyx

Actor A Actor B

Thread A Thread B

Page 14: Akka Presentation Schule@synyx

Master

IndexingActor

PageParsingActor

PageStoreFetch

Page

PageContent

IndexPage

Indexed

Page 15: Akka Presentation Schule@synyx

Simple Example

Page 16: Akka Presentation Schule@synyx

Actors are accessedby references

Page 17: Akka Presentation Schule@synyx

ActorInstance

Reference

Page 18: Akka Presentation Schule@synyx

ActorInstance

Reference

ActorInstanceActor

Instancen

ActorInstances

Page 19: Akka Presentation Schule@synyx

Fetching Pagesin parallel

Page 20: Akka Presentation Schule@synyx

2. Scale Out

Page 21: Akka Presentation Schule@synyx

References can pointto remote machines

Page 22: Akka Presentation Schule@synyx

akka {     actor {     deployment {     /serviceA/aggregation {     router = "round­robin"     nr­of­instances = 10     target {     nodes = 

["akka://[email protected]:2552", "akka://[email protected]:2552"]

     }     }     }     }    }

Page 23: Akka Presentation Schule@synyx

3. Fault Tolerance

Page 24: Akka Presentation Schule@synyx

Actors are supervisedby their parent

Page 25: Akka Presentation Schule@synyx

Master

IndexingActor

PageParsingActor

PageStore

Page 26: Akka Presentation Schule@synyx

ActorInstance

Reference

Page 27: Akka Presentation Schule@synyx

Master

IndexingActor

PageParsingActor

PageStore

Page 28: Akka Presentation Schule@synyx

ActorInstance

Reference

Page 29: Akka Presentation Schule@synyx

Actions:EscalateResumeRestart

Stop

Page 30: Akka Presentation Schule@synyx

Network fail on download

Page 31: Akka Presentation Schule@synyx

Master

IndexingActor

PageParsingActor

PageStore

Page 32: Akka Presentation Schule@synyx

Resume PageParsingActor, resend message

Page 33: Akka Presentation Schule@synyx

Indexing Failure, I/O Error

Page 34: Akka Presentation Schule@synyx

Master

IndexingActor

PageParsingActor

PageStore

Page 35: Akka Presentation Schule@synyx

Restart Master

Page 36: Akka Presentation Schule@synyx

Scaling UpScaling Out

Fault Tolerance

Page 37: Akka Presentation Schule@synyx

Software Transactional Memory

Durable Mailboxes

Page 38: Akka Presentation Schule@synyx

http://akka.io