Design Patterns · Senior · Question 24 of 75
Why is separating "server" and "client" state considered an important architectural decision?
- ✓Correct answer: They have different jobs: caching and syncing versus UI
- 2Server state can't be kept in browser memory
- 3Client state must always be stored in cookies
Explanation
Server data is a copy that goes stale: it needs caching, invalidation, retries and deduplication (TanStack Query, RTK Query, RSC). UI state (whether a dialog is open, a form draft) belongs to the client. Mixing them in one store leads to manual syncing and bugs.