Live data from Hacker News

Show HN: RemoteStorage – sync localStorage across devices and browsers

github.com

21–30 of 69 posts

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#21
I love the simplicity and kinda wish that was actually built into Chrome.

I know it would probably break things but if Google could automatically sync local storage and IndexedDB when I'm signed into Chrome on all my devices then a lot browser of apps wouldn't require making an account or even a server for that matter.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#22
post #19

So, just a UUID to authenticate? How do you recover/reset in case it gets lost?

You'd need to keep track of that somewhere for now, but as someone else suggested here, we could soon extend the library to support JWTs for authentication.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#23
post #21

I love the simplicity and kinda wish that was actually built into Chrome. I know it would probably break things but if Google could automatically sync local storage and IndexedDB when I'm signed into Chrome on all my devices then a lot browser of apps wouldn't require making an account or even a server for that matter.

Thank you! My goal was to make it as stupidly simple as possible in the first version.

I am also pretty surprised Google hasn't yet built something that solves this. When localStorage first came out, I was expecting a natural extension would be a way to sync it to a centralized store to avoid having state reset between sessions/devices.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#25

That's so cool ! I was thinking how I'd make work syncing my offline first app and this looks promising

Your app might not need it but if you want partial replication or relational querying in addition to offline-first syncing then check out https://github.com/aspen-cloud/triplit (disclaimer: I'm working on this)

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#27
> Has anyone felt the same pain points with localStorage before?

For Sandstorm, we've always want to make sure app data is stored on a server, but an increasing number of web apps love to use localStorage as a cheap hack to avoid writing a backend. I recall a bunch of attempts back in the day, but we were always looking for a simple way to include something with an app written to use localStorage which could store the data on a server backend instead.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#28
post #25

That's so cool ! I was thinking how I'd make work syncing my offline first app and this looks promising

Your app might not need it but if you want partial replication or relational querying in addition to offline-first syncing then check out https://github.com/aspen-cloud/triplit (disclaimer: I'm working on this)

how does this compare to https://electric-sql.com/

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#29
Very cool overall but the sync->async change means you can't always use it as a drop-in replacement. I assume it's making network calls in those cases which will take significantly longer that local writes. I wonder if something could be done so that it write the data locally and kicks off something async in the background to sync it up to the backend. Maybe with just a timestamp in case you go offline to handle conflicts (or even way to register a callback if there is a conflict so you can decide how to handle it). I know that all makes this more complicated but I'd be worried about adding waiting for a network call where I currently do localStorage calls.

But still a very cool project, thank you for sharing!

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#30

Very cool overall but the sync->async change means you can't always use it as a drop-in replacement. I assume it's making network calls in those cases which will take significantly longer that local writes. I wonder if something could be done so that it write the data locally and kicks off something async in the background to sync it up to the backend. Maybe with just a timestamp in case you go offline to handle conf…

Good question. I like the idea of having a configuration that includes optimistic writes and perhaps even reads from localStorage for projects that have very low latency/unstable network requirements.

That being said, the server is blazingly fast as it leverages Redis and Fastify under the hood. In most of my testing, even on WiFi in SF with a server in Oregon, I would achieve <20ms reads/writes.

Post reply on HN