Video wird geladen...
Video konnte nicht geladen werden
Quick demo of Zero’s new background queries. Zero’s sync is query-based. Rather than specifying what data you want using rules or some other separate system, you just use queries. Right inside the client app, you do a query using a full sql-style language. You get filters, subqueries , limits,... show more
18,808 Aufrufe • vor 1 Jahr •via X (Twitter)
11 Kommentare

Dope tech, dope video demo, dope music choice! 🔥

„background queries“ SPAs like they always should have been 🎉

is a cloud version coming soon?

Yep

Looks like GraphQL bundled with backend code to access db. Won't it have same problems as GraphQL?

It’s not very much like graphql at all. GraphQL is about abstracting query description from implementation: you describe queries in an abstract syntax and impl can vary. Zero is like the opposite: query language and inpl are coupled (zero provides the only impl). Also Zero is streaming socket based and incremental vs GraphQL which is request/response. So no, it has entirely different problems 😆(and some benefits too). Is there a specific GraphQL problem you’re worried about?

the only thing I do not understand about zero is whether it is possible to integrate it with an existing backend (already having REST services) or if you have to migrate to a specific architecture

so wait, using zero i would just not need a backend api?

Not in the normal sense. You still have the option* to put code on server for auth, custom validation, etc., but the basic read/write model is you specify queries on the client directly against the backend db and they sync continuously. It feels like having direct access to program against backend db from client.

What are the perf implications? Would it be unwise to set a ttl in days? And what happens if I hit the back button without this ttl?

The expectation is to set ttls of days or even years. Our dogfood app zbugs uses ttl “forever” for some base queries that we expect the user to always need, and ttl “1d” for other queries. We also use ttl “none” for some queries that don’t need to be maintained. This is possible because Zero uses a custom built incremental query engine. “ZQL” can maintain queries far more efficiently than simply re-running them over and over. Like any query it’s definitely possible to write slow zql queries - not least because it’s in alpha. But the intent is to keep these queries running for long periods and we’ve designed the whole system to make this possible.

