What is Zero?
Zero transforms how you build web applications by automatically syncing data between your PostgreSQL database and client devices in real-time. When data changes on the server, all connected clients update instantly—no polling, no manual cache invalidation, no complex state management.Key Features
Zero Millisecond Queries
99% of queries return instantly from local cache through Incremental View Maintenance (IVM)
Real-Time Sync
Automatic bidirectional sync between PostgreSQL and all connected clients
Type-Safe Queries
Build queries with a type-safe builder API with full TypeScript support
Offline-First
Built on Replicache for robust offline support and optimistic updates
How It Works
Zero follows a sync-first architecture with three key components:- PostgreSQL - Your source of truth for data
- zero-cache - Server-side sync engine that maintains a SQLite replica
- zero-client - Client-side library that syncs to IndexedDB (powered by Replicache)
Architecture
Zero consists of several packages that work together:- @rocicorp/zero - Main package with client and server exports
- zero-client - Client-side library for queries and mutations
- zero-cache - Server-side sync engine
- zero-schema - Schema definition builder
- zql - Incremental View Maintenance (IVM) query engine
- zero-react - React hooks (useQuery, useZero)
- zero-solid - Solid.js integration
- zero-react-native - React Native support
Quick Example
Here’s a complete example from our reference app, zbugs:Get Started
Installation
Install Zero and set up your first project
Quick Start
Build your first Zero application in minutes
Schema Definition
Learn how to define tables and relationships
Querying Data
Master the type-safe query builder API
Why Zero?
Traditional web applications require complex infrastructure for real-time updates: WebSocket servers, Redis pub/sub, cache invalidation logic, and careful coordination between backend and frontend state. Zero eliminates this complexity:
- No cache invalidation - Views update automatically through IVM
- No manual WebSocket handling - Sync happens transparently
- No loading states - Queries return instantly from local cache
- No optimistic update logic - Built into the framework
Performance at Scale
Zero is designed to handle millions of rows efficiently. Our Gigabugs demo syncs 2.5 million rows to the client, with queries still returning in zero milliseconds thanks to IVM.Learn More
- Official Website
- GitHub Repository
- API Reference
- llms.txt for AI assistants