Mahesh Mallikarjunaiah ↗️’s Post

View profile for Mahesh Mallikarjunaiah ↗️, graphic

Engineering Leader | Technology Transformation | SaaS | Cloud | DevOps | Innovation

Pub/Sub and queue look the same when you hear it for the first time.😱 Here is a simple explanation of what they are and the differences between them. In the illustration depicted below, 🔴 Messaging Queue: People come to the mall to shop. Before they check out, they must wait in the queue to complete the payment. Here, the mall is like a producer, producing people ( who have shopped and are ready to complete payment) who are sent to the queue to complete the payment. One by one, each person completes payment at the checkout counter. The checkout counter is like a consumer. As the queue grows ( more people join the line), more than one checkout ( one consumer ) is needed, and we will need to add more checkout counters ( more consumers). We have Producers, Queues, and Consumers. 🔴 Pub / Sub - Extending on the above example, after the checkout is completed, this customer data might be required by various services. For instance, in the image below, we have a real-time service that calculates how many people have completed the checkout. Hence, the checkout service has subscribed to receive this data. Likewise, marketing and inventory services might subscribe to receive this data. We have Producers, Topics, and Subscribers. 𝗣𝘂𝗯/𝘀𝘂𝗯:⏹️ The subscribers don’t have to reveal anything to the publishers. Messages are in the topic even after multiple subscribers consume it. Messages are sent to multiple subscribers simultaneously and asynchronously Message ordering and sending to various consumers is not guaranteed Producers and consumers have loose coupling 𝗤𝘂𝗲𝘂𝗲: ⏹️ Queues need to reveal who they are sending messages to Producers would put the messages in the queue, storing them until one of the consumers consumes them Producers put the messages in the queue, typically sent using some ordering and sequentially to a single receiver Message ordering and sending to consumers is guaranteed Producers and consumers have some sort of relationship #engineering #systemdesign #interview #productdevelopment #eventdrivenarchitecture

  • No alternative text description for this image
Naveen chandrawanshi

14K I Top Programming Voice | Software engineer @TCS | Ex-Cognizant | software developer| Microservices | Api Design | Cloud Integrations | system design | Python | Open for collaboration

6mo

Thanks for sharing

Gaurav Pandey

LinkedIn Top Voice’24 | Software Engineer | 🚀 69K+ @LinkedIn Family | MERN Stack ⚛️ | React NodeJS | Full Stack Developer | Mentor

6mo

Informative comparison, illustrating the nuances between Pub/Sub and Queues.

Alexandre Zajac

SDE & AI @Amazon | Building Hungry Minds to 1M+ | Daily Posts on Software Engineering, System Design, and AI ⚡

6mo

Thanks for sharing this important difference 🔥

Raul Junco

Simplifying System Design

6mo

Simply put, Mahesh Mallikarjunaiah ↗️ 👌

Chaitanya Kulkarni

Cloud Operation Engineer

6mo

Nicely explained

Manish Jaiswal

Senior Engineer@Stryker | Ex- Nagarro | .NET | Angular | System Design | Problem Solving | SQL Server | 1 X GCP

6mo

Pub-Sub is the backbone of modern applications! Thaks for sharing Mahesh Mallikarjunaiah ↗️

Pallavi Ghanshani

AI & Software Engineering | Organic Growth Strategist | Helping Brands to Grow | Open For Collaboration 🤝

6mo
Hina Arora

Career Branding Coach mentoring techies to create an online presence for Job Opportunities & Career Growth | Mentored 1000+ people | Career Development Coach | Public Speaker | Engineering Manager at Jio

6mo

Mahesh Mallikarjunaiah ↗️ Clear and insightful breakdown! Understanding the nuances between Pub/Sub and queues is key for efficient data processing and system design.

See more comments

To view or add a comment, sign in

Explore topics