Optimistic updates make the UI feel instant by updating before server confirmation.
Pessimistic (slow feel):
User clicks like
Wait for server response
Update UI
Optimistic (fast feel):
User clicks like
Update UI immediately
Send request to server
Rollback if fails
When to use:
- Actions that usually succeed
- Where instant feedback matters
- When rollback is acceptable
Complexity: You need to handle failures gracefully. Show error and revert to previous state.