SlideShare a Scribd company logo
1 of 38
Download to read offline
streamnative.io
Lifecycle of a
Pulsar Message
#TGIPulsar EP-006
Message Lifecycle
✓ Message Flow
✓ Message Retention
Message Flow
Brokers + Bookies
Bookie 0 Bookie 1 Bookie 2
The processes for storing
data are called bookies. They
persist data for Pulsar.
Broker 0 Broker 1 Broker 2
Brokers are “stateless”. They
serve clients for producing and
consuming events
ZooKeeper
Bookie 0 Bookie 1 Bookie 2
The processes for storing
data are called bookies. They
persist data for Pulsar.
Broker 0 Broker 1 Broker 2
Brokers are “stateless”. They
serve clients for producing and
consuming events
ZooKeeper
ZooKeeper
ZooKeeper
ZooKeeper is used for storing the
metadata for Pulsar and
bookkeeper as well as for
discovering brokers and bookies.
Pulsar Producer 0 Producer 1
Topic
Partition 0 Partition 1 Partition 2
Broker X Broker Y Broker Z
Subscription A
Consumer (P012)
Produce Producer 0 Producer 1
Topic
Partition 0 Partition 1 Partition 2
Broker 0 Broker 1 Broker 2
Bookie 0 Bookie 1 Bookie 2
1. A message is created and a
partition is selected
2. The message is sent to the
owner broker that serves the
selected partition
3. The message is written to N bookies in
parallel by the owner broker. The message
is written once and stored in their entirety.
4. Once the message has been
written by 2 bookies, the broker
will acknowledge the message
Consume
(Cached)
Topic
Partition 0 Partition 1 Partition 2
Broker 0 Broker 1 Broker 2
Bookie 0 Bookie 1 Bookie 2
Consumer (P012)
1. The consumer subscribes to a
topic. It connects to the owner
brokers serving the partitions.
2. Broker sends messages for the
partition coming out of its
memory cache
3. Consumer acknowledges a
message after processing it.
Broker updates cursor once it
receives acknowledgment.
Consume
(BK)
Topic
Partition 0 Partition 1 Partition 2
Broker 0 Broker 1 Broker 2
Bookie 0 Bookie 1 Bookie 2
Consumer (P012)
1. The consumer subscribes to a
topic. It connects to the owner
brokers serving the partitions.
2. Broker does not have the data in
the memory and will read from one
of the Bookies that have the data.
3. Consumer acknowledges a
message after processing it.
Broker updates cursor once it
receives acknowledgment.
Failures Producer 0 Producer 1
Topic
Partition 0 Partition 1 Partition 2
Broker 0 Broker 1 Broker 2
Bookie 0 Bookie 1 Bookie 2
In flights messages will be
automatically retried by
Pulsar clients
Brokers are stateless. Any
broker process that dies that
doesn’t impact data storage.
Consumer (P012)
When a bookie dies, all the data
is still accessible and will be
replicated by other replicas
Message Retention
Message retention
✓ Retention
✓ TTL
✓ Message backlog
✓ Storage size
Subscription & Cursor
Partition (Event Stream)
Subscription A
(1, 1)
Subscription B
(2, 2)
Subscription C
(3, 2)
Subscription Initial Position
Partition (Event Stream)
Earliest
Partition (Event Stream)
SubscriptionInitialPosition
Earliest
Latest
Partition (Event Stream)
SubscriptionInitialPosition
Latest
Seek
Partition (Event Stream)
Subscription
(x, y)
Unsubscribe
Partition (Event Stream)
Subscription
(x, y)
Message retention (1)
Partition (Event Stream)
Subscription B
(2, 2)
Subscription C
(3, 2)
Message retention (2)
Partition (Event Stream)
Subscription B
(2, 2)
Subscription C
(3, 2)
NOT OK to deleteOK to delete
Message retention (3)
Partition (Event Stream)
Subscription B
(2, 2)
Subscription C
(3, 2)
NOT OK to deleteOK to delete Message Retention
Message retention (4)
Partition (Event Stream)
Subscription B
(2, 2)
Subscription C
(3, 2)
Yet to be processedOK to delete Message Retention
Message retention (5)
Acked
Msg 1
Acked
Msg 2
Acked
Msg 3
Acked
Msg 4
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Unacked
Msg 9
Unacked
Msg 10
Unacked
Msg 11
Deleted Retention Yet to be processed
Message expiry (1)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Unacked
Msg 9
Unacked
Msg 10
Unacked
Msg 11
Deleted Retention
Not within TTL
(may still be processed)
Unacked
Msg 12
Unacked
Msg 13
Unacked
Msg 14
Unacked
Msg 15
Within the applied TTL
Message expiry (2)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Not within TTL
(may still be processed)
Acked
Msg 12
Unacked
Msg 13
Unacked
Msg 14
Unacked
Msg 15
Backlog (1)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Unacked
Msg 9
Unacked
Msg 10
Unacked
Msg 11
Deleted Retention
Unacked
Msg 12
Unacked
Msg 13
Unacked
Msg 14
Unacked
Msg 15
Yet to be processed
Backlog (2)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Unacked
Msg 9
Unacked
Msg 10
Unacked
Msg 11
Deleted Retention
Unacked
Msg 12
Unacked
Msg 13
Unacked
Msg 14
Unacked
Msg 15
Yet to be processed
SUB 0 SUB 2
Backlog
Message deletion (1)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Acked
Msg 12
Acked
Msg 13
Acked
Msg 14
Acked
Msg 15
Message deletion (2)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Acked
Msg 12
Acked
Msg 13
Acked
Msg 14
Acked
Msg 15
Message deletion (3)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Acked
Msg 12
Acked
Msg 13
Acked
Msg 14
Acked
Msg 15
S1 S2 S3 S4
Message deletion (4)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Acked
Msg 12
Acked
Msg 13
Acked
Msg 14
Acked
Msg 15
S1 S2 S3 S4
Message deletion (5)
Acked
Msg 5
Acked
Msg 6
Acked
Msg 7
Acked
Msg 8
Acked
Msg 9
Acked
Msg 10
Acked
Msg 11
Deleted Retention
Acked
Msg 12
Acked
Msg 13
Acked
Msg 14
Acked
Msg 15
S1 S2 S3 S4
Storage size
✓ All the storage occupied by the “undeleted”
segments, in bytes
Message deletion
✓ Messages are deleted segment by segment
✓ The disk space of a segment is reclaimed by a
garbage collector thread after it is deleted
✓ The garbage collector is running periodically
○ gcWaitTime
Retention settings
✓ Retention (broker / namespace)
○ defaultRetentionTimeInMinutes
○ defaultRetentionSizeInMB
✓ TTL (broker / namespace)
○ ttlDurationDefaultInSeconds
Trigger retention
✓ Ledger Rollover
○ managedLedgerMinLedgerRolloverTimeMinutes
○ managedLedgerMaxLedgerRolloverTimeMinutes
○ managedLedgerMaxEntriesPerLedger
Garbage collection settings
✓ Bookie settings
○ gcWaitTime
○ majorCompactionThreshold
○ majorCompactionInterval
○ minorCompactionThreshold
○ minorCompactionInterval

More Related Content

What's hot

RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
Houcheng Lin
 
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
StreamNative
 

What's hot (20)

Pulsar for Kafka People
Pulsar for Kafka PeoplePulsar for Kafka People
Pulsar for Kafka People
 
Building a Messaging Solutions for OVHcloud with Apache Pulsar_Pierre Zemb
Building a Messaging Solutions for OVHcloud with Apache Pulsar_Pierre ZembBuilding a Messaging Solutions for OVHcloud with Apache Pulsar_Pierre Zemb
Building a Messaging Solutions for OVHcloud with Apache Pulsar_Pierre Zemb
 
Securing your Pulsar Cluster with Vault_Chris Kellogg
Securing your Pulsar Cluster with Vault_Chris KelloggSecuring your Pulsar Cluster with Vault_Chris Kellogg
Securing your Pulsar Cluster with Vault_Chris Kellogg
 
Large scale log pipeline using Apache Pulsar_Nozomi
Large scale log pipeline using Apache Pulsar_NozomiLarge scale log pipeline using Apache Pulsar_Nozomi
Large scale log pipeline using Apache Pulsar_Nozomi
 
Scaling customer engagement with apache pulsar
Scaling customer engagement with apache pulsarScaling customer engagement with apache pulsar
Scaling customer engagement with apache pulsar
 
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
 
Handle Large Messages In Apache Kafka
Handle Large Messages In Apache KafkaHandle Large Messages In Apache Kafka
Handle Large Messages In Apache Kafka
 
Kafka on Pulsar
Kafka on Pulsar Kafka on Pulsar
Kafka on Pulsar
 
Apache Pulsar Seattle - Meetup
Apache Pulsar Seattle - MeetupApache Pulsar Seattle - Meetup
Apache Pulsar Seattle - Meetup
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
 
How Splunk Mission Control leverages various Pulsar subscription types_Pranav...
How Splunk Mission Control leverages various Pulsar subscription types_Pranav...How Splunk Mission Control leverages various Pulsar subscription types_Pranav...
How Splunk Mission Control leverages various Pulsar subscription types_Pranav...
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
 
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2
 
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
 
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
Pushing Pulsar Performance to the Limits - Pulsar Summit NA 2021
 
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...
 
Interactive querying of streams using Apache Pulsar_Jerry peng
Interactive querying of streams using Apache Pulsar_Jerry pengInteractive querying of streams using Apache Pulsar_Jerry peng
Interactive querying of streams using Apache Pulsar_Jerry peng
 
Reduce Redundant Producers from Partitioned Producer - Pulsar Summit NA 2021
Reduce Redundant Producers from Partitioned Producer - Pulsar Summit NA 2021Reduce Redundant Producers from Partitioned Producer - Pulsar Summit NA 2021
Reduce Redundant Producers from Partitioned Producer - Pulsar Summit NA 2021
 

Similar to TGIPulsar - EP #006: Lifecycle of a Pulsar message

Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
Enkitec
 
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
HostedbyConfluent
 

Similar to TGIPulsar - EP #006: Lifecycle of a Pulsar message (20)

Dissolving the Problem: Making an ACID-Compliant Database Out of Apache Kafka
Dissolving the Problem: Making an ACID-Compliant Database Out of Apache KafkaDissolving the Problem: Making an ACID-Compliant Database Out of Apache Kafka
Dissolving the Problem: Making an ACID-Compliant Database Out of Apache Kafka
 
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
 
Proof of Concept on Kafka.pptx
Proof of Concept on Kafka.pptxProof of Concept on Kafka.pptx
Proof of Concept on Kafka.pptx
 
Bridging with StarkNet
Bridging with StarkNetBridging with StarkNet
Bridging with StarkNet
 
Wireshark - Do you know?
Wireshark - Do you know?Wireshark - Do you know?
Wireshark - Do you know?
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Apache Kafka from 0.7 to 1.0, History and Lesson Learned
Apache Kafka from 0.7 to 1.0, History and Lesson LearnedApache Kafka from 0.7 to 1.0, History and Lesson Learned
Apache Kafka from 0.7 to 1.0, History and Lesson Learned
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
Improving Logging Ingestion Quality At Pinterest: Fighting Data Corruption An...
 
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
 
Messaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQMessaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQ
 
Getting Started with Kafka on k8s
Getting Started with Kafka on k8sGetting Started with Kafka on k8s
Getting Started with Kafka on k8s
 
Building a Distributed Message Log from Scratch
Building a Distributed Message Log from ScratchBuilding a Distributed Message Log from Scratch
Building a Distributed Message Log from Scratch
 
#TwitterRealTime - Real time processing @twitter
#TwitterRealTime - Real time processing @twitter#TwitterRealTime - Real time processing @twitter
#TwitterRealTime - Real time processing @twitter
 
JDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof DębskiJDD2015: Make your world event driven - Krzysztof Dębski
JDD2015: Make your world event driven - Krzysztof Dębski
 
AndroidThing (Internet of things)
AndroidThing (Internet of things)AndroidThing (Internet of things)
AndroidThing (Internet of things)
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controller
 
Kafka short
Kafka shortKafka short
Kafka short
 
riyaj_advanced_rac_troubleshooting_rmoug_2010_ppt.pdf
riyaj_advanced_rac_troubleshooting_rmoug_2010_ppt.pdfriyaj_advanced_rac_troubleshooting_rmoug_2010_ppt.pdf
riyaj_advanced_rac_troubleshooting_rmoug_2010_ppt.pdf
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 

More from StreamNative

Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
StreamNative
 

More from StreamNative (20)

Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
Is Using KoP (Kafka-on-Pulsar) a Good Idea? - Pulsar Summit SF 2022
 
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
 
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
 
Distributed Database Design Decisions to Support High Performance Event Strea...
Distributed Database Design Decisions to Support High Performance Event Strea...Distributed Database Design Decisions to Support High Performance Event Strea...
Distributed Database Design Decisions to Support High Performance Event Strea...
 
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
Simplify Pulsar Functions Development with SQL - Pulsar Summit SF 2022
 
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
 
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
Validating Apache Pulsar’s Behavior under Failure Conditions - Pulsar Summit ...
 
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
Cross the Streams! Creating Streaming Data Pipelines with Apache Flink + Apac...
 
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
Message Redelivery: An Unexpected Journey - Pulsar Summit SF 2022
 
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
Unlocking the Power of Lakehouse Architectures with Apache Pulsar and Apache ...
 
Understanding Broker Load Balancing - Pulsar Summit SF 2022
Understanding Broker Load Balancing - Pulsar Summit SF 2022Understanding Broker Load Balancing - Pulsar Summit SF 2022
Understanding Broker Load Balancing - Pulsar Summit SF 2022
 
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
Building an Asynchronous Application Framework with Python and Pulsar - Pulsa...
 
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
Pulsar's Journey in Yahoo!: On-prem, Cloud and Hybrid - Pulsar Summit SF 2022
 
Event-Driven Applications Done Right - Pulsar Summit SF 2022
Event-Driven Applications Done Right - Pulsar Summit SF 2022Event-Driven Applications Done Right - Pulsar Summit SF 2022
Event-Driven Applications Done Right - Pulsar Summit SF 2022
 
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
Pulsar @ Scale. 200M RPM and 1K instances - Pulsar Summit SF 2022
 
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
Data Democracy: Journey to User-Facing Analytics - Pulsar Summit SF 2022
 
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
 
Welcome and Opening Remarks - Pulsar Summit SF 2022
Welcome and Opening Remarks - Pulsar Summit SF 2022Welcome and Opening Remarks - Pulsar Summit SF 2022
Welcome and Opening Remarks - Pulsar Summit SF 2022
 
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
Log System As Backbone – How We Built the World’s Most Advanced Vector Databa...
 
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
 

Recently uploaded

6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 

Recently uploaded (20)

6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 

TGIPulsar - EP #006: Lifecycle of a Pulsar message

  • 1.
  • 2. streamnative.io Lifecycle of a Pulsar Message #TGIPulsar EP-006
  • 3. Message Lifecycle ✓ Message Flow ✓ Message Retention
  • 5. Brokers + Bookies Bookie 0 Bookie 1 Bookie 2 The processes for storing data are called bookies. They persist data for Pulsar. Broker 0 Broker 1 Broker 2 Brokers are “stateless”. They serve clients for producing and consuming events
  • 6. ZooKeeper Bookie 0 Bookie 1 Bookie 2 The processes for storing data are called bookies. They persist data for Pulsar. Broker 0 Broker 1 Broker 2 Brokers are “stateless”. They serve clients for producing and consuming events ZooKeeper ZooKeeper ZooKeeper ZooKeeper is used for storing the metadata for Pulsar and bookkeeper as well as for discovering brokers and bookies.
  • 7. Pulsar Producer 0 Producer 1 Topic Partition 0 Partition 1 Partition 2 Broker X Broker Y Broker Z Subscription A Consumer (P012)
  • 8. Produce Producer 0 Producer 1 Topic Partition 0 Partition 1 Partition 2 Broker 0 Broker 1 Broker 2 Bookie 0 Bookie 1 Bookie 2 1. A message is created and a partition is selected 2. The message is sent to the owner broker that serves the selected partition 3. The message is written to N bookies in parallel by the owner broker. The message is written once and stored in their entirety. 4. Once the message has been written by 2 bookies, the broker will acknowledge the message
  • 9. Consume (Cached) Topic Partition 0 Partition 1 Partition 2 Broker 0 Broker 1 Broker 2 Bookie 0 Bookie 1 Bookie 2 Consumer (P012) 1. The consumer subscribes to a topic. It connects to the owner brokers serving the partitions. 2. Broker sends messages for the partition coming out of its memory cache 3. Consumer acknowledges a message after processing it. Broker updates cursor once it receives acknowledgment.
  • 10. Consume (BK) Topic Partition 0 Partition 1 Partition 2 Broker 0 Broker 1 Broker 2 Bookie 0 Bookie 1 Bookie 2 Consumer (P012) 1. The consumer subscribes to a topic. It connects to the owner brokers serving the partitions. 2. Broker does not have the data in the memory and will read from one of the Bookies that have the data. 3. Consumer acknowledges a message after processing it. Broker updates cursor once it receives acknowledgment.
  • 11. Failures Producer 0 Producer 1 Topic Partition 0 Partition 1 Partition 2 Broker 0 Broker 1 Broker 2 Bookie 0 Bookie 1 Bookie 2 In flights messages will be automatically retried by Pulsar clients Brokers are stateless. Any broker process that dies that doesn’t impact data storage. Consumer (P012) When a bookie dies, all the data is still accessible and will be replicated by other replicas
  • 13. Message retention ✓ Retention ✓ TTL ✓ Message backlog ✓ Storage size
  • 14. Subscription & Cursor Partition (Event Stream) Subscription A (1, 1) Subscription B (2, 2) Subscription C (3, 2)
  • 20. Message retention (1) Partition (Event Stream) Subscription B (2, 2) Subscription C (3, 2)
  • 21. Message retention (2) Partition (Event Stream) Subscription B (2, 2) Subscription C (3, 2) NOT OK to deleteOK to delete
  • 22. Message retention (3) Partition (Event Stream) Subscription B (2, 2) Subscription C (3, 2) NOT OK to deleteOK to delete Message Retention
  • 23. Message retention (4) Partition (Event Stream) Subscription B (2, 2) Subscription C (3, 2) Yet to be processedOK to delete Message Retention
  • 24. Message retention (5) Acked Msg 1 Acked Msg 2 Acked Msg 3 Acked Msg 4 Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Unacked Msg 9 Unacked Msg 10 Unacked Msg 11 Deleted Retention Yet to be processed
  • 25. Message expiry (1) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Unacked Msg 9 Unacked Msg 10 Unacked Msg 11 Deleted Retention Not within TTL (may still be processed) Unacked Msg 12 Unacked Msg 13 Unacked Msg 14 Unacked Msg 15 Within the applied TTL
  • 26. Message expiry (2) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Not within TTL (may still be processed) Acked Msg 12 Unacked Msg 13 Unacked Msg 14 Unacked Msg 15
  • 27. Backlog (1) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Unacked Msg 9 Unacked Msg 10 Unacked Msg 11 Deleted Retention Unacked Msg 12 Unacked Msg 13 Unacked Msg 14 Unacked Msg 15 Yet to be processed
  • 28. Backlog (2) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Unacked Msg 9 Unacked Msg 10 Unacked Msg 11 Deleted Retention Unacked Msg 12 Unacked Msg 13 Unacked Msg 14 Unacked Msg 15 Yet to be processed SUB 0 SUB 2 Backlog
  • 29. Message deletion (1) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Acked Msg 12 Acked Msg 13 Acked Msg 14 Acked Msg 15
  • 30. Message deletion (2) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Acked Msg 12 Acked Msg 13 Acked Msg 14 Acked Msg 15
  • 31. Message deletion (3) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Acked Msg 12 Acked Msg 13 Acked Msg 14 Acked Msg 15 S1 S2 S3 S4
  • 32. Message deletion (4) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Acked Msg 12 Acked Msg 13 Acked Msg 14 Acked Msg 15 S1 S2 S3 S4
  • 33. Message deletion (5) Acked Msg 5 Acked Msg 6 Acked Msg 7 Acked Msg 8 Acked Msg 9 Acked Msg 10 Acked Msg 11 Deleted Retention Acked Msg 12 Acked Msg 13 Acked Msg 14 Acked Msg 15 S1 S2 S3 S4
  • 34. Storage size ✓ All the storage occupied by the “undeleted” segments, in bytes
  • 35. Message deletion ✓ Messages are deleted segment by segment ✓ The disk space of a segment is reclaimed by a garbage collector thread after it is deleted ✓ The garbage collector is running periodically ○ gcWaitTime
  • 36. Retention settings ✓ Retention (broker / namespace) ○ defaultRetentionTimeInMinutes ○ defaultRetentionSizeInMB ✓ TTL (broker / namespace) ○ ttlDurationDefaultInSeconds
  • 37. Trigger retention ✓ Ledger Rollover ○ managedLedgerMinLedgerRolloverTimeMinutes ○ managedLedgerMaxLedgerRolloverTimeMinutes ○ managedLedgerMaxEntriesPerLedger
  • 38. Garbage collection settings ✓ Bookie settings ○ gcWaitTime ○ majorCompactionThreshold ○ majorCompactionInterval ○ minorCompactionThreshold ○ minorCompactionInterval