Concurrent Writes on a DWN

Applications often have multiple users updating the same logical data simultaneously. A hotel reservation system is an example of this: a room cannot be double booked, or accept both reservations when two people attempt to reserve the same room at the same time. It is clear that in the example above, last-writer-wins strategy will lead to undesirable behavior.

I am wondering what the community thinks and expects of DWN’s support for concurrent updates. To start simple, let’s scope the problem down to within one DWN node.

A good background read on approaches.

So some practical choices:

  1. No concurrency support - actors that have permission to write to a DWN will coordinate and manage concurrent writes externally. While this does not sound great, mature data store services like Amazon S3 does not provide support for handling concurrent writes either as far as I can find, which means last write wins.

  2. Implement optimistic concurrency strategy - like Azure Blob Storage.

  3. Implement pessimistic concurrency strategy in addition to or instead of optimistic concurrency strategy. This approach feels quite heavy-handed for dealing with concurrent writes. I’d imagine it would be less used among developers thus probably warrants a lower priority.

  4. Others?

From my experience I have always regretted #3 when I have picked it. I think the s3-alike approach seems pretty sound if for no other reason that it seems to work!