SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Messaging Queue
-Kafka
What is Messaging Queue ?
Which software is best fit for our service ?
-Amazon SQS, Amazon SNS, Apache Kafka, Rabbit MQ, IBM MQ
Can we create our own Messaging Queue ?
Queue contains sequence of messages, sent between applications, awaiting their turn to be processed.
Message is the data to be sent from producer to consumer.
Why Messaging Queue ?
Why can’t we have Rest APIs everywhere ?
Sync Call
Failed Case
Why Messaging Queue ?
Async Call
Failed Case
Messaging Queue
Kafka
Distributed streaming platform●
Real-time streaming of data.●
Can handle billions of messages in
a day.
●
High throughput, reliability,
replication capabilities.
●
Amazon MSK - Amazon Manager
Streaming for Apache Kafka.
●
Linkedin, Twitter, Netflix, etc.●
Kafka - Terminologies
Kafka Cluster - Cluster of one or more servers (Kafka Brokers) to maintain the load balanced.●
Kafka broker - Broker is a Kafka server. They shares information between each other.●
Bootstrap Server - Server used for the initial connection to Kafka cluster. Consists of
Host:Port.
●
Producer - Produces the message and send to a topic (partition).●
Consumer - Polls the message from the topic (partition).●
Consumer Group - A message can be read by once in each Consumer Group. - SNS Handlers●
Kafka - Terminologies
Topic - To store or publish particular streams of data. A topic can have one or more partitions.●
Partition - To support the parallelism for fast processing. - SQS Messaging Group.●
Segment - Data is stored into segments. A partition is divided into multiple segments.●
Offset - To uniquely identify the message in each partition. It starts from 0 for each partition.●
Zookeeper - Manages election algorithm for brokers. Each partition has its own leader.●
Producer
Sends data with topic only●
Producer partitioner decides the
partition.
○
Default Round-Robin algorithm is used.
We can implement our own.
○
Sends data with topic and Partition Id●
Directly selects the partition and sends
the data.
○
Sends data with topic and Partition Key●
Create a hash value of partition key and
basis that decides partition id.
○
It is similar to SQS message group id.○
Kafka Broker Data Storage
Segments
Segments are named by their base offset. The
base offset of a segment is an offset greater
than offsets in previous segments and less
than or equal to offsets in that segment.
segment.index - The segment index maps
offsets to their message’s position in the
segment log.
●
segment.log - stores the actual message.●
Consumer
All partitions are assigned to the
only consumer
Partitions are equally divided and
assign to the consumers
Each partition maps to each
consumer
When more no. of consumers -
they become idle
Each partition is only consumed by
a single consumer from the group
Partition Allocation
Consumer
Reads messages from a Parition
Offset: from-beginning●
On restart, reads from first available offset.○
Not from 1. As Kafka has default retention of
7 days.
○
Offset: earliest●
On restart, reads from last committed offset.○
Auto commit: commits after 5 sec of poll call.○
Manual commit: send the ack manually to
broker with the offset.
○
Offset: latest●
On restart, reads from the latest message.○
Used for Real-time cases. ○
Types of Message Delivery
At most once delivered●
If the producer does not retry when an ack times out, then the message might end up
not being written to the Kafka topic.
○
Producer waits for only one ack. - acks=1○
20 times faster.○
At least once delivered●
If a producer retries, if the broker had failed right before it sent the ack but after the
message was successfully written to the Kafka topic, this retry leads to the message
being written twice. (Standard SQS)
○
Producer waits for all the ack. -acks=all○
3 times faster.○
Exactly once delivered●
Unique identifier is required. So whenever producer sends the duplicate, broker will not
store that message again. - enable.idempotence=true (FIFO SQS)
○
 Difficult to handle it at consumer end, manual offset needs to handled carefully.○
Alternate way is transaction from producer sends till ack received from consumer.○
Zookeeper
Electing a controller. It maintains the
leader/follower relationship for all the
partitions. 
●
When a node shuts down, it tells other
replicas to become partition leaders.
●
Manage service discovery for Kafka
Brokers that form the cluster.
●
 Sends changes of the topology to
Kafka, so each node in the cluster
knows when a new broker joined, a
Broker died, a topic was removed or a
topic was added, etc. 
●
SQS vs Kafka
Paramter AWS SQS Apache Kafka
Order of Messages Standard Queue: can be out of order
FIFO Queue: in order within message group
in order within the partition
Message Delivery
Standard Queue: At least once delivered
FIFO Queue: Exactly once delivered
provide all three types of message delivery. At-most once,
atleast once and exactly once.
Retention
Default: 4 days
upto 14 days
Default: 7 days
upto 14 days
Metrics CloudWatch Metrics openTSDB - to analyse number of packets
yet to be consumed on each partition/
Security IAM, AWS KMS - Key Management Service Kerberos
Consume same message Connect SQS with SNS Using Consumer Group
Cost
Pay as you use
depends on req/sec and data transfer/sec
Open-source
Server cost and magement cost
Long Polling can reduce cost
max value- 20 sec
Not providing this feature
Poll interval is configurable
Exception Handling Dead-Letter Queues Handle manually - create a separate topic for this
Message Size
Default: 256 KB
to increase further - connect with S3 (support upto 2 GB)
Default: 1 MB
to increase further: change configs of producer, brokers, consumers
Serialization/Deserialization Default: String
Default: String
Avro, protobuf
Throughput Standard Queue: Unlimited
FIFO Queue: 300/sec (10 messages in batch- 3000/sec)
Very High
Questions?

Mais conteúdo relacionado

Mais procurados

A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache KafkaPaul Brebner
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlJiangjie Qin
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaJeff Holoman
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우if kakao
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafkaconfluent
 
Apache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - VerisignApache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - VerisignMichael Noll
 
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)Hyunmin Lee
 
[오픈소스컨설팅] 서비스 메쉬(Service mesh)
[오픈소스컨설팅] 서비스 메쉬(Service mesh)[오픈소스컨설팅] 서비스 메쉬(Service mesh)
[오픈소스컨설팅] 서비스 메쉬(Service mesh)Open Source Consulting
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Araf Karsh Hamid
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using KafkaKnoldus Inc.
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin PodvalMartin Podval
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안SANG WON PARK
 
How is Kafka so Fast?
How is Kafka so Fast?How is Kafka so Fast?
How is Kafka so Fast?Ricardo Paiva
 

Mais procurados (20)

A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache Kafka - Overview
Apache Kafka - OverviewApache Kafka - Overview
Apache Kafka - Overview
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
kafka
kafkakafka
kafka
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
Apache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - VerisignApache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - Verisign
 
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
 
[오픈소스컨설팅] 서비스 메쉬(Service mesh)
[오픈소스컨설팅] 서비스 메쉬(Service mesh)[오픈소스컨설팅] 서비스 메쉬(Service mesh)
[오픈소스컨설팅] 서비스 메쉬(Service mesh)
 
Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin Podval
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
How is Kafka so Fast?
How is Kafka so Fast?How is Kafka so Fast?
How is Kafka so Fast?
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 

Semelhante a Messaging Queue Software Comparison

Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenDimosthenis Botsaris
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Drivenarconsis
 
Kafka Overview
Kafka OverviewKafka Overview
Kafka Overviewiamtodor
 
Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-CamusDeep Shah
 
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
 
Kafka basics and best prectices
Kafka basics and best precticesKafka basics and best prectices
Kafka basics and best precticesRohitSingh542417
 
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
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdfTarekHamdi8
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQShameera Rathnayaka
 
A Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka SkillsA Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka SkillsRavindra kumar
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperAnandMHadoop
 
Timothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLTimothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLEdunomica
 

Semelhante a Messaging Queue Software Comparison (20)

Kafka Deep Dive
Kafka Deep DiveKafka Deep Dive
Kafka Deep Dive
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Driven
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Driven
 
Kafka Overview
Kafka OverviewKafka Overview
Kafka Overview
 
Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-Camus
 
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
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Kafka basics and best prectices
Kafka basics and best precticesKafka basics and best prectices
Kafka basics and best prectices
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018Non-Kafkaesque Apache Kafka - Yottabyte 2018
Non-Kafkaesque Apache Kafka - Yottabyte 2018
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
A Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka SkillsA Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka Skills
 
Event driven-arch
Event driven-archEvent driven-arch
Event driven-arch
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and Zookeeper
 
Kafka aws
Kafka awsKafka aws
Kafka aws
 
Timothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for MLTimothy Spann: Apache Pulsar for ML
Timothy Spann: Apache Pulsar for ML
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Messaging Queue Software Comparison

  • 2. What is Messaging Queue ? Which software is best fit for our service ? -Amazon SQS, Amazon SNS, Apache Kafka, Rabbit MQ, IBM MQ Can we create our own Messaging Queue ? Queue contains sequence of messages, sent between applications, awaiting their turn to be processed. Message is the data to be sent from producer to consumer.
  • 3. Why Messaging Queue ? Why can’t we have Rest APIs everywhere ? Sync Call Failed Case
  • 4. Why Messaging Queue ? Async Call Failed Case Messaging Queue
  • 5. Kafka Distributed streaming platform● Real-time streaming of data.● Can handle billions of messages in a day. ● High throughput, reliability, replication capabilities. ● Amazon MSK - Amazon Manager Streaming for Apache Kafka. ● Linkedin, Twitter, Netflix, etc.●
  • 6. Kafka - Terminologies Kafka Cluster - Cluster of one or more servers (Kafka Brokers) to maintain the load balanced.● Kafka broker - Broker is a Kafka server. They shares information between each other.● Bootstrap Server - Server used for the initial connection to Kafka cluster. Consists of Host:Port. ● Producer - Produces the message and send to a topic (partition).● Consumer - Polls the message from the topic (partition).● Consumer Group - A message can be read by once in each Consumer Group. - SNS Handlers●
  • 7. Kafka - Terminologies Topic - To store or publish particular streams of data. A topic can have one or more partitions.● Partition - To support the parallelism for fast processing. - SQS Messaging Group.● Segment - Data is stored into segments. A partition is divided into multiple segments.● Offset - To uniquely identify the message in each partition. It starts from 0 for each partition.● Zookeeper - Manages election algorithm for brokers. Each partition has its own leader.●
  • 8. Producer Sends data with topic only● Producer partitioner decides the partition. ○ Default Round-Robin algorithm is used. We can implement our own. ○ Sends data with topic and Partition Id● Directly selects the partition and sends the data. ○ Sends data with topic and Partition Key● Create a hash value of partition key and basis that decides partition id. ○ It is similar to SQS message group id.○
  • 9. Kafka Broker Data Storage Segments Segments are named by their base offset. The base offset of a segment is an offset greater than offsets in previous segments and less than or equal to offsets in that segment. segment.index - The segment index maps offsets to their message’s position in the segment log. ● segment.log - stores the actual message.●
  • 10. Consumer All partitions are assigned to the only consumer Partitions are equally divided and assign to the consumers Each partition maps to each consumer When more no. of consumers - they become idle Each partition is only consumed by a single consumer from the group Partition Allocation
  • 11. Consumer Reads messages from a Parition Offset: from-beginning● On restart, reads from first available offset.○ Not from 1. As Kafka has default retention of 7 days. ○ Offset: earliest● On restart, reads from last committed offset.○ Auto commit: commits after 5 sec of poll call.○ Manual commit: send the ack manually to broker with the offset. ○ Offset: latest● On restart, reads from the latest message.○ Used for Real-time cases. ○
  • 12. Types of Message Delivery At most once delivered● If the producer does not retry when an ack times out, then the message might end up not being written to the Kafka topic. ○ Producer waits for only one ack. - acks=1○ 20 times faster.○ At least once delivered● If a producer retries, if the broker had failed right before it sent the ack but after the message was successfully written to the Kafka topic, this retry leads to the message being written twice. (Standard SQS) ○ Producer waits for all the ack. -acks=all○ 3 times faster.○ Exactly once delivered● Unique identifier is required. So whenever producer sends the duplicate, broker will not store that message again. - enable.idempotence=true (FIFO SQS) ○  Difficult to handle it at consumer end, manual offset needs to handled carefully.○ Alternate way is transaction from producer sends till ack received from consumer.○
  • 13. Zookeeper Electing a controller. It maintains the leader/follower relationship for all the partitions.  ● When a node shuts down, it tells other replicas to become partition leaders. ● Manage service discovery for Kafka Brokers that form the cluster. ●  Sends changes of the topology to Kafka, so each node in the cluster knows when a new broker joined, a Broker died, a topic was removed or a topic was added, etc.  ●
  • 14. SQS vs Kafka Paramter AWS SQS Apache Kafka Order of Messages Standard Queue: can be out of order FIFO Queue: in order within message group in order within the partition Message Delivery Standard Queue: At least once delivered FIFO Queue: Exactly once delivered provide all three types of message delivery. At-most once, atleast once and exactly once. Retention Default: 4 days upto 14 days Default: 7 days upto 14 days Metrics CloudWatch Metrics openTSDB - to analyse number of packets yet to be consumed on each partition/ Security IAM, AWS KMS - Key Management Service Kerberos Consume same message Connect SQS with SNS Using Consumer Group Cost Pay as you use depends on req/sec and data transfer/sec Open-source Server cost and magement cost Long Polling can reduce cost max value- 20 sec Not providing this feature Poll interval is configurable Exception Handling Dead-Letter Queues Handle manually - create a separate topic for this Message Size Default: 256 KB to increase further - connect with S3 (support upto 2 GB) Default: 1 MB to increase further: change configs of producer, brokers, consumers Serialization/Deserialization Default: String Default: String Avro, protobuf Throughput Standard Queue: Unlimited FIFO Queue: 300/sec (10 messages in batch- 3000/sec) Very High