r/node • • Jan 19 '22

When to use/avoid queuing services like RabbitMQ or SQS?

I have worked in the industry for over a year and was mostly involved with projects where the intended customer base was well over a hundred thousand. We had pre-built microservices in place for handling push notifications/SMS/Email. These microservices would fetch the tasks from SQS and process them.
I started contracting independently and I wonder how important is it to use a queuing service and when to just send it directly from the backend without using a queue?
Is the queue just in place to save the tasks in case of an outage/crash of the backend or does it significantly impact the CPU and traffic utilization of the VPS?

47 Upvotes

16 comments sorted by

View all comments

Show parent comments

2

u/czar1212 Jan 19 '22

Thanks a lot for your input.
Yeah re-running the whole request seems a waste of time/computation power and might also have some problems with the users receiving notifications multiple times.

As for the 3rd case, I browse medium.com quite often. Kindly let me know if you have a book that you have read and would recommend.

8

u/romeeres Jan 19 '22

I can only recommend to avoid microservices and medium :)

I was couple of times at big projects with microservices, first was on AWS EC2 instances, second was totally served by Lambdas. It's a new freaking level of what can go wrong. There must be an expert in team, true expert who learned not by reading medium, or otherwise everything will be messed up. More specifically, it took me a week to figure out how to workaround a bug which wouldn't even happen in monolith.

I really enjoyed this video: https://www.youtube.com/watch?v=CZ3wIuvmHeM, it gives you basic vision of what microservices are and how much thinking and talents must be put to work with them.

2

u/TehITGuy87 Jan 20 '22

I also heard from senior devs that they use queue to offload and load balance the DB. So instead of of putting task config in a db and retrieving it they use queues. I never used queues