• tyler@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    6 days ago

    I haven’t read the whole series, but will try to, but until I do I feel like I’m missing something. Why bother with locking at all in this case? Can’t you just check that the record hasn’t been changed and then tell the user if it has, or force a reload? What do you gain with the lock file here? I’m imagining just checking that the card record has the same timestamp you saw when you loaded the data the first time, or that a hash hasn’t changed, etc.

    • Neighbourhoodie Software@toot.berlinOP
      link
      fedilink
      arrow-up
      0
      ·
      4 days ago

      @tyler great question! This tutorial is less “here’s what we’re building in three steps” and more “here are three ways to achieve a goal, let’s explore trade-offs of each.”

      In the series, locking is the last thing we explore to prevent conflicts and ensure no one’s data is overwritten. Not all conflicts are equal. Locking solves for some cases automatic resolution can’t catch, but also introduces complexity and adds limitations to the offline capabilities of CouchDB.