Re:Offline Is Just Online with Extreme Latency
by smac__ on Wednesday April 19, 2023 @08:10AM
(#35627148)
In this case the optimistic UI might be good to have a step like “this request is pending”. So when the form is submitted the data is ready to send and will send when it can. Ideally with an indicator that the user is offline and needs to be online to sync.
Re:Offline Is Just Online with Extreme Latency
by BrentOzar on Wednesday April 19, 2023 @08:02AM
(#35627089)
> You cannot tell the customer "you might have (or might not have) bought the house, we will only know later".
Sure you can - in fact, that's what realtors call offers. You place an offer, and you only find out later if you bought the house, often days later.
Re:Offline Is Just Online with Extreme Latency
by couchand on Wednesday April 19, 2023 @09:32AM
(#35627928)
Technically correct, but you're missing the point.
Eventually you do need to be able to commit some sort of transaction and get confirmation from the counterparty.
Re:Offline Is Just Online with Extreme Latency
by ElevenLathe on Wednesday April 19, 2023 @10:23AM
(#35628559)
This is correct but you can do tricks to change who the counterparty is, which is often useful. If, instead of putting up a yard sign and saying "this house is for sale" and waiting for someone to come by and complete the transaction, the homeowners entered a contract with a brokerage to sell the house to anyone who is willing to abide by a list of terms (minimum price, occupancy date, etc.), then the brokerage can respond immediately and say "great, the house is yours". This is essentially the equivalent of sending a sell order to a stock broker.
Re:Offline Is Just Online with Extreme Latency
by thruflo on Wednesday April 19, 2023 @09:44AM
(#35628041)
You can if you acquire a distributed lock in advance, as per https://electric-sql.com/blog/2022/05/03/introducing-rich-cr...
Re:Offline Is Just Online with Extreme Latency
by chefandy on Wednesday April 19, 2023 @09:47AM
(#35628077)
That's true even if you're example isn't perfect. Some types of transactions have business requirements that demand immediate consistency or responses. Contraindications certainly don't invalidate ideas, though. Use the right to for the job.
E.g. if the user is a realtor, then she can't tell the customer "you have now bought the house" if there is no online connection and you're waiting for a sync. You can fill out and upload the form async, but commitment must be online.
You cannot tell the customer "you might have (or might not have) bought the house, we will only know later".