/plushcap/analysis/hasura/optimistic-ui-and-clobbering

Optimistic UI and Clobbering

What's this blog post about?

Optimistic UI is a front-end development paradigm where after making a mutation request to an API, the client updates the UI optimistically assuming that the request will be successful. This approach can make the UI seem faster even with network bottlenecks. However, it may lead to clobbering, where a source of data is overwritten due to side effects. To avoid this problem, each mutation should be associated with a unique comparable identifier such as a timestamp or a number. This allows checking for stale data before updating the UI and ensures that the UI goes through the correct states when handling multiple mutations in quick succession.

Company
Hasura

Date published
July 31, 2019

Author(s)
Rishichandra Wawhal

Word count
1014

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.