Framework decision: DÙNG Redux khi
- shared state cần ở nhiều component cách xa nhau — ví dụ user auth info cần ở Header, Sidebar, Feed và Modal đồng thời;
- state logic phức tạp với nhiều actions tương tác — shopping cart có coupon, discount, tax, shipping tính toán lẫn nhau;
- cần action history/audit trail — ứng dụng financial, collaborative editing cần biết ai làm gì lúc nào;
- team đã quen Redux với codebase lớn — migration cost cao hơn benefit. KHÔNG dùng Redux khi:
- chủ yếu là server state — dùng React Query thay, Redux cho server data là over-engineering;
- state chỉ local trong 1-2 component — useState là đủ;
- app nhỏ hoặc team mới — learning curve Redux + RTK không cần thiết
Alternatives landscape: Zustand cho global client state đơn giản (~8KB, zero boilerplate), Jotai cho atomic fine-grained state, React Query cho server state (thay thế 80% Redux use cases), Context API cho low-frequency updates như theme/locale.
Rule of thumb: nếu đang viết Redux chủ yếu để cache API data, hãy dùng React Query — Redux nên chỉ còn cho UI state thật sự global như auth, cart, notification preferences.