Live data from Hacker News

What if serverless meant no backend servers?

subzero.cloud

131–138 of 138 posts

Re: What if serverless meant no backend servers?

#131
post #89

Show me where you store the data. If you store it on your phone, then it's not showing up on your other devices. If you lose or break your phone, then your data is gone. There are very few applications for which that's acceptable - basically just your calculator app. If you don't store it on your phone, then it's stored on some kind of server, somewhere . Do you own and control that server, or does someone else? How…

Fair point. To quibble though, I guess you are only thinking of iPhones and iPads. There are other mobile devices with built-in support for sdcards, and even USB drive, that easily allow you to save your data on them or use them to create backup of your data. These features allows the user to have better control of their data.

Re: What if serverless meant no backend servers?

#132

Earlier quoted context omitted.

iCloud already supports this, and from what I gather it works decently well: https://developer.apple.com/documentation/uikit/uidocumentst... https://developer.apple.com/library/archive/technotes/tn2336... Essentially there's an OS mechanism for getting the different versions of the file, your app can detect conflicts and choose how to resolve them, including by displaying arbitrary UI to the user. IIRC This UI can ev…

> your app can detect conflicts and choose how to resolve Like GP said - app specific. If I have two different versions of a SQLite database, that started from a common revision but were both updated independently, and want the updates that were applied in each of them to be preserved - there is quite a lot of work left to do after Apple throws their hands up.

You wouldn't (and don't) use this kind of mechanism at the file-level on an entire SQLite database: just because someone suggests something be an OS feature doesn't mean that existing software would work without changes.

Re: What if serverless meant no backend servers?

#133
post #132

Earlier quoted context omitted.

> your app can detect conflicts and choose how to resolve Like GP said - app specific. If I have two different versions of a SQLite database, that started from a common revision but were both updated independently, and want the updates that were applied in each of them to be preserved - there is quite a lot of work left to do after Apple throws their hands up.

You wouldn't (and don't) use this kind of mechanism at the file-level on an entire SQLite database: just because someone suggests something be an OS feature doesn't mean that existing software would work without changes.

> You wouldn't (and don't) use this kind of mechanism at the file-level on an entire SQLite database:

But the OFA is about databases, and this thread is about syncing databases. So you agree with me: the Apple feature is worthless for this use case. GGP was right that its a lot of work to build sync with conflict resolution into an application, and its application specifc.

Re: What if serverless meant no backend servers?

#134
I like the concept and I'm building a similar framework but I think you made some confusion in the implementation?

Your server.ts (which uses express) runs in Vite or in a worker (which would require a lot of adaptations/might not even be possible)? If it runs using vite, that's a server. Then the distribution of your app is compromised: or people would run it locally having to start the server or they would need to spin up a server somewhere. How does it become ""serverfree"?

Re: What if serverless meant no backend servers?

#135
post #115
post #98

I believe what is being proposed is a static site where user data is persisted locally using the WASM sqlite + OPFS. I guess it is also organized like a typical web app, but the app logic and database logic run locally. I was expecting something different because it started with phrases like "no servers at all" and "entirely without any servers", but there's a regular web server serving static files. I'm not a fan of…

Speaking of WASM. Is there a way to run code in the browser that calls endpoints secured with CORS? I tried looking it up recently but no luck. I feel its a pretty big limiter when trying to call out to third parties directly and letting people bring their own API key. I've been thinking about making a web GUI over gmailctl for easy editing but want to make it very easy to use without hosting and without people sendi…

If I understand correctly, you're talking about making HTTP requests from code running in the browser to a third-party API.

Whether you're doing WASM or Javascript, you use fetch() and need to have your CORS ducks in a row. How exactly you call fetch() depends on your toolchain, but anything trying to be general-purpose will expose it somehow.

Re: What if serverless meant no backend servers?

#136
post #34

Earlier quoted context omitted.

Conflict resolution logic is typically application specific so it would be hard to get something like this working in practice.

If it is a solo user, latest data would be enough to sync. Asuming the blog post tackles personal need app, single user.

What if you were offline for a while?

Re: What if serverless meant no backend servers?

#137
post #135
post #115

Earlier quoted context omitted.

Speaking of WASM. Is there a way to run code in the browser that calls endpoints secured with CORS? I tried looking it up recently but no luck. I feel its a pretty big limiter when trying to call out to third parties directly and letting people bring their own API key. I've been thinking about making a web GUI over gmailctl for easy editing but want to make it very easy to use without hosting and without people sendi…

If I understand correctly, you're talking about making HTTP requests from code running in the browser to a third-party API. Whether you're doing WASM or Javascript, you use fetch() and need to have your CORS ducks in a row. How exactly you call fetch() depends on your toolchain, but anything trying to be general-purpose will expose it somehow.

Thanks for clarifying. I hope that one day there is a way to securely make those kinds of requests in the client side. Until then I'll be using a proxy to strip the cors headers.

Re: What if serverless meant no backend servers?

#138
post #47

Earlier quoted context omitted.

Same here, Every single product or service I pay for, needs to work on Linux and on Android. Like Spotify. I love that the music plays on Linux with the big speakers, but I am choosing the songs on the Android pocket device.

since this is basically running in a (modern) browser, doesn't it follow that it works on all platforms where there is a browser?

It was only an example, and in both platforms I use an installed application.

A more interesting example: I use pCloud instead of MS OneDrive, or Google Drive. They don't have supported Linux clients.

I rejected Dropbox for other reasons, like the limitation to have only one synchronized folder, but technically it has an Ubuntu service and an Android app.

Icedrive seems to be a suitable service, but I found pCloud first.

And believe me: I will not use a browser based interface when I could simply save the files into several folders of my preference, and the sync happens in the background. Every single file storage service I mentioned has a browser based interface. I consider all of them unusable.

Post reply on HN