TANSTACK Profile picture
Nov 12 10 tweets 2 min read Read on X
🚀 TanStack DB 0.5 is here with Query-Driven Sync

Your component's query IS the API call. No custom endpoints. No GraphQL resolvers. Just write your query and DB figures out exactly what to fetch.

Details 🧵👇 Image
React made components pure functions: UI = f(state)

TanStack DB brings the same philosophy to data: view = query(collections)

You describe what data you need. DB handles fetching, caching, and updating—even across massive datasets.
This query:

useLiveQuery(q =>
q.from({ todos })
.where(eq(status, 'active'))
)

Automatically becomes:

GET /api/todos?status=active

No backend changes needed. Your queries become the API.
0.5 adds 3 sync modes for different use cases:

- Eager: Load everything upfront (<10k rows)
- On-demand: Load only what queries need (>50k rows, search)
- Progressive: Load subset now, sync full dataset in background (collaborative apps)
Differential dataflow recomputes only what changed.

Mark a todo complete? Query results update in <1ms—even with 100k+ rows in memory.

No jitter. No loading states. Just instant updates.
Multiple components, same query? ONE network request.

Complex joins? Minimal batched requests.

Already-loaded rows? Reused automatically.

Fewer total requests than custom APIs, with better cache utilization.
First query: ~100ms with targeted network request
Meanwhile: Full dataset syncs in background After sync: ALL queries run in <1ms client-side

Fast first paint + instant everything else.
Designed for your existing REST, GraphQL, or tRPC APIs. No backend migration.

Bonus: Works with sync engines (@ElectricSQL , @trailbase_io , @powersync_) for real-time updates with near-zero incremental network cost.
@ElectricSQL @trailbase_io @powersync_ We're targeting 1.0 for December 2025.

npm install @tanstack/react-db@0.5.0

Try it and share feedback in Discord or GitHub!
@ElectricSQL @trailbase_io @powersync_ Blog post tanstack.com/blog/tanstack-…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with TANSTACK

TANSTACK Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(