▲ | petralithic 6 days ago | |||||||||||||||||||||||||
ElectricSQL and TanStack DB are great, but I wonder why they focus so much on local first for the web over other platforms, as in, I see mobile being the primary local first use case since you may not always have internet. In contrast, typically if you're using a web browser to any capacity, you'll have internet. Also the former technologies are local first in theory but without conflict resolution they can break down easily. This has been from my experience making mobile apps that need to be local first, which led me to using CRDTs for that use case. | ||||||||||||||||||||||||||
▲ | jitl 6 days ago | parent | next [-] | |||||||||||||||||||||||||
Because building local first with web technologies is like infinity harder than building local first with native app toolkits. Native app is installed and available offline by default. Website needs a bunch of weird shenanigans to use AppManifest or ServiceWorker which is more like a bunch of parts you can maybe use to build available offline. Native apps can just… make files, read and write from files with whatever 30 year old C code, and the files will be there on your storage. Web you have to fuck around with IndexedDB (total pain in the ass), localStorage (completely insufficient for any serious scale, will drop concurrent writes), or OriginPrivateFileSystem. User needs to visit regularly (at least once a month?) or Apple will erase all the local browser state. You can use JavaScript or hit C code with a wrench until it builds for WASM w/ Emscripten, and even then struggle to make sync C deal with waiting on async web APIs. Apple has offered CoreData + CloudKit since 2015, a completed first party solution for local apps that sync, no backend required. I’m not a Google enthusiast, maybe Firebase is their equivalent? Idk. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | aboodman 5 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
I think this is a fascinating and deep question, that I ponder often. I don't feel like I know all the answers, but as the creator of Replicache and Zero here is why I feel a pull to the web and not mobile: - All the normal reasons the web is great – short feedback loop, no gatekeepers, etc. I just prefer to build for the web. - The web is where desktop/productivity software happens. I want productivity software that is instant. The web has many, many advantages and is the undisputed home of desktop software now, but ever since we went to the web the interaction performance has tanked. The reason is because all software (including desktop) is client/server now and the latency shows up all over the place. I want to fix that, in particular. - These systems require deep smarts on the client – they are essentially distributed databases, and they need to run that engine client-side. So there is the question of what language to implement in. You would think that C++/Rust -> WASM would be obvious but there are really significant downsides that pull people to doing more and more in the client's native language. So you often feel like you need to choose one of those native languages to start with. JS has the most reach. It's most at home on the desktop web, but it also reaches mobile via RN. - For the same reason as prev, the complex productivity apps that are often targeted by sync engines are often themselves written using mainly web tech on mobile. Because they are complex client-side systems and they need to pick a single impl language. | ||||||||||||||||||||||||||
▲ | bhl 5 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
Mobile has really strong offline-primitives compared to the web. But the web is primarily where a lot of productivity and collaboration happens; it’s also a more adversarial environment. Syncing state between tabs; dealing with storage eviction. That’s why local first is mostly web based. | ||||||||||||||||||||||||||
▲ | swsieber 6 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
I think the current crop of sync engines greatly benefit from being web-first because they are still young and getting lots of updates. And mobile updates are a huge pain compared to webapp updates. The PWA capabilities of webapps are pretty OK at this point. You can even drive notifications from the iOS pinned PWA apps, so personally, I get all I need from web apps pretending to be mobile apps. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | owebmaster 6 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
Because web apps run in a web browser, which is the opposite of a local first platform. Local-first is actually the default in any native app | ||||||||||||||||||||||||||
▲ | 946789987649 6 days ago | parent | prev [-] | |||||||||||||||||||||||||
In this case it's not about being able to use the product at all, but the joy from using an incredibly fast and responsive product, which therefore you want to use local-first. |