Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do we still need a back-end, now that Chrome supports the File System Access API on both desktop and mobile?

I have started writing web apps that simply store the user data as a file, and I am very pleased with this approach.

It works perfectly for Desktop and Android.

iOS does not allow for real Chrome everywhere (only in Europe, I think), so I also offer to store the data in the "Origin private file system" which all browsers support. Fortunately it has the same API, so implementing it was no additional work. Only downside is that it cannot put files in a user selected directory. So in that mode, I support a backup via an old-fashioned download link.

This way, users do not have to put their data into the cloud. It all stays on their own device.






What about those of us who use multiple devices, or multiple browsers? I've been using local storage for years and it's definitely hampering adoption, especially for multiplayer.

One approach might be to save the file to a shared drive like Google Drive?

Not sure I trust Dropbox to merge data. What happens when I want to migrate my data structures to a new schema?

As far as I know, Dropbox does not merge data.

I never tried it, but from the descriptions I have read, Dropbox detects conflicting file saves (if you save on two devices while they are offline) and stores them as "conflicting copies". So the user can handle the conflict.

As a developer, you would do this in the application. "Hey, you are trying to save your data but the data on disk is newer than when you loaded it ... Here are the differences and your options how to merge.".


> Hey, you are trying to save your data but the data on disk is newer than when you loaded it

You're suggesting an actual API-facilitated data sync via Dropbox? Sure, but at that point why? Unless the data also needs to be read by 3rd party applications, might as well host it myself.


Sure. You brought up Dropbox. Not me.

s/Dropbox/Google Drive/

Syncthing pls. Pls try to use open source alternative whenever possible even though they are not as developed as the closed sourced one, it works better for the public.

TIL! I enjoy building cloudless apps and have been relying on localstorage for persistence with an "export" button. This is exactly what I've been looking for.

A lot of what I've read about local-first apps included solving for data syncing for collaborative features. I had no idea it could be this simple if all you need is local persistence.


At least on the Android front, I'd prefer the app allow me to write to my own storage target. The reason is because I already use Syncthing-Fork to monitor a parent Sync directory of stuff (Obsidian, OpenTracks, etc.) and send to my backup system. In effect it allows apps to be local first and potentially even without network access, but allow me to have automatic backups.

If there were something that formalized this a little more, developers could even make their apps in a... Bring Your Own Network... kinda way. Maybe there's already someone doing this?


What do you mean by "storage target"?

Since the File Access API lets web apps simply use the file system, I guess you could just write the file to a shared drive.


I may have misunderstoood. Does that mean with this API on both desktop and phone I can point to an arbitrary drive on the system without restriction? If so, it does indeed do what I'd like.

That's basically how the File System Access API works, yes.

Technically probably not completely "without restriction". But for all practical purposes, it works just fine for me.


The closest I'm aware of is https://remotestorage.io/ , the protocol has been relatively static for a while but not widely adopted.

> Do we still need a back-end, now that Chrome supports the File System Access API on both desktop and mobile?

Could this allow accessing a local db as well? Would love something that could allow an app to talk directly to a db that lives locally in my devices, and that the db could sync across the devices - that way I still get my data in all of my devices, but it always stays only in my devices

Of course this would be relatively straightforward to do with native applications, but it would be great to be able to do it with web applications that run on the browser

Btw, does Chrome sync local storage across devices when logged in?


> Could this allow accessing a local db as well?

Like IndexDB? It’s a browser API for an internal key-value storage database.

> Btw, does Chrome sync local storage across devices when logged in?

Syncing across devices still requires some amount of traffic through Google’s servers, if I’m not mistaken. Maybe you could cook something up with WebRTC, but I can’t imagine you could make something seamless.


> Btw, does Chrome sync local storage across devices when logged in?

No, but extensions have an API to a storage which syncs itself across logged-in devices. So potentially you can have a setup where you create a website and an extension and the extension reads the website's localStorage and copies it to `chrome.storage.sync`.

Sounds like an interesting idea actually.


That's a clever solution

I've been playing with chrome extensions recently, and have made them directly talk to a local server with a db. So using extensions, it's relatively easy to to store data locally and potentially sync it across devices

I like the idea of leveraging chrome.storage.sync though, I wonder what the limitations are


> I wonder what the limitations are

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

says that there is a 100kb limit, and a 512 KV pair limit per extension.

Quite limiting, but if this pattern becomes popular I don't see why it can't be expanded to have the same limit as localStorage (5MB)


Any examples?



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: