Distributed Lock using Zookeeper

Sdílet
Vložit
  • čas přidán 7. 08. 2024
  • This is a video about Distributed lock using zookeeper. It covers how with the help of zookeeper data modelling techniques, one can build distributed locks. All you need is to create ephemeral sequential nodes and then add watcher on the nodes. The sequential node with the smallest sequence number will be given the lock. Other nodes will wait for the changes and try to acquire lock ones it gets free.
    Here is the github code in java and maven: github.com/anshriva/zookeeper.... This video is part of the playlist: • apache zookeeper
    Chapters:
    00:00 Introduction
    01:10 Problem statement
    02:22 solution approach
    08:50 Code
    12:42 Demo
    13:48 Conclusion
  • Věda a technologie

Komentáře • 17

  • @hesona9759
    @hesona9759 Před 10 dny

    The best tutorial of Zookeeper I've ever watched, thank you!

  • @matmccann
    @matmccann Před rokem +1

    Well done! You explain the system in plain, simple, and organized terms. I watched the video once and understood very clearly. Thank you!!!!!

  • @shubham91219
    @shubham91219 Před rokem

    Thanks Anubhav! The whole playlist is amazing! Very helpful.

  • @amansinha2170
    @amansinha2170 Před rokem

    Amazing Video! Awesome work ❤

  • @drakezen
    @drakezen Před rokem

    Great videos!

  • @mr_world_wide
    @mr_world_wide Před 11 měsíci

    thank you for the video, would love if you could go into how this would work in a distributed zookeeper cluster.

    • @anubhav_shrivastava
      @anubhav_shrivastava  Před 11 měsíci

      The cluster flow will be same as this one.
      you can get your self started with cluster setup here :
      Apache Zookeeper cluster setup on local | Zookeeper multi node ensemble
      czcams.com/video/9DXb_nIk99U/video.html and then run the same commands as above.

    • @mr_world_wide
      @mr_world_wide Před 11 měsíci

      Thanks for the response, I guess zookeeper internally runs some version of raft

  • @deepakbevinamara
    @deepakbevinamara Před 5 měsíci

    These are great videos! Thank you so much for putting in the effort to make them.
    In the video "Distributed Lock using Zookeeper", the code example you walked through can potentially lead to a scenario where the client can end up waiting infinitely for the notification while watching on the znode.
    Any idea/pointers on how to avoid getting into this situation?

    • @anubhav_shrivastava
      @anubhav_shrivastava  Před 5 měsíci +1

      That's correct. To check the actual production implementation, check out apache curator which is a library to use zookeeper.

  • @crazeeealgorithms3236
    @crazeeealgorithms3236 Před 4 měsíci

    Thanks for the videos, but one question, what if there are multiple instances of Zookeeper server running (for High Availability), then how does each individual instance know which sequence number to put while creating a node.

    • @anubhav_shrivastava
      @anubhav_shrivastava  Před 4 měsíci

      Let me think on this and get back. Meanwhile, for the real implementation, i suggest checking out apache curator czcams.com/video/clr4I6ygqIY/video.html

  • @DRBB123
    @DRBB123 Před měsícem

    Do I need to start zookeeper in local ?
    You did not mention how to start that but used localhost.

    • @anubhav_shrivastava
      @anubhav_shrivastava  Před měsícem

      please check my playlist, there is a video on how to run zookeeper on local