Akka Flashcards
Akka is made up of
Modules that are distributed as JAR files
What does the Akka concept of ‘let it crash?’ anticipate
There will be cases of individual handlers failing to carry out their tasks, and it is prepared to reroute that work to avoid a catastrophic failure.
What happens if the failure occurs up the chain?
Underlings can carry on until a new supervisor arrives. There is no broken chain, and most importantly, it is no longer the duty of the developer to find all the ways that chain might break catastrophically and provide specialized handling for each case
Actors are lightweight because
They run on top of dispatchers
How many threads fit in 1GB of memory and how many actors
4096
2.7 Million
How do you get an actor reference to an actor in the hierarchy?
You use the actor path
actors are a lot like ___________ without the configuration and ________ ________
installation overhead
message queues
message broker
Messages are simple data structures that …
can’t be changed after they’ve been created,
or in a single word, they’re immutable.
Actors can receive messages one at a time and execute some behaviour whenever a
message is received. Unlike queues, they can
also send messages
What are the points made in the reactive manifesto
Blocking I/O limits opportunities for parallelism, so nonblocking I/O is preferred.
Synchronous interaction limits opportunities for parallelism, so asynchronous interaction is preferred.
Polling reduces opportunity to use fewer resources, so an event-driven style is preferred.
If one node can bring down all other nodes, that’s a waste of resources. So you need isolation of errors (resilience) to avoid losing all your work.
What two goals should we aim for in attempting to make applications scalable?
Complexity must stay as low as possible.
Resources must be used as efficiently as possible while you scale the application
Scaling out with ____ and scaling up with ____ are not good ideas
RPC
Low level threading
Why is scaling out with RPC not a good idea?
Every RPC call needs to bloc the current thread and wait for a response from the network. Impeded the goal of using resources efficiently.
Why is using a combination of RPC and threading not a good idea?
You need to know exactly where you scale up or scale out. (Increase in complexity)
Spinning up thousands of servers is simple today, but
the same cannot be said for programming them
Actors are nothing new at all, in and of themselves. It’s … that make them unique
It is the way that actors are provided in Akka to scale applications both up and out on the JVM
This type of database is often called a journal
when changes are kept as a sequence of events
The technique of storing changes as a sequence of events is called
event sourcing
How can event sourcing be kept consistent across two servers?
sharding or partitioning
Most general purpose programming languages are written in sequence. A ________ ______ ____ is required to bridge the gap between sequential definition and parallel execution
concurrent programming model
Whereas parallelization is all about executing processes simultaneously, concurrency concerns itself with
defining processes that can function simultaneously, or can overlap in time, but don’t necessarily need to run simultaneously.
An actor is a lightweight process that has only four core operations:
create, send, become, and supervise
Any actor can be a supervisor but
only for actors that it creates itself
How are actors decoupled?
on three axes - namely
- Space / location
- Time
- Interface