Earlier quoted context omitted.
This is handled by Redis, as such, the last write will win. As the primary key is tied to the user id, there will not really be a concept of Machine A vs Machine B as the end user can only be in one place at a time.
I see. The case in question is when the user switches between two devices, each of which may be sometimes offline. This can cause older changes hitting the server later than the new ones, in which case, ideally, they should be rejected. What happens to storage requests made while offline? Are they cached locally and propagated once online, or are they lost?
Show HN: RemoteStorage – sync localStorage across devices and browsers
61–69 of 69 posts
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#62How 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?
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#63Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#64I 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!
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#65Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#66Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#67The use case is limited, a project has it's own backend, why need to add a new sub-system for tiny data storage?
I would state the opposite, the use case is huge. To add something new, that needs to persist, will not require going to a backend team and begging for a new API from them. A common difficulty is the simplest scenario, where do I store this frontend user preference? How do I store this that prevents nagging multiple times across devices? Backend teams will argue this is a frontend piece of data, and they provide APIs…
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#68Not to be confused with https://remotestorage.io/
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#69On 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.