Talk at Craft conf 2018 on how to build resilient event driven systems with Kafka. Walks through an example of building notifications feature for chat app Stride.
12. “The event-driven architecture pattern
is a popular distributed asynchronous
architecture pattern used to produce
highly scalable applications”
Software Architecture Patterns, Mark Richards
13. Kafka
0 1 2 3 4 5 6 7 8 9
Partition 0
0 1 2 3 4 5
Partition 3
Topic Foo
Producer
Consumer 0
Consumer 1
Consumer Group B
Consumer 0
Consumer 1
Consumer Group A
Consumer
Group B
Consumer
Group A
55. THE ANSWER LIES IN QUEUING THEORY
Arrivals
Queue
Service
Arrival Rate
56. THE ANSWER LIES IN QUEUING THEORY
Arrivals
Queue
Service
Arrival Rate
Queue Length
57. THE ANSWER LIES IN QUEUING THEORY
Arrivals
Queue
Service
Arrival Rate Wait Time
Residence Time
Service Time
Queue Length
58. THE ANSWER LIES IN QUEUING THEORY
Arrivals
Queue
Service
Arrival Rate Wait Time
Residence Time
Service Time
Utilization
=
Arrival Rate
*
Service Time
Queue Length
59. THE ANSWER LIES IN QUEUING THEORY
Arrivals
Queue
Service
Arrival Rate Wait Time
Arrival Rate
Service Time
Utilization
Queue Length
60. UTILIZATION = RATE OF ARRIVAL*SERVICE TIME
Hockey Stick
Residence Time vs Utilization
70. Observability
Stats
Logs
Tracing
“… one of the deficiencies of the Event
Notification pattern is the lack of visibility
into the flow of the system, which makes
it hard to debug.” - Martin Fowler
80. Product Requirements
• Build for evolving requirements - extensibility
and flexibility
• Always ask WHAT if things go wrong
Resiliency
• Resiliency affects product behavior
• Make it a low cost option to adopt resiliency
with sensible default values
Observability
Observability is not only the measure of the
internal state but can also be used to predict
future state
Takeaways
@IcchaSethi