0

I am building a simple feature, where multiple hundreds of users will be clicking a button for adding a product as a favorite item. I am currently thinking of using Redis + Sidekiq, but had a question about whether Redis is actually essential at all. For simplification I am posting a incomplete diagram, so as to reduce the scope of this question only to Sidekiq and Redis.

Redis + Sidekiq

enter image description here

Use clicks fav button -> API req to microservice -> Redis -> Sidekiq -> DB

I wanted to know why does Redis needs to be used, will this help at all for hundreds of thousands of requests? Keep in mind Redis is being used for queueing and not permanent storage and Redis needs to trigger Sidekiq to run the job and enter the data in the database (i.e. Sidekiq what be running batch updates or checking if Redis has some data, Sidekiq needs to be triggered).

Or does the below flow make more sense I.E. exclude Redis completely ? let the micro service trigger Sidekiq every time a request comes in. I'm just wondering when we say "queueing" how exactly is it helping in my fav button scenario. I am a beginner, but I'm not much of a backend dev.

enter image description here

I.E. Use clicks fav button -> API req to microservice -> Redis -> DB

halfer
  • 19,824
  • 17
  • 99
  • 186
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174
  • Hey Alexander. I wonder if I could trouble you to start using a spell checker? You've been here for nearly 8 years, and have asked some 630+ questions - that is a lot of fixing for volunteer editors. Does your browser have a spell checker built in? Most do these days, at least on the desktop. – halfer Sep 25 '22 at 10:58
  • 1
    It is apparently not well known across all prolific question-askers that on Stack Overflow we are attempting to curate a resource for future developers. If in that process a single question-asker gets a solution to their problem, that is an excellent side-effect. A corollary of this policy is that we want questions to be useful even after their author has finished with them, which is why it is ideal if some attention can be paid to case, spelling, grammar, etc. – halfer Sep 25 '22 at 11:01
  • 1
    @halfer noted ! i'll run it through a spell checker next time. – Alexander Solonik Sep 26 '22 at 09:51

0 Answers0