TanStack DB
lastmod 2025-06-04created 2025-05-162 edits
A blazing-fast reactive client store for sync
Features
- A client store that extends TanStack Query with collections, live queries, optimistic mutations, and more, delivering a reactive and highly consistent UI
- A blazing-fast query engine and fine-grained reactivity minimize component re-rendering, enabling sub-millisecond real-time query processing even in complex apps
- Supports transactional optimistic state updates and can be adopted incrementally regardless of backend (compatible with many approaches: sync engines, REST, GraphQL, polling, custom sources, etc.)
- Runs on top of TanStack Store and works together with TanStack Query
- Difference from TanStack Query: Query fetches data, DB manages the fetched data reactively
- Built on ElectricSQL's TypeScript implementation of differential dataflow
- A collection is a typed set of objects that mirrors a backend table or represents a filtered view. It can be defined or loaded at any time as a JavaScript structure
- Not an ORM. All queries run against client collections
See also
- TanStack Query
- LiveStore - A state management solution using reactive SQLite and a built-in sync engine