Normalization & Optimistic Updates (Concepts)
Normalize server data locally (ids + entities) and apply optimistic updates with a safe rollback when the server rejects changes.
Why normalize & optimistic?
Goal: Keep cached data tidy and interactions snappy.
- Normalize lists into ids + entities
- Selectors to read views
- Optimistic UI with rollback on error
Core principles
- Store each record once (entities map)
- Lists keep only ids
- Derive views (join ids → entities)
- For optimistic: snapshot → local change → send → rollback on fail
All lessons in this course
- Distinguishing Server Data and Local UI State
- Normalization & Optimistic Updates (Concepts)
- Sync Patterns Without Heavy Libs