SlideShare a Scribd company logo
1 of 59
Download to read offline
Handle Large Messages In
Apache Kafka
Jiangjie (Becket) Qin @ LinkedIn
Kafka Meetup - Feb 23, 2016
What is a “large message” ?
● Kafka has a limit on the maximum size of a single message
○ Enforced on the compressed wrapper message if compression is used
BrokerProducer
{
…
if (message.size > message.max.bytes)
reject!
…
}
RecordTooLargeException
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
● Good workarounds exist (Reference Based Messaging)
KafkaProducer
Data
Store
Consumer
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
● Good workarounds exist (Reference Based Messaging)
KafkaProducer
Data
Store
Consumer
data
Ref.
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
● Good workarounds exist (Reference Based Messaging)
KafkaProducer
Data
Store
Consumer
data
Ref.
Ref.
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
● Good workarounds exist (Reference Based Messaging)
KafkaProducer
Data
Store
Consumer
data
Ref.
Ref. Ref.
Why does Kafka limit the message size?
● Increase the memory pressure in the broker
● Large messages are expensive to handle and could slow down the brokers.
● A reasonable message size limit can handle vast majority of the use cases.
● Good workarounds exist (Reference Based Messaging)
KafkaProducer
Data
Store
Consumer
data
Ref.
Ref. Ref.
data
Ref.
Reference Based Messaging
● One of our use cases: database replication
○ Unknown maximum row size
○ Strict no data loss
○ Strict message order guarantee
KafkaProducer
Data
Store
Consumer
data
Ref.
Ref. Ref.
data
Ref.
Works fine as long as the durability of the data store can be guaranteed.
Reference Based Messaging
● One of our use cases: database replication
○ Replicates a data store by using another data store....
○ Sporadic large messages
■ Option 1: Send all the messages using reference and take unnecessary overhead.
■ Option 2: Only send large messages using references and live with low storage utilization.
○ Low end to end latency
■ There are more round trips in the system.
■ Need to make sure the data store is fast
KafkaProducer
Data
Store
Consumer
data
Ref.
Ref. Ref.
data
Ref.
In-line Large Message Support
Reference Based Messaging In-line large message support
Operational complexity Two systems to maintain Only maintain Kafka
System stability Depend on :
● The consistency between Kafka
and the external storage
● The durability of external storage
Only depend on Kafka
Cost to serve Kafka + External Storage Only maintain Kafka
End to end latency Depend on the external storage The latency of Kafka
Client complexity Need to deal with envelopes Much more involved (coming soon)
Functional limitations Almost none Some limitations
Our solution - chunk and re-assemble
A normal-sized
message is sent as
a single-segment
message.
Consumer
Client Modules
Kafka brokers
KafkaConsumer<byte[], byte[]>
Producer
MessageAssembler
DeliveredMessageOffsetTracker
LargeMessageBufferPool
MessageSplitter
KafkaProducer<byte[], byte[]>
Compatible interface
with open source Kafka
producer / consumer
A closer look at large message handling
● The offset of a large message
● Producer callback
● Offset tracking
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
A closer look at large message handling
● The offset of a large message
● Offset tracking
● Producer callback
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
The offset of a large message
● The offset of the first segment?
○ First seen first serve
○ Easy to seek
○ Expensive for in order delivery
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
Consumer
The offset of a large message
● The offset of the first segment?
○ First seen first serve
○ Easy to seek
○ Expensive for in order delivery
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
Consumer
The offset of a large message
● The offset of the first segment?
○ First seen first serve
○ Easy to seek
○ Expensive for in order delivery
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
Consumer
Cannot deliver msg1 until msg0 is delivered.
The consumer has to buffer the msg1.
Difficult to handle partially sent messages.
The offset of a large message
● The offset of the first segment?
○ First seen first serve
○ Easy to seek
○ Expensive for in order delivery (Need to buffer all the message segments until the current
large message is complete)
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Consumer User
0: msg0
1: msg1
The offset of a large message
● The offset of the first segment?
○ First seen first serve
○ Easy to seek
○ Expensive for in order delivery
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Consumer User
0: msg0
1: msg1
seek to 0
seek to 1
The consumer can simply
seek to the message offset.
The offset of a large message
● The offset of the last segment?
○ First completed first serve
○ Needs additional work for seek (more details on this soon)
○ Least memory needed for in order delivery
● We chose offset of the last segment
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
Consumer User
The offset of a large message
● The offset of the last segment?
○ First completed first serve
○ Needs additional work for seek (more details on this soon)
○ Least memory needed for in order delivery
● We chose offset of the last segment
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
Consumer User
The offset of a large message
● The offset of the last segment?
○ First completed first serve
○ Needs additional work for seek (more details on this soon)
○ Least memory needed for in order delivery
● We chose offset of the last segment
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
Consumer
2: msg1
Deliver msg1 once it completes.
User
The offset of a large message
● The offset of the last segment?
○ First completed first serve
○ Needs additional work for seek (more details in offset tracking)
○ Least memory needed for in order delivery
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
Consumer
2: msg1
3: msg0-seg1
3: msg0
User
The offset of a large message
● We chose offset of the last segment
○ Less memory consumption
○ Better tolerance for partially sent large messages.
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
Broker
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
Consumer
2: msg1
3: msg0-seg1
3: msg0
User
A closer look at large message handling
● The offset of a large message
● Offset tracking
● Producer callback
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Offset tracking
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
Offset tracking
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
commit( Map{(tp->2)} )
● We cannot commit offset 2 because m0-s0 hasn’t been
delivered to the user.
● We should commit offset 0 so there is no message loss.
Offset tracking
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
3: msg0-seg1
3: msg0
Offset tracking
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
seek(tp, 2)
● seek to m1-s0, i.e offset 1 instead of offset 2
3: msg0-seg1
3: msg0
Offset tracking
Broker Consumer User
● Safe offset - the offset that can be committed without message loss
● Starting offset - the starting offset of a large message.
Offset tracker map
{
(2 -> start=1, safe=0),
(3 -> start=0, safe=4),
…
}
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
2: msg1
3: msg0-seg1
3: msg0
Offset tracking
● Limitations
○ Consumers can only track the message they have already seen.
■ When the users seek forward, consumer does not check if user is seeking to a message
boundary.
○ Consumers cannot keep track of all the messages they have ever seen.
■ Consumers only track a configured number of recently delivered message for each
partition. e.g. 5,000.
○ After rebalance, the new owner of a partition will not have any tracked message from the
newly assigned partitions.
A closer look at large message handling
● The offset of a large message
● Offset tracking
● Producer callback
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Producer Callback
0: msg0-seg0
1: msg0-seg1
2: msg0-seg2
...
Producer Broker
0: msg0-seg0 All the segments will be sent to the same partition.
{
numSegments=3
ackedSegments=1;
userCallback;
}
Do not fire user callback
Producer Callback
0: msg0-seg0
1: msg0-seg1
2: msg0-seg2
...
Producer Broker
0: msg0-seg0 All the segments will be sent to the same partition.
Do not fire user callback
1: msg0-seg1 {
numSegments=3
ackedSegments=2;
userCallback;
}
Producer Callback
0: msg0-seg0
1: msg0-seg1
2: msg0-seg2
...
{
numSegments=3
ackedSegments=3;
userCallback;
}
Producer Broker
0: msg0-seg0 All the segments will be sent to the same partition.
Fire the user callback
● The offset of the last segment is passed to the user callback
● The first exception received is passed to the user callback
1: msg0-seg1
2: msg0-seg2
A closer look at large message handling
● The offset of a large message
● Producer callback
● Offset tracking
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 0
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
Consumer rebalance occurred
Note: User has already seen msg1.
Offset tracker map
{
(2 -> start=1, safe=0),
…
}
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 0
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
Consumer 0 committed offset 0.
Note: User has already seen msg1.
Offset tracker map
{
(2 -> start=1, safe=0),
…
}
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
User
New owner consumer 1 resumes reading from msg0-seg0
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
User
1: msg1-seg0
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
2: msg1-seg1
User
2: msg1
Consumer 1 will deliver msg1 again to the user.
1: msg1-seg0
Duplicate
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 0
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
User
2: msg1
1. Consumer rebalance occurred
2. Consumer 0 committed offset 0 with
metadata {delivered=2}
Note: User has already seen msg1.
Offset tracker map
{
(2 -> start=1, safe=0),
…
}
delivered=2
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
User
● New owner consumer 1 resumes reading from msg0-seg0
● Consumer 1 receives the committed metadata {delivered=2}
delivered=2
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
User
1: msg1-seg0
delivered=2
● New owner consumer 1 resumes reading from msg0-seg0
● Consumer 1 receives the committed metadata {delivered=2}
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
2: msg1-seg1
User
● msg1.offset <= delivered
● Consumer 1 will NOT deliver msg1 again to the user
1: msg1-seg0
delivered=2
Rebalance and duplicates handling
0: msg0-seg0
1: msg1-seg0
2: msg1-seg1
3: msg0-seg1
4: msg2-seg0
5: msg3-seg0
...
Broker Consumer 1
0: msg0-seg0
2: msg1-seg1
User
3: msg0
The first message delivered to user will be msg0 whose offset is 3
1: msg1-seg0
delivered=2
3: msg0-seg1
A closer look at large message handling
● The offset of a large message
● Producer callback
● Offset tracking
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Memory management
● Producer
○ No material change to memory overhead except splitting and copying the message.
● Consumer side
○ buffer.capacity
■ The users can set maximum bytes to buffer the segments. If buffer is full, consumers
evict the oldest incomplete message.
○ expiration.offset.gap
■ Suppose a message has starting offset X and the consumer is now consuming from
offset Y.
■ The message will be removed from the buffer if Y - X is greater than the expiration.
offset.gap. i.e. “timeout”.
A closer look at large message handling
● The offset of a large message
● Producer callback
● Offset tracking
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Performance Overhead
● Potentially additional segment serialization/deserialization cost
○ Default segment serde is cheap
{
// segment fields
public final UUID messageId;
public final int sequenceNumber;
public final int numberOfSegments;
public final int messageSizeInBytes;
public final ByteBuffer payload;
}
Serialization
Segment
serializer
Deserialization
Segment
deserializer
Kafka
Maybe split
Re-assemble
ProducerRecord
Performance Overhead
● Additional memory footprint in consumers
○ Buffer for segments of incomplete large messages
○ Additional memory needed to track the message offsets.
■ 24 bytes per message. It takes 12 MB to track the most recent 5000 messages from 100
partitions.
■ We can choose to only track large messages if users are trustworthy.
Serialization
Segment
serializer
Deserialization
Segment
deserializer
Kafka
Maybe split
Re-assemble
ProducerRecord
A closer look at large message handling
● The offset of a large message
● Producer callback
● Offset tracking
● Rebalance and duplicates handling
● Memory management
● Performance overhead
● Compatibility with existing messages
Compatibility with existing messages
0: msg0 (existing msg)
1: msg1-seg0
2: msg1-seg1
3: msg2-seg0 (single seg msg)
...
Broker Consumer
Segment deserializer
NotLargeMessageSegmentException
Value deserializer
● When consumers see NotLargeMessageSegmentException,they
will assume the message is an existing message and use value
deserializer to handle it.
● Default segment deserializer implementation has handled this.
● In the segment deserializer, user implementation should throw
NotLargeMessageSegmentException
The answer to a question after the meetup
● Does it work for compacted topics?
○ Add suffix “-segmentSeq” to the key
■ It works with a flaw when large messages with the same key do NOT interleave
0: m0(key=”k-0”)
1: m0(key=”k-1”)
6: m1(key=”k-1”)
...
Before compaction
Scenario 1 after
compaction
...
Scenario 2 after
compaction
Note that consumer won’t assemble segments
of m0 with segments of m1 together because
their messageId are different.
5: m1(key=”k-0”)
2: m0(key=”k-2”)
1: m0(key=”k-1”)
6: m1(key=”k-1”)
...
...
5: m1(key=”k-0”)
2: m0(key=”k-2”)
6: m1(key=”k-1”)
...
...
5: m1(key=”k-0”)
2: m0(key=”k-2”) Zombie Segment
The answer to a question after the meetup
● Does it work for compacted topics?
○ Add suffix “-segmentSeq” to the key ()
■ It does not work when large messages with the same key may interleave
0: m0(key=”k0-0”)
1: m1(key=”k0-0”)
2: m1(key=”k0-1”)
3: m0(key=”k0-1”)
...
Before compaction
1: m1(key=”k0-0”)
3: m0(key=”k0-1”)
...
Failure Scenario
(Doesn’t work)
Note that consumer won’t assemble m0-
seg1 and m1-seg0 together because
their messageId are different
Summary
● Reference based messaging works in most cases.
● Sometimes it is handy to have in-line support for large message
○ Sporadic large messages
○ low latency
○ Small number of interleaved large messages
○ Save cost
Acknowledgements
Thanks for the great help and support from
Dong Lin
Joel Koshy
Kartik Paramasivam
Onur Karaman
Yi Pan
LinkedIn Espresso and Datastream team
Q&A

More Related Content

What's hot

From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity PlanningFrom Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planningconfluent
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?confluent
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database Systemconfluent
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafkaJiangjie Qin
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!Guido Schmutz
 
Grafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsGrafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsMarco Pracucci
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana LokiJulien Pivotto
 
Loki - like prometheus, but for logs
Loki - like prometheus, but for logsLoki - like prometheus, but for logs
Loki - like prometheus, but for logsJuraj Hantak
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaShiao-An Yuan
 
How is Kafka so Fast?
How is Kafka so Fast?How is Kafka so Fast?
How is Kafka so Fast?Ricardo Paiva
 
OpenTelemetry For Developers
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For DevelopersKevin Brockhoff
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®confluent
 
Kafka Streams State Stores Being Persistent
Kafka Streams State Stores Being PersistentKafka Streams State Stores Being Persistent
Kafka Streams State Stores Being Persistentconfluent
 

What's hot (20)

From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity PlanningFrom Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database System
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!
 
Grafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for LogsGrafana Loki: like Prometheus, but for Logs
Grafana Loki: like Prometheus, but for Logs
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
 
Apache Kafka Best Practices
Apache Kafka Best PracticesApache Kafka Best Practices
Apache Kafka Best Practices
 
Loki - like prometheus, but for logs
Loki - like prometheus, but for logsLoki - like prometheus, but for logs
Loki - like prometheus, but for logs
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
How is Kafka so Fast?
How is Kafka so Fast?How is Kafka so Fast?
How is Kafka so Fast?
 
OpenTelemetry For Developers
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For Developers
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
kafka
kafkakafka
kafka
 
Kafka Streams State Stores Being Persistent
Kafka Streams State Stores Being PersistentKafka Streams State Stores Being Persistent
Kafka Streams State Stores Being Persistent
 

Viewers also liked

HBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon2017 Improving HBase availability in a multi tenant environmentHBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon2017 Improving HBase availability in a multi tenant environmentHBaseCon
 
HBaseCon 2015: Analyzing HBase Data with Apache Hive
HBaseCon 2015: Analyzing HBase Data with Apache  HiveHBaseCon 2015: Analyzing HBase Data with Apache  Hive
HBaseCon 2015: Analyzing HBase Data with Apache HiveHBaseCon
 
Identity Federation Patterns with WSO2 Identity Server​
Identity Federation Patterns with WSO2 Identity Server​Identity Federation Patterns with WSO2 Identity Server​
Identity Federation Patterns with WSO2 Identity Server​WSO2
 
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital EconomyWSO2
 
Leveraging federation capabilities of Identity Server for API gateway
Leveraging federation capabilities of Identity Server for API gatewayLeveraging federation capabilities of Identity Server for API gateway
Leveraging federation capabilities of Identity Server for API gatewayWSO2
 
Big Data: Getting started with Big SQL self-study guide
Big Data:  Getting started with Big SQL self-study guideBig Data:  Getting started with Big SQL self-study guide
Big Data: Getting started with Big SQL self-study guideCynthia Saracco
 
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNKWSO2
 

Viewers also liked (8)

HBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon2017 Improving HBase availability in a multi tenant environmentHBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon2017 Improving HBase availability in a multi tenant environment
 
HBaseCon 2015: Analyzing HBase Data with Apache Hive
HBaseCon 2015: Analyzing HBase Data with Apache  HiveHBaseCon 2015: Analyzing HBase Data with Apache  Hive
HBaseCon 2015: Analyzing HBase Data with Apache Hive
 
Identity Federation Patterns with WSO2 Identity Server​
Identity Federation Patterns with WSO2 Identity Server​Identity Federation Patterns with WSO2 Identity Server​
Identity Federation Patterns with WSO2 Identity Server​
 
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy
[WSO2Con EU 2017] Keynote: Mobile Identity in the Digital Economy
 
Leveraging federation capabilities of Identity Server for API gateway
Leveraging federation capabilities of Identity Server for API gatewayLeveraging federation capabilities of Identity Server for API gateway
Leveraging federation capabilities of Identity Server for API gateway
 
Big Data: Getting started with Big SQL self-study guide
Big Data:  Getting started with Big SQL self-study guideBig Data:  Getting started with Big SQL self-study guide
Big Data: Getting started with Big SQL self-study guide
 
The Impala Cookbook
The Impala CookbookThe Impala Cookbook
The Impala Cookbook
 
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK
[WSO2Con EU 2017] The Win-Win-Win of Water Authority HHNK
 

Similar to Handle Large Messages In Apache Kafka

FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...Rob Skillington
 
Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Otávio Carvalho
 
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015Monal Daxini
 
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015Monal Daxini
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafkavishnu rao
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - KafkaMayank Bansal
 
Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)DataWorks Summit
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaSteven Wu
 
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support PerspectiveApache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support PerspectiveHostedbyConfluent
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2aspyker
 
Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaAvinash Ramineni
 
Event driven architectures with Kinesis
Event driven architectures with KinesisEvent driven architectures with Kinesis
Event driven architectures with KinesisMark Harrison
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache KafkaAmir Sedighi
 
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy FarkasVirtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy FarkasFlink Forward
 
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...HostedbyConfluent
 
Stateful stream processing with kafka and samza
Stateful stream processing with kafka and samzaStateful stream processing with kafka and samza
Stateful stream processing with kafka and samzaGeorge Li
 
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSKubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSNATS
 

Similar to Handle Large Messages In Apache Kafka (20)

FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
 
Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018
 
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
Netflix Keystone Pipeline at Big Data Bootcamp, Santa Clara, Nov 2015
 
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)Kafka to the Maxka - (Kafka Performance Tuning)
Kafka to the Maxka - (Kafka Performance Tuning)
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support PerspectiveApache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
Apache Kafka's Common Pitfalls & Intricacies: A Customer Support Perspective
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafka
 
Event driven architectures with Kinesis
Event driven architectures with KinesisEvent driven architectures with Kinesis
Event driven architectures with Kinesis
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache Kafka
 
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy FarkasVirtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
 
Kafka Deep Dive
Kafka Deep DiveKafka Deep Dive
Kafka Deep Dive
 
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
A Beginner’s Guide to Kafka Performance in Cloud Environments with Steffen Ha...
 
Stateful stream processing with kafka and samza
Stateful stream processing with kafka and samzaStateful stream processing with kafka and samza
Stateful stream processing with kafka and samza
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSKubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
 

Recently uploaded

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 

Recently uploaded (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 

Handle Large Messages In Apache Kafka

  • 1. Handle Large Messages In Apache Kafka Jiangjie (Becket) Qin @ LinkedIn Kafka Meetup - Feb 23, 2016
  • 2. What is a “large message” ? ● Kafka has a limit on the maximum size of a single message ○ Enforced on the compressed wrapper message if compression is used BrokerProducer { … if (message.size > message.max.bytes) reject! … } RecordTooLargeException
  • 3. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases.
  • 4. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases. ● Good workarounds exist (Reference Based Messaging) KafkaProducer Data Store Consumer
  • 5. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases. ● Good workarounds exist (Reference Based Messaging) KafkaProducer Data Store Consumer data Ref.
  • 6. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases. ● Good workarounds exist (Reference Based Messaging) KafkaProducer Data Store Consumer data Ref. Ref.
  • 7. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases. ● Good workarounds exist (Reference Based Messaging) KafkaProducer Data Store Consumer data Ref. Ref. Ref.
  • 8. Why does Kafka limit the message size? ● Increase the memory pressure in the broker ● Large messages are expensive to handle and could slow down the brokers. ● A reasonable message size limit can handle vast majority of the use cases. ● Good workarounds exist (Reference Based Messaging) KafkaProducer Data Store Consumer data Ref. Ref. Ref. data Ref.
  • 9. Reference Based Messaging ● One of our use cases: database replication ○ Unknown maximum row size ○ Strict no data loss ○ Strict message order guarantee KafkaProducer Data Store Consumer data Ref. Ref. Ref. data Ref. Works fine as long as the durability of the data store can be guaranteed.
  • 10. Reference Based Messaging ● One of our use cases: database replication ○ Replicates a data store by using another data store.... ○ Sporadic large messages ■ Option 1: Send all the messages using reference and take unnecessary overhead. ■ Option 2: Only send large messages using references and live with low storage utilization. ○ Low end to end latency ■ There are more round trips in the system. ■ Need to make sure the data store is fast KafkaProducer Data Store Consumer data Ref. Ref. Ref. data Ref.
  • 11. In-line Large Message Support Reference Based Messaging In-line large message support Operational complexity Two systems to maintain Only maintain Kafka System stability Depend on : ● The consistency between Kafka and the external storage ● The durability of external storage Only depend on Kafka Cost to serve Kafka + External Storage Only maintain Kafka End to end latency Depend on the external storage The latency of Kafka Client complexity Need to deal with envelopes Much more involved (coming soon) Functional limitations Almost none Some limitations
  • 12. Our solution - chunk and re-assemble A normal-sized message is sent as a single-segment message.
  • 13. Consumer Client Modules Kafka brokers KafkaConsumer<byte[], byte[]> Producer MessageAssembler DeliveredMessageOffsetTracker LargeMessageBufferPool MessageSplitter KafkaProducer<byte[], byte[]> Compatible interface with open source Kafka producer / consumer
  • 14. A closer look at large message handling ● The offset of a large message ● Producer callback ● Offset tracking ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 15. A closer look at large message handling ● The offset of a large message ● Offset tracking ● Producer callback ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 16. The offset of a large message ● The offset of the first segment? ○ First seen first serve ○ Easy to seek ○ Expensive for in order delivery 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 Consumer
  • 17. The offset of a large message ● The offset of the first segment? ○ First seen first serve ○ Easy to seek ○ Expensive for in order delivery 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 Consumer
  • 18. The offset of a large message ● The offset of the first segment? ○ First seen first serve ○ Easy to seek ○ Expensive for in order delivery 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 Consumer Cannot deliver msg1 until msg0 is delivered. The consumer has to buffer the msg1. Difficult to handle partially sent messages.
  • 19. The offset of a large message ● The offset of the first segment? ○ First seen first serve ○ Easy to seek ○ Expensive for in order delivery (Need to buffer all the message segments until the current large message is complete) 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Consumer User 0: msg0 1: msg1
  • 20. The offset of a large message ● The offset of the first segment? ○ First seen first serve ○ Easy to seek ○ Expensive for in order delivery 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Consumer User 0: msg0 1: msg1 seek to 0 seek to 1 The consumer can simply seek to the message offset.
  • 21. The offset of a large message ● The offset of the last segment? ○ First completed first serve ○ Needs additional work for seek (more details on this soon) ○ Least memory needed for in order delivery ● We chose offset of the last segment 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 Consumer User
  • 22. The offset of a large message ● The offset of the last segment? ○ First completed first serve ○ Needs additional work for seek (more details on this soon) ○ Least memory needed for in order delivery ● We chose offset of the last segment 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 Consumer User
  • 23. The offset of a large message ● The offset of the last segment? ○ First completed first serve ○ Needs additional work for seek (more details on this soon) ○ Least memory needed for in order delivery ● We chose offset of the last segment 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 Consumer 2: msg1 Deliver msg1 once it completes. User
  • 24. The offset of a large message ● The offset of the last segment? ○ First completed first serve ○ Needs additional work for seek (more details in offset tracking) ○ Least memory needed for in order delivery 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 Consumer 2: msg1 3: msg0-seg1 3: msg0 User
  • 25. The offset of a large message ● We chose offset of the last segment ○ Less memory consumption ○ Better tolerance for partially sent large messages. 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 Broker 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 Consumer 2: msg1 3: msg0-seg1 3: msg0 User
  • 26. A closer look at large message handling ● The offset of a large message ● Offset tracking ● Producer callback ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 27. Offset tracking 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1
  • 28. Offset tracking 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 commit( Map{(tp->2)} ) ● We cannot commit offset 2 because m0-s0 hasn’t been delivered to the user. ● We should commit offset 0 so there is no message loss.
  • 29. Offset tracking 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 3: msg0-seg1 3: msg0
  • 30. Offset tracking 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 seek(tp, 2) ● seek to m1-s0, i.e offset 1 instead of offset 2 3: msg0-seg1 3: msg0
  • 31. Offset tracking Broker Consumer User ● Safe offset - the offset that can be committed without message loss ● Starting offset - the starting offset of a large message. Offset tracker map { (2 -> start=1, safe=0), (3 -> start=0, safe=4), … } 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 2: msg1 3: msg0-seg1 3: msg0
  • 32. Offset tracking ● Limitations ○ Consumers can only track the message they have already seen. ■ When the users seek forward, consumer does not check if user is seeking to a message boundary. ○ Consumers cannot keep track of all the messages they have ever seen. ■ Consumers only track a configured number of recently delivered message for each partition. e.g. 5,000. ○ After rebalance, the new owner of a partition will not have any tracked message from the newly assigned partitions.
  • 33. A closer look at large message handling ● The offset of a large message ● Offset tracking ● Producer callback ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 34. Producer Callback 0: msg0-seg0 1: msg0-seg1 2: msg0-seg2 ... Producer Broker 0: msg0-seg0 All the segments will be sent to the same partition. { numSegments=3 ackedSegments=1; userCallback; } Do not fire user callback
  • 35. Producer Callback 0: msg0-seg0 1: msg0-seg1 2: msg0-seg2 ... Producer Broker 0: msg0-seg0 All the segments will be sent to the same partition. Do not fire user callback 1: msg0-seg1 { numSegments=3 ackedSegments=2; userCallback; }
  • 36. Producer Callback 0: msg0-seg0 1: msg0-seg1 2: msg0-seg2 ... { numSegments=3 ackedSegments=3; userCallback; } Producer Broker 0: msg0-seg0 All the segments will be sent to the same partition. Fire the user callback ● The offset of the last segment is passed to the user callback ● The first exception received is passed to the user callback 1: msg0-seg1 2: msg0-seg2
  • 37. A closer look at large message handling ● The offset of a large message ● Producer callback ● Offset tracking ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 38. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 Consumer rebalance occurred Note: User has already seen msg1. Offset tracker map { (2 -> start=1, safe=0), … }
  • 39. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 Consumer 0 committed offset 0. Note: User has already seen msg1. Offset tracker map { (2 -> start=1, safe=0), … }
  • 40. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 User New owner consumer 1 resumes reading from msg0-seg0
  • 41. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 User 1: msg1-seg0
  • 42. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 2: msg1-seg1 User 2: msg1 Consumer 1 will deliver msg1 again to the user. 1: msg1-seg0 Duplicate
  • 43. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 0 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 User 2: msg1 1. Consumer rebalance occurred 2. Consumer 0 committed offset 0 with metadata {delivered=2} Note: User has already seen msg1. Offset tracker map { (2 -> start=1, safe=0), … } delivered=2
  • 44. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 User ● New owner consumer 1 resumes reading from msg0-seg0 ● Consumer 1 receives the committed metadata {delivered=2} delivered=2
  • 45. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 User 1: msg1-seg0 delivered=2 ● New owner consumer 1 resumes reading from msg0-seg0 ● Consumer 1 receives the committed metadata {delivered=2}
  • 46. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 2: msg1-seg1 User ● msg1.offset <= delivered ● Consumer 1 will NOT deliver msg1 again to the user 1: msg1-seg0 delivered=2
  • 47. Rebalance and duplicates handling 0: msg0-seg0 1: msg1-seg0 2: msg1-seg1 3: msg0-seg1 4: msg2-seg0 5: msg3-seg0 ... Broker Consumer 1 0: msg0-seg0 2: msg1-seg1 User 3: msg0 The first message delivered to user will be msg0 whose offset is 3 1: msg1-seg0 delivered=2 3: msg0-seg1
  • 48. A closer look at large message handling ● The offset of a large message ● Producer callback ● Offset tracking ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 49. Memory management ● Producer ○ No material change to memory overhead except splitting and copying the message. ● Consumer side ○ buffer.capacity ■ The users can set maximum bytes to buffer the segments. If buffer is full, consumers evict the oldest incomplete message. ○ expiration.offset.gap ■ Suppose a message has starting offset X and the consumer is now consuming from offset Y. ■ The message will be removed from the buffer if Y - X is greater than the expiration. offset.gap. i.e. “timeout”.
  • 50. A closer look at large message handling ● The offset of a large message ● Producer callback ● Offset tracking ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 51. Performance Overhead ● Potentially additional segment serialization/deserialization cost ○ Default segment serde is cheap { // segment fields public final UUID messageId; public final int sequenceNumber; public final int numberOfSegments; public final int messageSizeInBytes; public final ByteBuffer payload; } Serialization Segment serializer Deserialization Segment deserializer Kafka Maybe split Re-assemble ProducerRecord
  • 52. Performance Overhead ● Additional memory footprint in consumers ○ Buffer for segments of incomplete large messages ○ Additional memory needed to track the message offsets. ■ 24 bytes per message. It takes 12 MB to track the most recent 5000 messages from 100 partitions. ■ We can choose to only track large messages if users are trustworthy. Serialization Segment serializer Deserialization Segment deserializer Kafka Maybe split Re-assemble ProducerRecord
  • 53. A closer look at large message handling ● The offset of a large message ● Producer callback ● Offset tracking ● Rebalance and duplicates handling ● Memory management ● Performance overhead ● Compatibility with existing messages
  • 54. Compatibility with existing messages 0: msg0 (existing msg) 1: msg1-seg0 2: msg1-seg1 3: msg2-seg0 (single seg msg) ... Broker Consumer Segment deserializer NotLargeMessageSegmentException Value deserializer ● When consumers see NotLargeMessageSegmentException,they will assume the message is an existing message and use value deserializer to handle it. ● Default segment deserializer implementation has handled this. ● In the segment deserializer, user implementation should throw NotLargeMessageSegmentException
  • 55. The answer to a question after the meetup ● Does it work for compacted topics? ○ Add suffix “-segmentSeq” to the key ■ It works with a flaw when large messages with the same key do NOT interleave 0: m0(key=”k-0”) 1: m0(key=”k-1”) 6: m1(key=”k-1”) ... Before compaction Scenario 1 after compaction ... Scenario 2 after compaction Note that consumer won’t assemble segments of m0 with segments of m1 together because their messageId are different. 5: m1(key=”k-0”) 2: m0(key=”k-2”) 1: m0(key=”k-1”) 6: m1(key=”k-1”) ... ... 5: m1(key=”k-0”) 2: m0(key=”k-2”) 6: m1(key=”k-1”) ... ... 5: m1(key=”k-0”) 2: m0(key=”k-2”) Zombie Segment
  • 56. The answer to a question after the meetup ● Does it work for compacted topics? ○ Add suffix “-segmentSeq” to the key () ■ It does not work when large messages with the same key may interleave 0: m0(key=”k0-0”) 1: m1(key=”k0-0”) 2: m1(key=”k0-1”) 3: m0(key=”k0-1”) ... Before compaction 1: m1(key=”k0-0”) 3: m0(key=”k0-1”) ... Failure Scenario (Doesn’t work) Note that consumer won’t assemble m0- seg1 and m1-seg0 together because their messageId are different
  • 57. Summary ● Reference based messaging works in most cases. ● Sometimes it is handy to have in-line support for large message ○ Sporadic large messages ○ low latency ○ Small number of interleaved large messages ○ Save cost
  • 58. Acknowledgements Thanks for the great help and support from Dong Lin Joel Koshy Kartik Paramasivam Onur Karaman Yi Pan LinkedIn Espresso and Datastream team
  • 59. Q&A