4 Flashcards

1
Q

When is the use of a Circuit Breaker pattern appropriate in micro-service architectures?

A

P40

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Sketch the flow of interactions between two actors that implement the Ask pattern using an ephemeral child actor.

A

P41

  1. First, the runner actor will send a message to the asker actor with its own address as the replyTo address.
  2. The asker actor will create an ephemeral child actor that contains the necessary state to handle the reply to the original request and send the necessary reply back to the original requester. For example, this could simply be the original replyTo address.
  3. The asker actor will then create a request based on the original request and send it to an emailGateway actor. However, the replyTo address for this message will be this of the ephemeral child actor.
  4. Once the emailGateway actor finishes processing the message, it sends a reply to the ephemeral child actor.
  5. The ephemeral child actor processes the response and forwards it to the original requester.
  6. Finally, the ephemeral child actor will terminate itself, automatically cleaning up any remaining, useless state.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the relation between the Builder and the Aggregator design patterns?

A

P43

The aggregator design pattern includes an ephemeral aggregator child component created to combine
the results of multiple parallel service calls to determine the result of an initial service call.
Thus, this micro-service pattern is used when multiple request-response cycles must be completed
to return a result, but the requests are independent of the responses of other cycles so all cycles can
be executed in parallel.
However, because all responses may arrive at the ephemeral aggregator child in a predetermined
order, it will use a Builder design pattern to build the end result. The Builder design pattern is an OO
software design pattern that provides a class with a number of optional fields. The class provides
methods to set these fields, to provide them with default values, to check if all fields are set and also to
eventually display a result based on the current values in the fields. So the result is “built” slowly
instead of giving all the arguments at once to a constructor to create the result.
The ephemeral aggregator child component will ask the builder after each reponse that arrives
whether enough responses have arrived to generate a result. If so, the accumulated result is sent as a
reply to the original requester.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What implementation logic is required on the side of the sender and the side of the recipient to implement reliably message delivery?

A

P44

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What built-in features does Akka provide to facilitate this task?

A

P44

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Illustrate the Domain Object pattern using an example implementation in Akka.

A

P45

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Highlight the differences between the different types of domain-level and actor-level messages.

A

P46

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is event sourcing?

A

P47

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give three advantages and three disadvantages that come with the event sourcing design pattern

A

P47

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Compare three options that architects have to prevent a service from becoming overloaded by
incoming requests

A

P48

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do the patterns for flow control compare to the circuit breaker pattern?

A

P49

The patterns for flow control are the Pull Pattern, Managed Queue Pattern and Drop Pattern. The Circuit Breaker Pattern, on the other hand, is a Fault Tolerance Pattern.
Flow control patterns are patterns that add logic primarily on the recipient side to prevent it from being overwhelmed by an overload of requests from senders.
In contrast, the Circuit Breaker Pattern adds logic on the requester’s side to prevent requests to
external services that fail from causing us to fail or falter as well. It is thus a protection against so-called cascading failures.
The Circuit Breaker Pattern will go from a Closed circuit to an Open Circuit on slow responses and fail requests quickly. After a while, it may go back to a Half Open circuit to test with a request to see if the service is already healed and then either go back to Closed or Open state. So the flow of requests can be temporarily intentionally broken if the recipient is overloaded or otherwise failing.
Thus, both the Flow Control Patterns and the Circuit Breaker Pattern will ensure that the recipient has some breathing room to avoid or resolve possible load-induced failures. The Circuit Breaker Pattern also allows on the requester’s side to fail its request quickly so that it does not waste time waiting for negative replies. So both types of Pattern will do attempt to increase system responsiveness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does Akka’s implementation of the actor model satisfy the infrastructure desiderata forimplementing fault tolerance?

A

P50

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Implement an example actor system in which normal message processing logic is cleanly separated from fault recovery logic.

A

P51

How well did you know this?
1
Not at all
2
3
4
5
Perfectly