I am learning to illustrate complex processes using comics. I found a cool case in my piggy bank: how, using comics about cute otters, you can explain to a child such a complex thing as Apache Kafka and make the world a little kinder.
Easy with the Flow - An easy introduction to streaming and Apache Kafka. A group of otters discovers that they can use the giant river to communicate with each other. As more otters move into the forest, they must learn to adapt their system to cope with the increased forest activity.
Below the cut are 25 slides explaining the basics of Kafka for kids and the humanities. And a lot of cute otters.
Easy with the flow
At first, the forest was quiet, and only two families of otters lived among the trees and rivers.
Whenever they needed to share news, they just talked to each other directly.
They shared news about the birthday party, new guests and other events taking place in the forest.
Over time, more and more otters moved into the forest.
And in the same way, the number of events taking place in the forest grew.
It was a challenge for the little otters. Every time the otter had news to share, she had to find every other family and tell them in person.
Not only was this time consuming, it was error prone.
What if some of the family was out on a picnic and couldn't get notification of an upcoming event?
Well, then the otter who wanted to notify the neighbors would have to come back later or give up.
Since the rest of the otters communicated with each other in person, they were said to be Closely Tied .
Being tightly connected is super cute, but it makes communication with others more difficult. This is called the Scaling Problem .
It was then that a little otter named Nixie had an idea that would change the forest forever.
The huge river Kafka flowed through the forest and Nixie knew that otters could use this river to communicate.
You can install Kafka in your forest:
# clone the repository
git clone \
https://github.com/round-robin-books/gently-kafka.git
# start kafka
docker-compose up
She even composed a song to explain how it works: Put
your events
Into the river,
The river can carry them
Can otters to others.
What about the events
Floating in the stream,
This path is amazing,
We are all in shock here.
"Won't you lag behind?" - intervened the dolphin
"You can't leave everything at the mercy of the depths!"
This will not be included in the delivery.
We will divide the river as a team, Into
many small streams
And together we will reach the goal.
Let's see how it works.
First, the otter observes an Event , something that happened at a certain point in time.
For example, "The bees are back today" is an event.
Next, the otter creates an Event Record .
Records (sometimes called messages) include the time of the event (time stamp) and additional information about the event.
Then the otters will be able to decide which part of the river to send this message to.
The river is divided into streams called Topics , which make organizing messages easier.
As a result, otters threw their messages into threads (topics) so that other otters could find them.
At first they used glass bottles, but the bottles just floated away.
Then, the otters switched to glass floats. Since the floats stayed in place and did not float anywhere, this was called Resilience .
Resilience is important because it allows the otters to read messages whenever they want, for example after their picnic.
2 types of otters
The otters who put messages in the river are called Producers .
Producers throw small batches of messages into the river, not knowing who is coming to read them.
Ignorance helps to Separate systems, ... that is, otters who create events, and who read events.
Otters who read events in the stream are called Consumers .
Consumers follow any topic that interests them.
For example, First Aid otters keep track of the forest alert topic so that they can react in emergencies (like a bee situation).
This system works well, but after a while the river becomes too busy with a lot of events. How can little otters be in time for everything?
As social animals, they prefer to work together. First, they throw huge stones into the river, dividing each topic into a small number of streams, or Sections .
Then, one family member, the so-called Group Leader , assigns a subset of small streams (sections) to each family member.
This implies that each otter is only responsible for the portion of the stream that it monitors.
Working together in this case, each family is called the Consumer Group., which manages to keep track of its part of the flow of messages, no matter how many of them there are in the river.
Moreover, if an otter is sick or has something to do, it can be assigned to another otter in her group.
Since someone was always there, otters were Highly available .
And because they could handle Unplanned Situations, they were Failover .
There was also a magical part of the forest, Stream Processing Land , where otters could do really cool things with events in the river.
An entire book has been written about this magical place: Mastering Kafka Streams and ksqlDB
The otters also built roads called Kafka Connectors to carry messages from other communities to the Kafka River. Everyone joined in the fun.
Kafka continued to help many others around the world. And she returned back to the forest.
Life went on as usual for many years, and otters lived happily ever after.
I could not resist, here are a few facts about otters:
Washed out, or otter puppies sleep on otter mothers on their chests.
Adult otters hold each other's legs in their sleep so that the current does not separate them.
And lonely otters, in order not to drift, are wrapped in seaweed.
Strictly speaking, the author uses the term "otter", which translates to otters, and includes 13 animal species with distribution throughout the world, except Australia.
And if you really used this material on children for educational purposes, then you can complete it with a speech exercise:
βIn the depths of the tundra, otters in gaiters poke cedar kernels into buckets. Having ripped out the gaiters from the otter in the tundra, wiped the cedar kernels by the otter, wipe the otter's face with the gaiter - the kernels into the buckets, the otter into the tundra. "