Hacker Timesnew | past | comments | ask | show | jobs | submit | big_elephant's commentslogin

Is it fair to say that if you have a high read\low write service, you could use this as a sort of local cache (with the added benefit that it also handles staleness through the sync) on the service itself, to reduce latency from not just calls to Postgres but other caches like Redis?


Right exactly — a sync engine like Electric maintains replicas of data wherever you like. So natural places are web apps, mobile apps, backend services, etc. Here's an example showing how to sync a table from PG to Redis https://github.com/electric-sql/electric/blob/main/examples/...

It's dramatically faster to read from a local copy of data vs. sending the query to Postgres and can eliminate a lot of network and db load as well.


Thanks!



does anyone know what stage this is in and what the path forward\timeline would be?


if you round down he has zero billion


seems like that support reversed course a month later: https://apnews.com/article/japan-fumio-kishida-names-new-cab...


this is amazing. does anyone know how one would get started building something like this?


it depends on who will be downloading the bundle. if it's a group of consistent users primarily using desktop browsers, it may not be worth worrying about since they'll probably download it once at a fast speed and reuse from the cache repeatedly afterwards.

if you have lots of new users on mobile using slow cellular connections, big libraries like moment.js add up and can really hurt load times and make for a poor user experience. for circumstances like that, a developer might look at what are the biggest libraries in their vendor bundle and look for ways to reduce them via tree-shaking or find alternatives, that is if they are even aware of how slow their current bundle might be for mobile users. i think this is for that kind of use case, not only to offer alternatives to those who might need it, but also to raise awareness for those who develop on their desktop and don't engage with their app like most of their users do


I think mobile phones have browser cache too.


sorry, i shouldn't have mentioned caching. the emphasis should have only been on connection speed


hm i'm not sure why ports would not work in that use case (the keycloak one, right?). the port would be how you communicate between js and elm, so it looks like inside the js callbacks is where you would `send` that data through the port to elm


Agreed, it could work with Keycloak, or other 3rd party libraries, depending on the amount of collaboration between JS and Elm. My point was that some things that are simple when you can pass around promises suddenly get very complicated when all you have is ports and messages.


I came across an example which makes using ports sound a bit tedious (but suggests an alternative.) It's at the start of this talk:

https://www.youtube.com/watch?v=tyFe9Pw6TVE


excellent video, thanks. custom elements are a very interesting alternative


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: