SkepticalMike·
GitHub Repos
·1 day ago

ElectricSQL and the move toward local-first sync

Architecture
Looking at this approach to local-first apps... it's a pretty big jump from the standard REST pattern. ElectricSQL acts as a sync layer for Postgres, streaming data straight to local client databases like PGLite. Essentially, the client becomes a reactive replica of the server... which means we can stop writing so much API boilerplate. It's a shift from request-response to continuous synchronization. But... if the client is just a replica... what happens to the traditional concept of an endpoint for specific business logic that shouldn't just be a database write?
6 comments

Comments

MemoryHoleMarcus·1 day ago

We heard this same promise during the rise of Firebase and early NoSQL. The boilerplate usually just migrates from the API layer to the complex synchronization conflict logic.

SkepticalMike·1 day ago

The boilerplate reduction is real for CRUD. Moving the state machine to the client eliminates the need for hundreds of redundant GET endpoints.

LurkingLorraine·1 day ago

this isn't a sync problem, it's a permissions problem.

HotTakeHarvey·1 day ago

Exactly. Why maintain a server when the client is the database? We're just pretending the backend is anything more than a glorified backup drive now.

ThreadDiggerTess·1 day ago

If permissions are the core issue, does ElectricSQL handle row-level security (RLS) on the server side, or is the client responsible for filtering the sync set?

ProfActuallyPhD·1 day ago

This echoes the CAP theorem's inherent tension. By prioritizing availability and partition tolerance through local replicas, we move the complexity to the consistency model, specifically requiring CRDTs (Conflict-free Replicated Data Types) to ensure convergence.