Optimistic Locking clearly explained | Java | SQL | System Design

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ส.ค. 2024

ความคิดเห็น • 7

  • @harinimurali1180
    @harinimurali1180 3 วันที่ผ่านมา +1

    What is the difference between version and etag? Are they both optimistic locking?

    • @ByteMonk
      @ByteMonk  วันที่ผ่านมา

      Versioning is a method used in optimistic locking, where each entity or document in a system is assigned a version number. Each time the entity is updated, the version number increments (e.g., 1, 2, 3). It is Often used in databases or document stores (like Elasticsearch or DynamoDB). An ETag is a unique identifier (often a hash) that represents the state of a resource. It is mostly used in web applications, APIs, and caching mechanisms where resources are fetched and updated via HTTP. It’s more flexible in scenarios where content-based change detection is required rather than strict version control.

    • @ByteMonk
      @ByteMonk  วันที่ผ่านมา

      both methods serve as optimistic locking mechanisms but are applied differently based on the specific requirements and nature of the data

  • @Zmey5656
    @Zmey5656 2 หลายเดือนก่อน

    I don't understand why this is better than isolation.

    • @ByteMonk
      @ByteMonk  2 หลายเดือนก่อน +1

      Optimistic locking is to manage concurrent updates to the same data, typically in application-level code (not directly at the database level). Where as Isolation is to control how concurrent transactions interact with each other within a database. They are not mutually exclusive, you can often use them together.

    • @Zmey5656
      @Zmey5656 2 หลายเดือนก่อน +1

      @@ByteMonk thank you

  • @Dr_Larken
    @Dr_Larken 2 หลายเดือนก่อน

    My favorite religion from my favorite Monk the doesn’t bite!
    “He has’th no system, has’th no faith. He has’th optimism shall design and one shall design with his flock and bring forth in to this world “& to the digital world” a system. And the the Shire Monk of shred amongst he flock the knowledge of computational possibilities spreading the good word of system design “bits & bytes along with ones might, must hath thy system for design and he may ponder a bit too much tho ponder not the monk sayith to his disciples. Follow my word, letting your faith guild you on this journey ‘ideally in 1080p+’ as thy keys shall present to view or that is normally seen with faith & use’ith first, as thy keys hath been within reach as you sit in front of the window gazing upon it, Thou keys hath lie elbowed length all along. Now go my innocent child, as systems need’th so to you shall bless them in your design of thy systems!”
    ~From the Holiest of Holy book chapter 16 To Byte or Not to Bite: Chapter 6, line 3
    Amen