20. Red Hat
observations
20
What we want:
● Improve decoupling
● Improve scalability
What we don’t want:
● Service coupling
● Ripple effect
● Service overload
● Slow response time
25. Red Hat
Kafka Streams &
Streaming APIs
25
Kafka Strengths:
● Real Time Data Pipeline
● High-throughput
● Fault-tolerant
● Low Latency
● Scalability
Kafka Limits:
Kafka is not optimized to provide API consumers with friendly access to real time data.
Difficult to expose and re-use API oriented tools for Kafka
26. Red Hat
Kafka Streams &
Streaming APIs
26
Protocol bridge
The way to present the information is not friendly but for the REST all is good
Is there an easy Kafka way to bridge Kafka and REST?
There are several: Apache Camel to the rescue!
28. Red Hat
Industries
28
➔ Travel companies
➔ Finance and fintech companies
➔ Retailers and online shopping
➔ Automotive and manufacturing companies
➔ Video Streaming companies
➔ Social networks
➔ Transportation
...
[ https://kafka.apache.org/powered-by]
29. Red Hat
Travel: Singapore Airlines
29
Problem:
Many
airplanes
Many components
per airplane
Each airplane
different
flight-plan
! Predictive maintenance is a hard !
37. Red Hat
News: New York Times
37
Problems:
● Consumers need to know everything about Producers
● Producer API has to live forever
● Every API has a different information schema
● No easy way to read historical info in bulk
● Monoliths that tried to do everything for everyone
● Hard to develop new products and change old ones
Typical API oriented architecture
[ https://www.slideshare.net/ConfluentInc/apache-kafka-delivers-a-single-source-of-truth-for-the-new-york-times ]
38. Red Hat
News: New York Times
38
Solution:
[ https://www.slideshare.net/ConfluentInc/apache-kafka-delivers-a-single-source-of-truth-for-the-new-york-times ]
39. Red Hat
News: New York Times
39
Solution:
1. Log is the source of truth
2. All assets are protobuf binaries
3. Use a Monolog (single partition, completely ordered, infinite
retention
[ https://www.slideshare.net/ConfluentInc/apache-kafka-delivers-a-single-source-of-truth-for-the-new-york-times ]
40. Red Hat
Leisure: Tinder
40
Problems:
● Delayed notifications
● Scheduled content moderation
● Managing inactive users, likely to drop out
● Schedule feature drop correctly
Didn’t realize dating was so complex nowadays
45. Red Hat
3 microservices:
1. Order to create orders. This services sends messages to Kafka. It uses the
KafkaTemplate.
2. Shipment receives the orders and extract the information needed to ship the items.
3. Invoicing receives the messages, too. It extracts all information to send out an invoice.
It uses @KafkaListener just like Shipment.
How much Kafka do you want in your life?
45 [ https://github.com/ewolff/microservice-kafka ]