Khi nào nên dùng Redux và khi nào không cần?

Framework decision: DÙNG Redux khi

  1. 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;
  2. 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;
  3. cần action history/audit trail — ứng dụng financial, collaborative editing cần biết ai làm gì lúc nào;
  4. team đã quen Redux với codebase lớn — migration cost cao hơn benefit. KHÔNG dùng Redux khi:
  5. chủ yếu là server state — dùng React Query thay, Redux cho server data là over-engineering;
  6. state chỉ local trong 1-2 component — useState là đủ;
  7. 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.

Xem toàn bộ State Management cùng filter theo level & chủ đề con.

Mở danh sách State Management