Apache Pulsar
●
●
●
●
Hi!
Today’s Agenda
●
○
○
○
○
●
○
○
○
○
An overview of
Pulsar
What is it?
●
○
○
○
○
●
History
●
●
●
●
Feature Overview
●
●
●
●
●
●
●
Core Concepts
● Producers consumers
broker
● Topics
persisitent://tenant/namespace/topic
● Messages
partition key
● Partitioned Topics
● Tenants namespaces
Subscriptions
●
subscription
●
○
○
○
Creating a client
Sending a message
Receiving a message
Pulsar’s
Architecture
●
●
●
●
●
●
●
●
●
●
●
●
●
○
○
●
Bookie 0 Bookie 1 Bookie 2
Broker 0 Broker 1 Broker 2
ZooKeeper
ZooKeeper
ZooKeeper
Producer Consumer
Bookkeeper
Details
New Broker Added
p
0
p
1
p
3
p
4
s
ss
s
ss
s
ss
s
ss
s
ss
Broker 4
p
5
Broker Failure
p
0
p
1
p
3
p
4
s
ss
s
ss
s
ss
s
ss
s
ss
p
5
New Bookie Added
p
0
p
1
p
3
p
4
p
5
s
ss
s
ss
s
ss
s
ss
s
ss
Bookie
6
s
ss
Bookie Failure
p
0
p
1
p
3
p
4
p
5
s
ss
s
ss
s
ss
s
ss
s
ss
Pulsar’s advantages
and unique features
Architectural advantages
●
●
●
Tiered Storage
●
●
●
●
p
0
p
1
p
3
p
4
p
5
s
ss
s
ss
s
ss
s
s
s
ss
offloa
ding
Pulsar SQL
●
●
●
Lessons from
Bookkeeper and
Pulsar
Bookkeeper disk
and memory
management
Java Disk IO Methods
●
○
●
○
●
○
Write Performance Comparison
https://github.com/romromov/java-io-benchmark
Problems with MappedByteBuffer
● .get()/.put() is potentially blocking
● Flushes to disk may happen in the background (but can be forced)
● Caches are controlled entirely by OS, which may not be desired
when we know we would be thrashing the cache or for precisely
controlling what is hot in memory
Making efficient
use of disk
●
○
○
○
●
●
https://bookkeeper.apache.org/docs/4.9.2/getting-started/concepts/#data-management-in-bookies
Using Caches
write cache
Takeaways
●
●
●
●
●
High throughput and
low latency in
Pulsar
Low latency + throughput
tailing reads
●
●
●
●
Avoiding the slowest worker
Takeaway
Streaming-pull
Takeaway
Broker caching
Takeaway
Async
Takeaway
Pulsar’s challenges
Async is still relatively new
Cloud Native
Network throttling/isolation
Interested in
Pulsar?
Join the Pulsar Community
https://pulsar-summit.org/en/event/virtual-conference-2020
Hosted Pulsar with StreamNative Cloud
Questions?

Apache Pulsar under the hood