Distributed Computing using a Redis Queue

Поделиться
HTML-код
  • Опубликовано: 17 янв 2025

Комментарии • 74

  • @doejones48
    @doejones48 Год назад +3

    Man, I've been struggling with multiprocessing in python and this solution is a game changer! Thanks a lot for that!

  • @sampri22
    @sampri22 8 месяцев назад +2

    Very good video, bravo to the creator! Very clear explanation, not boring. Would love to see more and more content from you

    • @mathbyteacademy
      @mathbyteacademy  8 месяцев назад

      Thank you! I add content to this channel regularly, there's also quite a number of videos already, plus I have my Udemy courses with even more content.

  • @rluijk
    @rluijk 3 месяца назад

    Thanks. Very nice to follow along, actually seeing the works running in the end is very nice!

  • @johnteran8889
    @johnteran8889 Год назад

    I've stumbled across this video and recognized your voice from your udemy videos. I've watched all of them (except pydantic v2 which is on my list now) and have grown considerably thanks to your efforts.

  • @Varuns36
    @Varuns36 Год назад

    sir, that was the best python tutorial of my life, thankyou very much.

  • @sprobertson
    @sprobertson 7 месяцев назад

    I like these more project-based/conceptual videos a lot, make more plz!

  • @romainjouhameau2764
    @romainjouhameau2764 2 года назад +2

    Really great tutorial ! Thanks for all your videos or courses on Udemy, I'm learning a lot
    Your examples are always very clear and understandable

  • @farishassan7727
    @farishassan7727 3 месяца назад

    Thanks i would like to see more videos from you. You are the best teacher for me

  • @jonathanpepin6326
    @jonathanpepin6326 Год назад

    Great video, nice code structure, very scalable and easy to maintain.

    • @mathbyteacademy
      @mathbyteacademy  Год назад

      Thanks! That's what I really like about this approach, it gives good scalability for a variety of problems, without any code complexity. And the queue can be anything you already have in your environment, rabbit, sqs, etc, or even redis in a pinch.

  • @RadomName3457
    @RadomName3457 Год назад

    Your explanation is very clear. Thanks a lot

  • @akmalatkhamov8760
    @akmalatkhamov8760 Год назад +4

    Please, cover the problem related to the resilience to message losses in case of worker failures. Thanks a lot in advance.

  • @RicanSamurai
    @RicanSamurai Год назад

    this was super helpful! Thanks for making this video

  • @Manfred_Z
    @Manfred_Z Год назад

    Thank you very much for this great video.
    all your videos are a garant for quality.
    I would be very happy if you make more videos to this great topic.

  • @and4828
    @and4828 Год назад +1

    Thanks for the great and to-the-point tutorial. I too would like to see some strategies for dealing with failures i.e. when a worker crashes etc.

  • @Manfred_Z
    @Manfred_Z 9 месяцев назад

    Thank you very much for this great tuturial. Your Deep Dive Tutorials at Udemy are legendary! It would be great to see more of Redis, Reliable Queue and load balancing with python.

    • @mathbyteacademy
      @mathbyteacademy  9 месяцев назад

      Thanks, glad you like them! I have no experience with ReliableQueue, but I am planning a video on ElasticMQ / SQS at some point.

  • @ipelezikis
    @ipelezikis 2 года назад

    Excellent material!

  • @joaopedrorocha4790
    @joaopedrorocha4790 Год назад

    Amazing video. Thanks!!! It looks like exactly what i needed!!

  • @chenguo8767
    @chenguo8767 Год назад +1

    Thank you Fred! Would appreciate a follow-up video on how to auto scale up and down the number of workers across different computers. Would you kindly provide any reference on that topic.

    • @mathbyteacademy
      @mathbyteacademy  Год назад

      The way I'm used to is using Kubernetes - but dev ops is not my thing. I have a colleague who's an absolute wizard at it, and he's the one that sets up the cluster with the workers. If you're looking to do this yourself, you might want to look at learning Kubernetes (also you'll want to add readyness and liveness probes to the workers).

  • @philipwong8388
    @philipwong8388 Год назад

    Thank you very much Fred! This is very good video and I have learnt a lot from you

  • @jinghaoliu
    @jinghaoliu Год назад

    Thank you for your work! This tutorial is amazing, very thorough and detailed 🙂

  • @Penfold__
    @Penfold__ 8 месяцев назад

    Brilliant video.

  • @Thesinter1
    @Thesinter1 2 года назад

    Great as always Fred! Thanks a lot.

  • @lukashk.1770
    @lukashk.1770 Год назад

    perfect as always

  • @Nnnnnnnnnnnnnnnnnchf
    @Nnnnnnnnnnnnnnnnnchf 6 месяцев назад

    👍🏻👍🏻👍🏻👍🏻👍🏻

  • @worldofcode7357
    @worldofcode7357 2 года назад

    Gracias Fred, follow-up Redis video would be great.

  • @chikosan99
    @chikosan99 Год назад

    Thanks a lot!

  • @gregdamug8314
    @gregdamug8314 2 года назад +1

    Please make a Python deep dive about Asyncio, couldn't find a good course on this matter.
    I believe many people are looking for one too

    • @gizela_gegaa923
      @gizela_gegaa923 Год назад +1

      Hey, there's one great book on Asyncio: Matthew Fowler's "Python concurrency with asyncio", difficult, but very well written and structured; saved me from vagueness of other resources once. If you take this extra mile and study it over a few days/weeks, you'll likely end up in a near-expert position on async :) Good luck

  • @takudzwamakusha5941
    @takudzwamakusha5941 2 года назад +1

    + for video on RabbitMQ!

  • @cephaspeter842
    @cephaspeter842 Год назад

    Thank you for the video. It was. Really nice, please can you help with the problem of data loss in condition of worker failure

    • @mathbyteacademy
      @mathbyteacademy  Год назад

      I would probably opt for a different queue - something as simple as SQS (or elasticMQ if you prefer to runs things locally or without AWS) works well, and is easy to setup. There seems to be too many hoops to jump through to use Redis as a reliable and durable queue - but if you have to have Redis, here's an article from the Redis team on how to achieve that:
      redis.com/glossary/redis-queue/

  • @amidfallen
    @amidfallen 2 года назад +1

    hi Fred, what about some video about dependency injection in Python? I guess it could be nicely applicable to this video - to inject different message brokers.

  • @Penfold__
    @Penfold__ 8 месяцев назад

    Any tips on using Janus queues in the context of event driven architecture with ZeroMQ would be much appreciated.

    • @mathbyteacademy
      @mathbyteacademy  7 месяцев назад

      Sorry, I don't know Janus and only worked with ZeroMQ briefly some years ago.

  • @joaopedrorocha5693
    @joaopedrorocha5693 Год назад

    Great tutorial! But what about redis-queue? It isn't an option of the same kind as RabbitMQ or the others? What do you think about it?

  • @sharadsharma9511
    @sharadsharma9511 3 месяца назад

    it was really good video. but i just wanted to know why u did'nt used celery?

    • @mathbyteacademy
      @mathbyteacademy  3 месяца назад

      I typically don't use Celery unless I actually need its more extensive (but more complicated) features. Also, I believe this is still the case, Celery is not supported on Windows, so YMMV.

  • @duke007x3
    @duke007x3 2 года назад +1

    Thank You Fred. Maybe you will add some topic about testing? pytest, mocking etc.
    Anyway thanks a lot.

    • @mathbyteacademy
      @mathbyteacademy  2 года назад +1

      Thanks! Good suggestion, and it's already on my to-do list at some point.

  • @petemoss3160
    @petemoss3160 8 месяцев назад

    fault tolerance w/Redis: a worker simultaneous RPOP 1 job from a queue & PUSH it to a 'processing set' w/Time-To-Live & workerID which another process monitors to restart expired TTL's & check/restart worker... worker deletes the job from the processing set as its last step before consuming a new job.
    there's all kinds of custom rules or workflows that can be build with Redis, i was just looking into 'priority weight' and couldn't find a way to handle it in a single AMQP queue but a Redis queue was no problem to filter for priority.

    • @mathbyteacademy
      @mathbyteacademy  8 месяцев назад

      Thanks for that!
      I assume you can make RPOP and PUSH as a single atomic transaction ?(never tried it, so curious if that is the case)

    • @petemoss3160
      @petemoss3160 8 месяцев назад

      @@mathbyteacademy shoot, can't perform atomic ops on multiple keys. In that case consuming worker must filter retrieve and flag the next noon flagged job as processing with TTL and worker id, which probably requires a script to combine as atomic... But apparently my first suggestion could use a script
      Edit: bonus of this approach is we don't need a failure manager, each worker can check the TTL on active jobs and grab oldest expired on a single stack.

    • @mathbyteacademy
      @mathbyteacademy  8 месяцев назад +1

      @petemoss3160 Good to know, I haven't really touched Redis for this in a long time because of the issue, so wasn;t sure if something had changed. I have ended up using a simpler solution with SQS (or ElasticMQ as the local equivalent) for this - although I still use Redis, but only to de-duplicate SQS messages (since they are only guaranteed at-least-once, unless their are FIFO, but more expensive).

    • @petemoss3160
      @petemoss3160 8 месяцев назад

      @@mathbyteacademy it definitely feels like unnecessary boilerplate to reinvent a process implemented better in software like you mentioned... Of which we have too many to choose from. DDS (used by ROS2) just came to mind and apparently supports ordering and prioritizing, so maybe that's what I was looking for.

    • @mathbyteacademy
      @mathbyteacademy  8 месяцев назад +1

      @petemoss3160 Lots to choose from indeed. I was not aware of ROS2/DDS, looks interesting and something I'll definitely read up more on - thanks for mentioning it!

  • @Angelas20
    @Angelas20 7 месяцев назад

    why do we need celery then? 😕😕😕😕😕😕

    • @mathbyteacademy
      @mathbyteacademy  7 месяцев назад

      Celery? You mean the vegetable that leaves a bad taste in my mouth?
      or... the software library, that also leaves a bad taste in my mouth? 😀
      Celery is OK, but not my first choice when writing a micro service type of architecture. I'd rather have complete granular control over everything. Past experiences in Celery made me look elsewhere. It's been a while so maybe things have improved, but I did run across this recent blog post that indicates they may not: docs.hatchet.run/blog/problems-with-celery

  • @StelioStefanov
    @StelioStefanov 2 года назад

    Great as always. You can try tmux 😜. Thanks for the great content, keep going🙂.

    • @mathbyteacademy
      @mathbyteacademy  2 года назад

      Thanks! Ah, tmux, I haven't used it in such a long time, I don't think I remember the shortcuts anymore 😀

  • @SemRosto-b9z
    @SemRosto-b9z Год назад

    + for RabbitMQ