TanStack DB is a reactive client store built on differential dataflow that extends TanStack Query with collections, live queries, and optimistic mutations. It normalizes data into typed collections, enables sub-millisecond cross-collection queries, and provides instant optimistic updates with automatic rollback on failure.
When to use: Reactive UIs needing local-first data, cross-collection joins with live updates, optimistic mutations with automatic sync, real-time sync via ElectricSQL or other backends, apps that outgrow TanStack Query's per-query caching model.
When NOT to use: Simple fetch-and-display (TanStack Query alone suffices), server-components-only apps, purely synchronous local state (useState/Zustand), GraphQL with normalized caching (Apollo/urql).
TanStack DB database reattivo lato client con query in tempo reale e mutazioni ottimistiche. Da utilizzare quando si creano interfacce utente reattive con dati local-first, motori di sincronizzazione o aggiornamenti ottimistici. Utilizzare per tanstack-db, query live, mutazioni ottimistiche, motore di sincronizzazione, database reattivo, local-first. Fonte: oakoss/agent-skills.