What problem does it solve?
TanStack DB provides a client-first reactive data layer that eliminates manual cache management and brittle ad-hoc synchronization between UI state and API data, enabling instant UI updates and consistent normalized collections even at high scale.
Core Features & Use Cases
- Normalized Collections: Define module-level collections that wrap remote data sources to maintain a single source of truth for related UI views.
- Live Queries & Joins: Subscribe to incremental, SQL-like live queries that update sub-millisecond as underlying data changes, including cross-collection joins and ordering.
- Optimistic Mutations & Sync Modes: Perform optimistic inserts/updates/deletes with automatic rollback and configurable sync modes (eager, on-demand, progressive) for small and very large datasets.
- Real-world Example: Use an on-demand product collection to power search results and pagination while using optimistic mutations for quick cart operations that roll back on failure.
Quick Start
Create a TanStack DB collection that syncs todos from the API and show a live query of incomplete todos.