Optimistic Updates
Created Jul 6, 2024 - Last updated: Jul 23, 2024
Optimistic updates
Gemini: Optimistic updates make web apps feel faster by updating the UI instantly after user actions, like liking a post. It assumes success but can fix any mismatches later. This improves user experience but requires careful planning to avoid data inconsistencies.
However, optimistic updates don’t mean you should fire and forget it.
Let’s say removing a resource inside a list with a third-party service may not be able to finish instantly. If the user closes the page and launches it again, they may find that it is not removed, which can be frustrating.
Therefore, a soft delete mechanism may be needed on the frontend side to filter out soft-deleted items (or show a removal icon).