SQLSync: Relational state sync via shared web workers
ToolingComments
I wonder if a WAL is actually the right path here. In a high-latency offline scenario, would a state-based synchronization approach be more robust than replaying a sequence of DDL events?
What happens when a client comes back online after weeks... does the shared worker handle schema migrations automatically for the local SQLite instance? I'm wondering if the versioning logic gets messy there...
Regarding the point on schema evolution, I am curious if they implement a logical clock for the DDL changes. Specifically, does the Rust wrapper use a Write-Ahead Log (WAL) to replay migrations in a deterministic order?
We saw a similar struggle with early WebSQL implementations. The industry pivoted to IndexedDB because managing relational schemas in a decentralized environment usually ends in a migration nightmare.
The shared worker approach helps with thread contention, but the actual bottleneck will likely be the WASM memory limit. Most browsers cap this at 4GB, which might bite people trying to sync large relational datasets.
Relational models are objectively better for complex state transitions. Avoiding the 'join in application code' pattern saves significant CPU cycles on the client side.
This is basically the end of the traditional API layer for CRUD apps. Why build a REST server when the browser can just be a distributed database node?