Show HN: RemoteStorage – sync localStorage across devices and browsers

by pancomplexon 1/12/24, 7:01 PMwith 62 comments
by paulgbon 1/12/24, 9:19 PM

Your landing page at https://remote.storage/ is so good, I love the minimalism. Six lines of code tell me exactly what it does.

by stevageon 1/13/24, 2:00 AM

The bit about finding a unique ID for the user is the whole pain point though. The only way to do that really is for the user to create an account on some service that I host. And if I have that, I probably have my own hosted data storage anyway.

by joshstrangeon 1/12/24, 11:16 PM

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!

by mxuribeon 1/13/24, 3:54 AM

At first I got confused, because i thought this was a refreshed version of https://remotestorage.io ....but, i see now that its different/separate.

by tcperon 1/13/24, 2:22 AM

The use case is limited, a project has it's own backend, why need to add a new sub-system for tiny data storage?

by maxwellgon 1/12/24, 10:00 PM

On the authentication front - JWTs would be a great fit here!

The developer's backend could issue a JWT, which is validated by the remoteStorage backend. Then, use the `sub` field as the user ID. JWTs are pretty ubiquitous in frontend applications, so many people would be able to reuse their existing auth setup.

by amadeuspagelon 1/12/24, 9:57 PM

How does this compare to PouchDB[1]?

[1]: https://pouchdb.com/

by ocdtrekkieon 1/12/24, 10:49 PM

> 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.

by epson 1/13/24, 12:37 AM

How are the conflicts resolved?

Machine A is online and sets "x" to 1.

Machine B is offline and sets "x" to 2.

Machine B goes online.

What the resulting state on A and on B?

What if initially A was offline and B was online?

by matlinon 1/12/24, 10:16 PM

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.

by simlevesqueon 1/12/24, 10:25 PM

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

by notso411on 1/13/24, 9:22 AM

What if you assigned each user a unique ID, used this to determine the user session data and persisted this data in a server that was accessible by both web browsers. You could authenticate yourself against this user id by means of a secret only this user knows

It sounds a bit radical but it may work!

by evbogueon 1/13/24, 2:56 AM

If you rewrite the server in Deno you can remoteStorage the data in localStorage!

https://docs.deno.com/runtime/manual/runtime/web_storage_api

by toomuchtodoon 1/12/24, 8:28 PM

Cookies or passkeys? Seems very complex when you can use something simply to track state and identity. Passkeys sync across cloud storage, for example, even if you’re using a uuid as the username.

by novoreorxon 1/14/24, 12:50 AM

I think you should give an API specification so that people don’t bother using public API or hosting another service could implement it directly in the existing backend.

by valskon 1/13/24, 7:24 PM

I like this but umm yeah I can roll my own pretty easily. If you had a simple auth solution built in I'd use it!

by shunyaekamon 1/12/24, 10:06 PM

What is special with the server? I was surprised you offered a community-hosted server.

An OpenAPI spec should be enough, right?

by lxeon 1/12/24, 10:13 PM

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

by thatwasunusualon 1/12/24, 8:24 PM

> let's say you want to show a welcome modal to all new users that sign up for your product.

Not sure if this is a good example; how many users sign up for the same product multiple times?

by thih9on 1/13/24, 12:12 AM

Can this be treated as tracking or storing information about the user in the context of data regulations (like gdpr and similar)?

by SushiHippieon 1/12/24, 9:38 PM

Not to be confused with https://remotestorage.io/

by vidarhon 1/12/24, 9:07 PM

The name Remotestorage is already used for a protocol for portable user-controlled storage. See e.g. Remotestorage.io.

by airtonixon 1/13/24, 1:47 AM

how is this different from remotestorage.io ?