2. PREVIOUS AGE OF COMPUTING SYSTEMS
• Monolith software architecture
• Managed servers and containers
• RDBMS, transactions isolation
• Scalability: scale-up by more powerful hardware
• Proprietary enterprise solutions
3. NEW CHALLENGES
• response time: s -> ms
• high availability: 3 nines (8h/y) -> 5+ nines (5– m/y)
• storage: GBs (10
9
) -> PBs (10
15
)+
• hardware: spread from mobile phone to 1000+
nodes cluster
8. STUBBORN AMDAHL’S LAW
The speedup of a program
using multiple processors in parallel computing
is limited by the sequential fraction of the program.
12. • rapid and consistent response times
• response in SLA time may be more
important than late correct response
• problems may be detected quickly
and dealt with effectively
react to users
Responsive
13. react to load
Elastic
• No contention points or central bottlenecks
• ability to shard or replicate components
and distribute inputs among them
• Automatic resource management
• scale-up
• scale-out
• scale-down
• scale-in
14. • “Let it crash!”: there is no way to think
about every single failure point
• failure is not dealt with as an error
• means that some capacity of the
system will be reduced
• dealt with as a message
react to failures
Resilient
15. Asynchronous message-passing
• loose coupling
• isolation of components
• location transparency
• failures as messages
Benefits:
• load management
• elasticity
• flow control (monitoring , back-pressure)
react to events
Message Driven
18. CARL HEWITT, 1973
ACTOR MODEL
• Describes:
• message processing algorithm
• data storage principles
• interaction between modules
• Erlang
• Used in telecommunication systems
• High Availability of 9 “nines”
19. • Written in Scala
• Stable since 2009
• Part of Scala Standard Library since 2013
• Supports Java 8 since 2014
by
ex
20. WHAT IS AN ACTOR?
Actor is a unit of code
with a mailbox
and an internal state
that just responds to messages
in a single thread
(briefly)
23. WHAT IS AN ACTOR?
• Similar to object in OOP, but message-driven
• Even more isolated than object: no explicit access
exposed (hidden behind ActorRef)
• no shared state
• location transparent (can live in different JVMs)
• Light-weight: 300B memory footprint (millions per GB)
• No threads allocated in idle state
• Single-threaded invocation inside, sequential message
processing
• Supervises children actors
24. WHAT CAN ACTOR DO?
• If no messages being processed:
• Nothing
• When message being processed (one at a time):
• make local decisions
• send messages to other actors (incl. sender() and self())
• do other actions with side-effects (IO, logs, DB access)
• change own behavior for next messages
• create more actors (and promise to supervise them)
25. BENEFITS
• You’re not going to have multiple threads modifying a
variable at the same time.
• Forget about:
• Shared state
• Threads
• Locks, “synchronized”
• Concurrent collections
• wait/notify/notifyAll
• Describe only business behavior in the code.
• Akka and app configuration care about everything else.
40. AKKA-STREAMS
• Implements Reactive Streams, transparently for
the user
• Uses Akka under the hood:
• Derived actors can be configured using akka
configuration
• Clustering, networking, HTTP, profiling tools
56. OTHER FEATURES OF AKKA-STREAMS
• mapAsync for external calls
• Custom shapes
• Subgraph customisation with Attributes
• Custom processing with GraphStage
• Operator Fusing
• Supervision Strategies via ActorMaterializerSettings
• Integration with other RS implementations
• Streams TestKit