Can you talk about the dataset sizes you support? Your example linear app has 112 rows, could you support 1000? 10K? 100k? 1M?
Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
61–70 of 173 posts
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#62Can you talk about the dataset sizes you support? Your example linear app has 112 rows, could you support 1000? 10K? 100k? 1M?
OP here, I work for Electric, Electric is designed to support partial sync, and so you don’t have to sync your whole dataset. (Note that this is feature is under development and not yet public) There are limitations on how much data a browser will store for an individual site, so the number of rows you can sync will depend on the shape of your dataset. Finally there are also some performance considerations with WASM…
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#63I want to be able to have a Postgres database as the central source of truth for all data and user accounts, but then have each users private content to be siloed and synced to their own SQLite database which they alone have access to (maybe even they’re have one SQLite file on server and one SQLite file on phone or etc.). Is this possible with electricSQL? I remember looking at it a year ago or so and was excited bu…
This is also the pattern targeted by PowerSync (disclosure: co-founder) — selectively syncing scoped data for the user from Postgres to their own client SQLite database. Sync Rules are used to define which data is synced to which users: https://docs.powersync.co/usage/sync-rules
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#64I want to be able to have a Postgres database as the central source of truth for all data and user accounts, but then have each users private content to be siloed and synced to their own SQLite database which they alone have access to (maybe even they’re have one SQLite file on server and one SQLite file on phone or etc.). Is this possible with electricSQL? I remember looking at it a year ago or so and was excited bu…
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#65Out of curiosity - the demo on the site suggests the local first latency is like 10-40 ms. I would think reading/writing to SQLite locally would be on the order of 1ms or less. Why is that?
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#66Any specific reason it wouldn't work with Angular as well (noticed it was not listed in the Frontend frameworks section)?
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#67Congrats on the launch, looks like a great product. Out of curiosity - the demo on the site suggests the local first latency is like 10-40 ms. I would think reading/writing to SQLite locally would be on the order of 1ms or less. Why is that?
Quite right, the latency should be low single figure ms. There is actually a slight bug in how that latency is calculated on the demo and includes an extra render tick, I was digging into it earlier but didn't get a chance to push a fix yet.
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#68Pretty interesting, what's the benefit of using a check expression rather than row level security?
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#69I 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 keep…
The model is Transactional Causal+ Consistency (TCC+). This has been formally proven to be the strongest possible consistency mode for an AP database system.
We have a page on literature here https://electric-sql.com/docs/reference/literature, which includes the Cure paper http://ieeexplore.ieee.org/document/7536539/ on TCC+ and the highly available transactions paper https://dl.acm.org/doi/10.14778/2732232.2732237
Annette Bieniusa, Nuno Preguiça and Marc Shapiro from our team are authors of the Cure work (amongst many other things!).
Re: rollbacks, our model is to provide finality of local-writes: https://electric-sql.com/docs/reference/architecture#local-w... -- which means you don't have to write rollback handlers.
Re: Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
#70Wow, 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 reaso…
Handling encryption/decryption of user data is one of our priorities. We're thinking along the lines of adding hooks for transforming data as you're seeing it.
We're getting there on permissions implementations. If you want to do row-based filtering based on user_id today, you can add a special column 'electric_user_id' to your table: https://electric-sql.com/docs/reference/roadmap#shapes
We plan to integrate Electric with popular web frameworks: https://electric-sql.com/docs/integrations/frontend. To integrate with Angular, the client should work out of the box. What you'd need is to provide is the code for reactivity, which should not be a lot. Reach out on Discord and we can have a chat about it.