Live data from Hacker News

Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

github.com

11–20 of 44 posts

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#11
post #9

In which way this is different from PowerSync?

Both use local SQLite and keep the backend authoritative. The main difference is that PowerSync mostly handles downstream replication and gives you an upload queue; your API still owns the write semantics. Syncular specifies the whole round trip. Durable commits, auth scopes, conflicts, replay, revocation and bootstrap. Syncular also goes further up the stack: schemas plus SQL/SYQL generate typed queries for TS, Swift, Kotlin, Dart and Rust, and blobs, CRDT/encrypted columns and windowed sync are built into the protocol.

In my separate benchmark harness, Syncular currently does considerably better than the tested PowerSync setup. For example, 100k bootstrap is ~0.57s vs ~6.5s and offline replay ~35ms vs ~5.1s. Those are early results from one environment, though, not a universal claim (https://github.com/bkniffler/offline-sync-bench).

I've used PowerSync in the past with a huge initial bootstrap sync and was very frustrated by the performance back then (ca 1 year ago), which was one of the reasons to create my own library.

PowerSync is much more mature today obviously and still a great and proven tool.

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#13
post #8
post #6

Earlier quoted context omitted.

Nice! Would recommend to decouple as much as possible and have tons of testing, every issue thats catched before having to go to the length of debugging client side issues is gonna save some sleep. Have been there, learned the hard way.. Whats your app?

Yeah it was a deceptively complicated issue. I’m not sure if my implementation is as comprehensive, but it sounds similar: optimistic local writes, outbound queue, server as source of truth, each client has local SQLite. The issue I found most difficult architecturally was how to deal with staying responsive on first sign in with a large DB. I ended up with a system I called “materialisation on demand” where it will…

[dead]

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#15
post #2

Hi HN! I’ve been circling this problem for a long time. In 2019 I built an offline-first datastore called debe. It used CRDTs and multi-master replication and never became something I could confidently ship. It did teach me that convergence is only a small part of sync. The difficult parts are durable writes, authorization changes, lost acknowledgements, schema upgrades, bounded bootstrap, and explaining what happene…

There was a local-first conv just a few weeks ago in Berlin; if you're not yet part of that community I suggest reaching out. https://www.localfirst.fm/ for example, or https://lofi.so/

Thanks for pointing me there! Posted to their discord, but seems not so active.

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#16
I wish there was an established way to build local first software with a robust syncing in the background, either P2P or to a server.

I feel projects like this for local first and projects like Iroh for connectivity over NAT and through firewalls need to come together more.

It would be could to have a drop in framework for this.

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#18

I wish there was an established way to build local first software with a robust syncing in the background, either P2P or to a server. I feel projects like this for local first and projects like Iroh for connectivity over NAT and through firewalls need to come together more. It would be could to have a drop in framework for this.

Loro along with their protocol crate works great. Automerge has something similar.

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#19
Looks interesting, was looking for something like this as currently for Flutter I use Loro via flutter_rust_bridge as the CRDT data store, but it's not SQL so some things like big queries are annoying. How are you handling CRDTs in a SQL database? I thought those were notoriously hard as relational wasn't built for CRDT style syncing?

Re: Show HN: Syncular – offline-first SQL sync with TypeScript and Rust cores

#20
post #4
post #3

This is cool. Reminds of Lotus Notes. In a strange way a concept that felt "outdated" is something that I would love to be the default behavior for many apps today.

It’s great to see apps being shipped with offline first (and flawless syncing as an optional feature) from ground up, sad to see many modern notes apps like notion or capacities treating offline as afterthought. But alas, it’s still a non trivial nut to crack. Hope one day offline first will be a default and a solved problem.

Agreed. Also, pretty confident this is one of the reasons Obsidian is able to compete (and win) against Notion despite the huge difference in capitalization.
Post reply on HN