1/22
EVEN more on MOM... ugh
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
why is temporal decoupling (queuing) useful
there doesn’t have to be a consumer running when the event is produced as long as one turns up eventually
issues with queues
how large is a queue? how can this change? what happens in the extremes?
extreme 1: one event queue
channel can hold one event at most. first producer deposits event and blocks until its been consumed. second producer blocks until the first producer unblocks
extreme 2: grow the queue
the queue expands as events arrive, producers never block and consumers only block when there are no events
pro of growing the queue
simple straightforward model
cons of growing the queue
can generate memory overflows - we need to guarantee a maximum size the queue can grow to
bounded queue
fix the maximum size of the queue somewhere greater than one
allow events to drop
drop events from the queue when it is nearly full or full
note on dropping events
whether or not this is a good idea depends critically on what events mean to the system
event delivery QoS 1
guaranteed delivery - no matter what, the event will be delivered
event delivery QoS 2
at least once delivery - the event will be delivered, potentially several times
event delivery QoS 3
at most once delivery - the event will be dropped or delivered exactly once
event delivery QoS 4
best effort delivery - we try to deliver the event but you must be ready for the possibility of it not arriving
routing of event options
duplicate all events on all channels, send each event to a single channel or route based on the event’s content
duplication
events get duplicated for robustness but this means they may be delivered several times
duplication solutions
single path, unique stamps on events, idempotent events
message system
guarantees exactly once delivery
challenges of message systems
making sure messages are transferred reliably, surviving network partitions and machine failures
solution to message system challenges
using stable storage in the message queue
heuristic solutions to out of order results
timestamps, vector clocks
benefits of MOM having a larger framework 1
defines an architecture for a system
benefits of MOM having a larger framework 2
allows programmers to focus on business logic
benefits of MOM having a larger framework 3
less diversity and complexity for the component programmers