Live data from Hacker News

Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

electric-sql.com

51–60 of 173 posts

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#51
Neat, this is the pattern I've been thinking about for a while now. Also glad to see this is Elixir based and that Jose is involved.

I've been using https://github.com/cpursley/walex (basically a fork of cainophile via a fork for subabase) to listen to Postgres changes in Elixir.

Sequin is also doing some neat stuff in this space as well: https://blog.sequin.io/all-the-ways-to-capture-changes-in-po...

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#52

How does this scale? For example, can you shard user DB's across multiple PGSQL clusters?

We cover this a bit in the architecture page: https://electric-sql.com/docs/reference/architecture

Basically Electric is horizontally scalable. You can run multiple Electric sync services on top of Postgres and then obviously many clients connecting to the Electric. We're focused on running on top of a single Postgres right now (which we take query load off).

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#54

Wow, this is exactly what I've been searching for! I knew this was possible but am too busy trying to build web apps to spend time learning how to do stuff like this. I notice this is still a 0.X version. How comfortable are you with people using this in production? Are there any success stories so far? And if it's not production ready, is there a roadmap I can check out? The company I work for is in the process of p…

> I so very much want to use this or something like this.

Since you mentioned this — you could also take a look at PowerSync which is similar (disclosure: co-founder) https://docs.powersync.co/ - Currently beta suitable for production use.

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#55
post #54

Wow, this is exactly what I've been searching for! I knew this was possible but am too busy trying to build web apps to spend time learning how to do stuff like this. I notice this is still a 0.X version. How comfortable are you with people using this in production? Are there any success stories so far? And if it's not production ready, is there a roadmap I can check out? The company I work for is in the process of p…

> I so very much want to use this or something like this. Since you mentioned this — you could also take a look at PowerSync which is similar (disclosure: co-founder) https://docs.powersync.co/ - Currently beta suitable for production use.

Yes, saw your other comment! ;) I will definitely be checking this out as well. I am so glad folks are finally creating real solutions in this space.

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#56
Wow, this is awesome! I've been "waiting" for a project like this for years - having to roll out my own syncing solution for my local-first app until now.

I have yet to dive deeper in the docs and examples, but does anyone know how easy it would be with Electric to provide some kind of client-side transformations (encryption/decryption) of specific fields or entire rows in your SQLite db before syncing? A major reason to go local-first, is often privacy, and the idea that the user owns their data...

Also, it's unfortunate permissions haven't been implemented yet; https://electric-sql.com/docs/usage/data-modelling/permissio... If I understand correctly, that means in a multi-user system, everyone will sync everyone else's data?

And too bad my favorite stack (Angular + Nest.js backend) isn't supported, but I guess it should still be straightforward to integrate the client-side and run the sync service in the backend. I might try it if I have a weekend...

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#57
I am fully on the offline-first bandwagon after starting to use cr-sqlite (https://vlcn.io), which works similar to ElectricSQL.

I thought the bundle size of wasm-sqlite would be prohibitive, but it's surprisingly quick to download and boot. Reducing network reliance solves so many problems and corner-cases in my web app. Having access to local data makes everything very snappy too - the user experience is much better. Even if the user's offline data is wiped by the browser (offline storage limits are a bit of a minefield), it is straightforward to get all synced changes back from the server.

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#58
I get dizzy even trying to envision all the edge cases and challenges making an active - active sync between two different database engines, over what would be tens of thousands (hundres?) of simultaneous connection to clients via a non-reliable, expect network disconnect, and reconnect from a different location from the same client.

If you have managed to pull this off in a way that reliably scales and reliably keeps all the data updated and uncorrupted I am mighty impressed. My hat off for you folks.

How do you handle transactions and rollbacks?

Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps

#59
post #49

Wow, this is exactly what I've been searching for! I knew this was possible but am too busy trying to build web apps to spend time learning how to do stuff like this. I notice this is still a 0.X version. How comfortable are you with people using this in production? Are there any success stories so far? And if it's not production ready, is there a roadmap I can check out? The company I work for is in the process of p…

Hey, very cool :) We don't recommend production use right now. There's a roadmap page here https://electric-sql.com/docs/reference/roadmap -- we particularly need to flesh out shapes, permissions and validation. Happy to chat (e.g. on our Discord) if you'd like a bit more detail / looking at whether Electric could fit into your tech pans.

Thanks for the roadmap, I should have just looked around the site a bit more, I would have found it.

And, I may take you up on a chat after I've had a conversation with my team! At the very least, I've joined the Discord and I'll definitely be following you guys closely.

Post reply on HN