# Bug 0: Day Zero

- Status: open
- Project: Zero
- Creator: @aboodman
- Assignee: @aboodman
- Labels: alpha-must
- Created: 2024-12-10T00:38:40Z
- Modified: 2025-10-25T01:08:35Z
- Reactions: 0️⃣ ×1 (tritowntim) · ❤️ ×4 (amosbastian, diopresi, felix-dolderer, rmzNadir) · 🌍️ ×2 (cbnsndwch, edenjw) · 🍎 ×5 (amosbastian, cesara, edenjw, tedspare, yurivish) · 🎆 ×14 (0xBigBoss, 0xcadams, StefanDjokovic, aisflat439, alexhking, amosbastian, cesara, denis-sokolov, hrkrshnn, lklyne, natew, szymonrybczak, taciturnaxolotl, zsilbi) · 👋 ×23 (0xBigBoss, 0xcadams, HenryVillavicencio, KATT, Moshyfawn, StefanDjokovic, aisflat439, alexanderson1993, alexhking, amosbastian, ccorcos, cephalization, cesara, efflam, focux, justinliang1020, lklyne, natew, olafurpg, szymonrybczak, third774, thirteen01, zxch3n) · 💫 ×9 (0xBigBoss, acusti, amosbastian, carlosbensant, cesara, grgbkr, hrkrshnn, natew, szymonrybczak) · 🔥 ×3 (KidkArolis, coryhouse, jasonappah) · 🙂 ×16 (0xBigBoss, 0xcadams, HenryVillavicencio, aisflat439, alexhking, amosbastian, cesara, chee, edenjw, efflam, hrkrshnn, lawrencecchen, lklyne, natew, szymonrybczak, thirteen01) · 🚀 ×21 (0xBigBoss, 0xcadams, Moshyfawn, abstractalgo, alexhking, amosbastian, carlosbensant, cesara, domesticmouse, elledienne, felix-dolderer, gijigae, hawkup, hrkrshnn, justinliang1020, klaemo, martinboksa, studnitz, szymonrybczak, vicentematus, yurivish) · 🚯 ×1 (MauruschatM) · 🤠 ×7 (0xBigBoss, amosbastian, cesara, coryhouse, edenjw, yurivish, zxch3n) · 🤯 ×70 (0xBigBoss, 0xcadams, AdditionAddict, AtriaRex, BazzaDEV, Burry, Gerbuuun, Just-Moh-it, KATT, KidkArolis, Kraci, MadeInPierre, MauruschatM, Moshyfawn, SabBits, StefanDjokovic, aboodman, acusti, aisflat439, alexanderson1993, alexhking, amosbastian, arv, britannio, carlosbensant, cephalization, cesara, coryhouse, cschmatzler, danielo515, declanlscott, dev-badace, doroui, efflam, felix-dolderer, flicken, focux, hrkrshnn, ishanAhuja, jer-k, jmroon, justinliang1020, jzahka, kaankeskin, lawrencecchen, lklyne, martinboksa, matthieudou, mblode, mehulkar, moeamaya, natew, nicolas-chaulet, obezzad, olafurpg, pauek, pfista, rgodha24, rmzNadir, saturnonearth, stevekrouse, studnitz, szymonrybczak, taciturnaxolotl, third774, thirteen01, vasyaqwe, vicentematus, zsilbi, zxch3n) · 🥳 ×8 (0xBigBoss, amosbastian, benjamintd, cesara, doroui, grgbkr, julianarchila, mayfieldiv)
- URL: https://bugs.rocicorp.dev/p/zero/issue/0

## Description

Six months ago, [we announced Zero](https://zero.rocicorp.dev/) – a new *general-purpose* sync engine for the web.

Sync Engines are the secret ingredient that make apps like [Linear](https://linear.app/), [Notion](https://www.notion.so/), and [Superhuman](https://superhuman.com/) so incredibly fast and responsive. 

But building a new sync-based web app today is extremely difficult. The sync engines in major products are typically custom-built, representing many years of engineering effort. Off-the-shelf solutions do exist, but they have difficult tradeoffs that make them hard to adopt for most software.

We're building Zero to bring the benefits of sync to the entire web.

Today Zero is [available in alpha](https://zero.rocicorp.dev/docs/introduction) and as an [open source project](https://github.com/rocicorp/mono/tree/main/packages/zero) for the first time.

## This App Is Powered by Zero

You may have noticed this is an oddly-designed blog post 😆. That's because it's not a blog post at all – it's actually a bug report in Zero's public bug tracker, *zbugs*.

We built zbugs to dogfood Zero and show what it makes possible.

It's important to note that **zbugs isn't just a demo app** - it's our actual bug tracker that we use to organize all of Zero's development. We've been relying on it for the past four months. It's a real production app, and includes features like: granular read/write permissions, partial sync, zero-downtime deployments, horizontal scalability, quick page loads, etc.

Go ahead and click around. We imported [hundreds of old bugs](/?status=all) and thousands of comments from GitHub, so there's significant data to play with. Do some searches, apply filters, or add a comment to this post.

![zbugs demo](https://d2nzlypqdo5xbb.cloudfront.net/video/issue-zero/video-02r3-optimized.mp4 "data-poster=https://d2nzlypqdo5xbb.cloudfront.net/video/issue-zero/video-02r3-poster.jpg data-width=2140 data-height=1080")

The thing to notice is that every single interaction responds instantly – literally in the same frame, zero milliseconds later. It's so fast it almost feels broken. But that's only because you've forgotten how slow and crappy most of the web is today.

You get used to this level of *instantaneous* UI quickly, and once you do, you can't use anything else.

## Why Zero?

Five years ago, we started [Replicache](https://replicache.dev/) to bring sync to more developers.

Replicache has a dedicated following and is one of the most popular sync engines on the market. People especially love that you can connect Replicache to existing, standard databases like Postgres and MySQL.

But sync engines in general are still niche. Despite their benefits, they aren't used for the vast majority of software. 

The fundamental problem is that today's off-the-shelf sync engines work by downloading data to the client ahead-of-time so that it's fast to access later. But it's usually not practical to download *all* data a user has access to – either because there isn't space on the client or because it would unreasonably slow startup.

![graph](https://d2nzlypqdo5xbb.cloudfront.net/video/issue-zero/cache-graph.png)

Current sync engines – including Replicache – do often support some simple form of "partial sync" that can coarsely limit what data is downloaded. But then only that downloaded data is actually available for use by the app.

Unfortunately, almost all apps have features like search and filters that need access to the entire dataset. So we have a problem: Sync engines dramatically improves the ux and dx of software. But we can't sync everything, and without syncing everything we can't implement common and critical features.

## Introducing Zero

Zero is a new kind of sync engine based on queries.

Instead of carefully configuring what data gets synced, you just write queries, directly from the client. Zero manages the data synced itself, so that most queries are instant.

Zero has two parts: `zero-client` is a TypeScript library you embed into your application, and `zero-cache` is a dockerized service you run in AWS or similar (we will also offer `zero-cache` as a service in the future).

![image.png](https://d2nzlypqdo5xbb.cloudfront.net/video/issue-zero/how-it-works.svg)

You get a client-side API that looks like an embedded db, but to which you can issue arbitrary *hybrid queries* that span the entire database, including the server.

Behind the scenes, we synchronize queries results continuously to a client-side persistent cache. This cache is used automatically for future queries whenever possible.

![playlist](https://d2nzlypqdo5xbb.cloudfront.net/video/issue-zero/code-example-v2.png)

In typical applications, almost all queries end up answered from main-thread memory. This makes the UI respond instantly – literally in the same frame – the vast majority of the time.

This is all enabled by [ZQL](https://zero.rocicorp.dev/docs/reading-data) - a custom streaming query engine we built that was inspired by projects like [Feldera](https://github.com/feldera/feldera) and [Noria](https://www.usenix.org/system/files/osdi18-gjengset.pdf).

You wire the results of ZQL queries directly to React (or Solid, or whatever) and the UI automatically updates as new data syncs, or when local mutations are made.

It's an incredibly fun way to work.

## Getting Started

We're building Zero to bring the benefits of sync to the entire web. This is a big project that will take years to fully deliver.

Today, we're just starting out, and Zero has some limitations:

* We currently only support Postgres
* You need to host `zero-cache` yourself in AWS, we don't have a hosted service yet
* Although server fallback for queries is implemented, there can be annoying [UI flickers](https://zero.rocicorp.dev/docs/preloading#consistency) as the server results come in
* `zero-cache` is limited to about 50GB total (but you can partition your data into many `zero-cache` instances – i.e., one for each of your own tenants)
* You will encounter the normal bugs and perf issues you'd expect from an alpha

That said, if you are adventurous, and/or building something roughly like Linear or zbugs, you can [get started right now](https://zero.rocicorp.dev/docs/introduction). 

And because Zero provides so much of the core sync functionality you'll need, it can still be very worth your time. Even working around some bugs and missing features, you'll likely move much faster building on Zero than the alternative.

We're working quickly toward a beta this summer and full production EOY. Learn more about [our roadmap](https://zero.rocicorp.dev/docs/roadmap), or [come say hi in Discord](https://discord.rocicorp.dev/) for more questions or to get involved.

## Comments (58)

### @focux — 2024-12-18T18:29:33Z

🤯

Reactions: 🤯 ×8 (FredrikZeiner, HenryVillavicencio, MadeInPierre, djm, gregkonush, pauek, pondorasti, thomasjahoda)

### @andrerocco — 2024-12-18T18:31:56Z

Zero? 🤯

Reactions: 0️⃣ ×8 (Kraci, aboodman, aisflat439, danielo515, gregkonush, grgbkr, pondorasti, zsilbi) · ❤️ ×2 (HenryVillavicencio, pondorasti) · 🙃 ×1 (HenryVillavicencio)

### @cephalization — 2024-12-18T18:32:11Z

so excited for this!!

Reactions: 🤘 ×3 (aboodman, aisflat439, avramukk)

### @alexanderson1993 — 2024-12-18T18:32:15Z

This is sweet! Looking forward to digging into it.

Reactions: ❤️ ×2 (aboodman, nikhiljay) · 😶‍🌫️ ×2 (alexanderson1993, gregkonush) · 🚀 ×5 (aboodman, alexanderson1993, avramukk, dev-badace, nikhiljay)

### @samohovets — 2024-12-18T18:37:51Z

fire!

### @dev-badace — 2024-12-18T18:48:13Z

congratulations!

### @dev-badace — 2024-12-18T18:48:27Z

woah that was instant!

Reactions: 🏎️ ×2 (grgbkr, hrkrshnn)

### @dev-badace — 2024-12-18T18:49:15Z

damn it's so fast, that it feels fake ><

Reactions: 🔥 ×2 (alexhking, maxmcd) · 🤣 ×2 (grgbkr, taciturnaxolotl)

### @AtriaRex — 2024-12-18T18:49:25Z

test

### @taciturnaxolotl — 2024-12-18T18:50:49Z

Wow thats pretty awesome!!!

Reactions: ❤️ ×2 (djm, grgbkr)

### @aboodman — 2024-12-18T18:51:41Z

> damn it's so fast, that it feels fake ><

You get used to it :). Then you can't use anything else.

Reactions: 🚀 ×3 (alexhking, dev-badace, superamit)

### @natew — 2024-12-18T19:07:54Z

congrats guys :)

Reactions: ❤️ ×3 (AdditionAddict, alexhking, superamit)

### @saturnonearth — 2024-12-18T19:11:16Z

Lets goooo

Reactions: 🔥 ×2 (alexhking, joakim-roos)

### @brianshultz — 2024-12-18T19:13:20Z

> You get used to it :). Then you can't use anything else.

I should log off immediately before all software is permanently ruined for me

Reactions: ❤️ ×2 (aboodman, joakim-roos)

### @jakst — 2024-12-18T19:18:20Z

Holy moly it's here! Congrats 🎉 I'm so excited! 😃

Reactions: ❤️ ×3 (MaxBittker, alexhking, andrictham)

### @joakim-roos — 2024-12-18T19:40:49Z

It’s finally here! I can’t wait to start building with Zero

Reactions: ❤️ ×1 (grgbkr)

### @justinliang1020 — 2024-12-18T19:43:50Z

Hello world

Reactions: 👋 ×1 (grgbkr)

### @mkromann — 2024-12-18T19:46:42Z

🤯

### @lawrencecchen — 2024-12-18T19:50:22Z

test

### @nwenzel — 2024-12-18T19:57:55Z

This is insanely fast. Like I have to double check if something isn't working because nothing is that fast. Nice work.

Reactions: 🙏 ×1 (grgbkr)

### @ImSingee — 2024-12-18T20:00:26Z

🎉

### @britannio — 2024-12-18T20:14:23Z

nice

### @andrictham — 2024-12-18T20:20:23Z

Congratulations on the launch!

(Edit: This was fast! But how does the user know if the data didn’t sync correctly or if it’s still syncing?)

Reactions: 🙏 ×1 (grgbkr)

### @aboodman — 2024-12-18T20:31:49Z

> how does the user know if the data didn’t sync correctly or if it’s still syncing

It's very fast (put two browsers side by side to try). You get used to assuming it has synced surprisingly quickly. We could put a status indicator but then it would make the app feel slow since you'd always be waiting for status to stop statusing.

If you look at the history of other software (ie gdocs, linear, etc) they iteratively make the sync UI softer and softer until it's effectively gone completely. We just started there.

I think there is a place for a "whoops you have unsaved data" dialog, which we don't currently have. But in practice it's so fast you'd basically never see it (modulo slow networks).

Reactions: 👍️ ×4 (andrictham, coryhouse, matthieudou, superamit)

### @kandros — 2024-12-18T20:32:42Z

Yay!

### @aerojeyenth — 2024-12-18T20:51:42Z

Literally waiting for this. Going to build my sass using zero

Reactions: 🔥 ×1 (grgbkr)

### @julianarchila — 2024-12-18T21:23:04Z

holy smokes

### @0xBigBoss — 2024-12-18T21:27:56Z

Amazing!

### @klaemo — 2024-12-18T21:45:41Z

Haven’t been this excited for new tech in a long time 🥳

Reactions: 🥳 ×1 (grgbkr)

### @borrowedlens — 2024-12-18T21:55:51Z

Wow

Reactions: 👏 ×1 (Kraci)

### @geoffreylitt — 2024-12-18T22:04:23Z

Congrats on launch!!

Reactions: ❤️ ×2 (alexhking, andrictham)

### @KATT — 2024-12-18T23:43:59Z

👏

Reactions: ☝️ ×1 (ImSingee) · ❤️ ×2 (alexhking, andrictham)

### @coryhouse — 2024-12-19T00:21:08Z

So amped! Looks awesome! Love that you’re dogfooding Zero.

Reactions: 🐕️ ×3 (aboodman, alexhking, samohovets)

### @cem2ran — 2024-12-19T01:45:00Z

Congrats on the release! Been waiting for this!

### @jakejscott — 2024-12-19T06:32:44Z

Looks amazing

Reactions: ❤️ ×1 (jakejscott)

### @agallio — 2024-12-19T06:35:26Z

Congrats 👏🏻

Reactions: ❤️ ×1 (alexhking)

### @mashpie — 2024-12-19T08:29:28Z

well done! "play with zero" is now #1 on my wishlist for holidays

Reactions: ❤️ ×2 (alexhking, felix-dolderer)

### @pauek — 2024-12-19T10:56:51Z

Un-freakin'-believable 🤯

Reactions: 🥰 ×1 (grgbkr)

### @kaankeskin — 2024-12-19T12:26:28Z

looks awesome

### @gregkonush — 2024-12-19T12:53:41Z

Cool

Reactions: 😎 ×1 (alexhking)

### @nekorytaylor666 — 2024-12-19T14:18:31Z

awesome

Reactions: 💥 ×1 (alexhking)

### @diopresi — 2024-12-21T08:17:44Z

nice

### @zicklag — 2024-12-21T14:57:08Z

Very cool stuff. 🚀

Reactions: 🙏 ×1 (grgbkr)

### @Trosterud — 2024-12-22T12:56:02Z

Fuck yeah!

### @jennydaman — 2024-12-22T19:36:31Z

Where can I find the source code and license for Zero?

### @ccorcos — 2024-12-22T20:55:04Z

Hello

### @aboodman — 2024-12-23T19:58:44Z

> Hello

Hi!

### @aboodman — 2024-12-23T19:59:24Z

> Where can I find the source code and license for Zero?

https://github.com/rocicorp/mono/tree/main/packages/zero

https://github.com/rocicorp/mono/tree/main/LICENSE

Reactions: 👍️ ×1 (liborvanek)

### @thijshagen — 2024-12-27T10:07:25Z

✌️

Reactions: 👋 ×2 (grgbkr, kitze)

### @kitze — 2025-01-03T12:55:26Z

the urge to rewrite every app I ever wrote with zero ...

Reactions: ❤️‍🔥 ×3 (grgbkr, kitze, tommymarshall) · 😄 ×1 (kitze) · 🫨 ×1 (kitze)

### @Abdullahi-abdiaziz — 2025-01-13T19:04:11Z

nice amazing

Reactions: 👍️ ×1 (Abdullahi-abdiaziz)

### @SabBits — 2025-01-14T13:33:17Z

this is extremely impressive!
can't wait to start using it

### @pfista — 2025-01-14T17:49:44Z

this is awesome!

### @c58 — 2025-02-02T08:17:51Z

Sounds cool and loads fast! But Isnt it the same thing we had many years ago (and still have) but in a different shell - Meteor?

### @aboodman — 2025-02-08T22:20:29Z

Very inspired by Meteor, but Zero diverges in a few key areas:

1. Meteor requires Mongo, while Zero is relational-first and designed to work with standard popular relational databases like Postgres and  MySQL.

2. Zero has built-in first-class support for [reactive relational queries](https://zero.rocicorp.dev/docs/reading-data#relationships). This kind of query is only possible in Meteor with relatively inefficient workarounds.

3. In Meteor, there's a difference between publications and queries. This creates a lot of subtle complexity:

![bonk](https://i.imgur.com/8TT4Hb4.png)
![beep](https://i.imgur.com/4WHcHmr.png)

In Zero there is no such difference. All queries are implicitly subscriptions. All queries go to local cache first.

Reactions: ❤️ ×1 (Hades32)

### @Hades32 — 2025-06-25T09:54:53Z

Zero looks soooo cool!

Two questions:
1. how does the `zero-cache` (50GB) limit manifest itself? Does this limit the number of concurrent client, or the max size of the underlying DB, or is it just the maximum amount of data that's instantly available and other data goes to the (slow) DB?
2. Can `zero-client` only work against the zero server, or can it also be used for client-side storage? It would be awesome to have the same kind of code for client-side data storage as for server queries!

### @aboodman — 2025-06-25T17:01:07Z

Thanks @hades32.

1. Where do you see a 50GB limit on zero-cache? This is out of date information. There is not a hard limit on the storage size of zero-cache but we currently recommend a soft limit of 100GB. We have users w/ hundreds of GB though. Depending on the application it is fine. This number is referring to the total amount of data replicated to zero-cache. Or in other words, the total amount of information that is available to sync to clients.

2. zero-client can be used totally offline by setting the `server=null` and `kvStore=mem`. It's not intended to be used this way for long periods (its memory use will grow over time) but it's fine for things like trial modes.

### @legitmaxwu — 2025-07-07T23:49:20Z

holy smokes

Reactions: 🔥 ×1 (aboodman)
