See the first part of How are timestamps and ordered timelines of events achieved on Holochain? for background.
I’d be interested on further comments regarding what CALM means for other hApp scenarios. The paper is a bit dense so I wanted to see if I was translating it properly. For instance I find the following two application type of examples in the paper:
The Amazon Dynamo has a shopping cart where items can be added and deleted as this data is synced. This eventual consistency of the state isn’t a problem until you go to do a checkout operation. Here the checkout needs to include a manifest of all the update IDs from the client that preceded it’s checkout. A shipping agent can then know to wait to receive all these updates before processing the checkout.
Another non-obvious use of CALM analysis is to identify when to compensate (“apologize” ) for inconsistency, rather than prevent it via coordination. For example, when a retail site allows you to purchase an item, it should decrement the count of items in inventory. This non-monotonic action suggests that coordination is required, e.g., to ensure that the supply is not depleted before an item is allocated to you. In practice, this requires too much integration between systems for inventory, supply chain, and shopping. In the absence of such coordination, your purchase may fail non-deterministically after checkout. To account for this possibility, additional compensation code must be written to detect the out-of-stock exception, and handle it by—for example—sending you an apologetic email with a loyalty coupon. Note that a coupon is not a clear mathematical inverse of any action in the original program; domain-aware compensation often goes beyond typical type system logic.
If I understand it right, I believe I have heard the “apologize” approach used as an example in Holochain where you have a low probability event and can safely deal with it after the fact if it happens. I think this applies for things like selection of a unique user handle or reversing a transaction found to be fraudulent. I’ve also heard of setting up verification functions to wait for all the information to be available before running which seems a version of the first case.
Please chime in or correct my examples of how to Keep CALM and be hApp’y (Maybe that needs to be a T-shirt )