Developing web applications has gotten insanely complex.
You need a tall pile of tech to build a "modern" web app: client-side code, server-side code, APIs to tie them together, data fetching, state management, hydration, websockets for reactivity, and a whole lot more. And once you're done, the resulting app still isn't very good.
It's time for a rethink.
We're building a general-purpose sync engine for the web. You put Zero in front of your database or web service, and we distribute your backend all the way to main thread of the UI.
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.
function Playlist({id}: {id: string}) {
// This usually resolves *instantly*, and updates reactively
// as server data changes. Just wire it directly to your UI –
// no HTTP APIs, no state management no realtime goop.
const tracks = useQuery(
zero.query.playlist
.related('tracks', track => track
.related('album')
.related('artist')
.orderBy('playcount', 'asc')
.where('id', id)
);
const onStar = (id: string, starred: boolean) => {
zero.track.update({
id,
starred,
});
}
return (
<div>
{tracks.map(track => (
<TrackRow track={track} onStar={onStar}/>
))}
</div>
);
}
This architecture provides:
- Instant (zero milliseconds) response for almost all user interactions – the user taps a button and the UI instantly updates, in the next frame.
- Automatic reactivity – a user changes something and all other users see the change live.
- Dramatically faster development velocity – almost all features can be built completely client-side, with no need for new server-side APIs to be built and deployed.
- Scalability – Zero can work with any amount of backend data. It doesn't require syncing all data to the client up-front, or knowing which data you'll need ahead of time. If the app needs data which hasn't already been synced, it is synced on demand.
Where Zero really shines is complex, highly-interactive “local-first” style applications like Linear and Superhuman. With Zero, these apps can be built in a fraction of the time it would take to build even an old-fashioned server-rendered web app.
Zero is currently in public alpha. It's got a few rough edges, and you have to deploy it yourself, but it's already remarkably fun. We're using it ourselves for Zero's official bug tracker and we find it much more productive than the alternatives.
Ready to start? You can have your first app in production on AWS in about 20 minutes.