9 ms·
Local-First Software:You Own Your Data, in Spite of the Cloud (2019) [pdf]
- jasode 6y agoThe headline is about the aspiration but not the implementation. Within the contents of the paper, it talks about CRDTs to technically implement it. I'm not familiar with the technical tradeoffs but I bookmarked some past HN threads mentioning CRDT did not fare as well as OT (Operational Transform): https://news.ycombinator.com/item?id=19886883 https://news.ycombinator.com/item?id=19886883 https://news.ycombinator.com/item?id=19847622 https://news.ycombinator.com/item?id=19847622
- josephg 6y agoModern CRDTs like Automerge and Yjs should be able to perform basically just as well as an OT based systems (like my own ShareDB) now. I ran some benchmarks using Kleppmann’s approach a few months ago[1] and I think a well implemented crdt should easily be able to do millions of edits/second. The thing that’s holding us back at the moment is the lack of good high performance native implementations of these systems. But that’s being worked on. This has only really started being true in the last year or so. [1] https://josephg.com/blog/crdts-are-the-future/ https://josephg.com/blog/crdts-are-the-future/
- WhatIsDukkha 6y agoI assume you are following https://github.com/automerge/automerge-rs https://github.com/automerge/automerge-rs I'm hoping this matures a bit more in the next months, seems really promising.
- tmotwu 6y agoIf javascript/non-native CRDT implementations are responsive enough compared to existing algorithms for collaborative editing like OT, what incentives or cases exist to demand high performance native implementations? To be clear, I think this is exciting stuff and your article is great. I'm just curious if there are any open research problems in this area that would make them more appealing in production.
- josephg 6y agoThis sort of data structure is extremely hard to well optimize in javascript because a lot of the performance comes from finicky datastructure optimizations to keep allocations down in the fast path. JS implementations will be "fine", but I think there'd be a 20+x performance uplift between yjs and a zero allocation style rust/C implementation using btrees / skip lists. So on the server I'd rather have a native implementation - which would also remove the need to bundle a JS VM in databases. And if we have that, it should be pretty easy to pack the same code into wasm for the browser. And this is all assuming a JS-native web world. I also want CRDTs for native apps like Bear. And it'd be much easier to use a rust library than link to v8.
- kevinjahns 6y agoNeither of them says that. The xi CRDT was not about shared editing. The second paper just says that CRDTs are not superior per se. But CRDTs are being used in production for text editing and they are performant if implemented correctly (even in js). The following article shows that: https://news.ycombinator.com/item?id=24176455 https://news.ycombinator.com/item?id=24176455
- dvt 6y agoThese kinds of ideas always get traction here on HN or similar places (slashdot), but I think that ship has long sailed. People, by and large, seem to be totally okay with storing data in the cloud -- from Dropbox, to Google Docs, to InVision. All things considered, data breaches are rare, and if they do happen, they're usually to be blamed on configuration blunders, not the services at large. Other than a few highly-specialized niches (InfoSec, government, military), the de-facto reality is that online-first collaboration pros seem to outweigh the cons.
- gobengo 6y ago> People, by and large, seem to be totally okay with storing data in the cloud It's simply not true, or if it is, it's only because of what you're choosing to looking at to build your view of how it 'seems'. https://mydata.org/ https://mydata.org/ https://en.wikipedia.org/wiki/General_Data_Protection_Regulation https://en.wikipedia.org/wiki/General_Data_Protection_Regula... https://ethereum.org/en/ https://ethereum.org/en/ https://solid.mit.edu/ https://solid.mit.edu/ Meeting every week: https://identity.foundation/working-groups/secure-data-storage.html https://identity.foundation/working-groups/secure-data-stora... > All things considered, data breaches are rare, and if they do happen, they're usually to be blamed on configuration blunders, not the services at large. Did you work at Google? Do you know about PRISM? https://en.wikipedia.org/wiki/PRISM_(surveillance_program)#Companies https://en.wikipedia.org/wiki/PRISM_(surveillance_program)#C... Can't tell if you're intentionally or accidentally misleading.
- dvt 6y ago> Can't tell if you're intentionally or accidentally misleading. All I'm doing is looking at the market cap of companies like Facebook and Dropbox. I mean, hell, Facebook literally sold personal data and sure, you occasionally see "boycott FB" movements, but they're all bark and no bite.
- adkadskhj 6y agoThis is sort of like saying people are okay with cancer because they buy certain plastics in mass. The reality is people are ignorant of what is good for them in a ton of applications, including this one. Only a handful really grasp the context of what is happening with their data and most importantly how their data could affect them. People routinely do things against their own interest. It's up to the other people that care about this issue to make competing products that don't harm. There's simply no way to get everyone to really care about an issue with nuance and/or niche knowledge.
- maxrev17 6y agoEven a lot of devs have turned to aws/azure/gcp.... Local first is too much responsibility for some.
- pdimitar 6y agoI am completely behind the idea and would work full time on it (if I had my time for myself) but all such documents or sites are all talk and no code and it's getting tiring. I get that they want to inspire, to show data backing up the idea that people are open to that software model, and in general to give hope and inform but... I am getting way too cynical and I can't help but wonder if actually writing a tool that builds the foundations of such a movement wouldn't have been a time better spent? I mean, at what point will somebody do something about it? And does it have to be your average overworked programmer who is sacrificing their scarce free time? When will one of these organizations that periodically toot their own horn about much they care, will hire several hardcore programmers to do something?
- Jtsummers 6y ago> I am getting way too cynical and I can't help but wonder if actually writing a tool that builds the foundations of such a movement wouldn't have been a time better spent by the authors? One of the authors wrote a book on this topic that gets high praise and frequent recommendations on this site. Several (all?) of the coauthors worked on prototypes on this topic that they discussed freely in order to enable others to follow their same path and explore it further. So yes, I'd say you're getting way too cynical.
- pdimitar 6y agoI'll immediately agree I am getting too cynical. I just wish we had something more than inspirational articles about the issue. Didn't know about the prototypes. Good on the authors! I do wonder why not one has been seen to completion though, do you know?
- bhl 6y agoHave you seen Kleppmann's automerge library? https://github.com/automerge/automerge https://github.com/automerge/automerge
- pdimitar 6y agoNo. Checked quickly, looks good. Thanks for the link!
- endisneigh 6y agoI wish OneDrive, Dropbox, etc. had a notion of a Personal Database File System, PDFS. With PDFS if they all shared the same API then you could build a database ontop of the PDFS that syncs to popular file systems. If both of those things existed you would be able to build apps like LinkedIn such that LinkedIn could just access your PDFS so your profile is actually hosted directly on your PDFS - so if you delete your profile info on your PDFS it's gone from LinkedIn. Of course, this also depends on trusting LinkedIn to not just copy over the contents of your PDFS but that could be handled as well.
- WrtCdEvrydy 6y agoYou have to remember that all of these companies are either part of a large company or a startup. Locking you in is the reason they can justify their stock, their IPO, their exit and their high developer salaries.
- jay_kyburz 6y agoIsn't the API the filesystem? What happens if you set up OneDrive and Dropbox (and Google and Apple) to sync the same folder.
- qbasic_forever 6y ago> What happens if you set up OneDrive and Dropbox (and Google and Apple) to sync the same folder. Chaos, potentially. Think about deletes... delete a file from the web UI of one service, its client deletes the file locally, but that same instant the _other_ service sees the missing file and happily restores it, the first client deletes, the second client restores, etc. etc. until you've blown gigabytes and gigabytes of network bandwidth.
- Jtsummers 6y agoIn other words, ultimate control needs to be on the client side. You delete from Dropbox, and the local machine marks the file as no longer being backed up by Dropbox but does not delete it. Some UI needs to present to the user: This file is backed up in these services, but not the other one. At that point, the user has the choice of fully removing the file, restoring it to Dropbox, or leaving it alone. They may even decide they don't want it backed up in any service, but want it to remain on the filesystem.
- sjbrown 6y agohttps://www.inkandswitch.com/local-first.html https://www.inkandswitch.com/local-first.html HTML version here
- Geee 6y agoYou can own your data if you use client-side encryption with cloud. When encrypted, you don't have to trust the cloud provider. This opens up new possibilities such as P2P networks with fair pricing, no provider lock-in, equal access and censorship resistance. I'm excited about Sia / Skynet which enables these kind of apps.
- saurik 6y agoThat works fine as long as you don't care that advances in computers and cryptography would one day (maybe after you are dead, and likely only with some notable effort) allow someone to read your data and (much more practically) you are extremely confident you can't lose control of your key somehow.
- Geee 6y agoManaging and using private keys safely is still a huge unsolved problem in general.
- doggodaddo78 6y agoKeychains, Vault, GPG, HSMs, password managers. It's solved, just requires effort and understanding to setup. It's neither "huge" nor "unsolved" as pks have to live somewhere and cannot exist in the aether.
- Geee 6y agoYeah, I meant that the security tradeoff with usability is unsolved in personal use. It requires too much effort and understanding. If you use hardware keys, you still have to backup your keys somewhere safely.
- motives 6y agoIf it wasn't considered a solved problem, we wouldn't have public CA's for our browsers to trust, as their very premise is based on having a secure way to store private keys. I think a FIPS-140-2 level 4 HSM and hashicorp vault enterprise will cover 99.9999% of all other use cases for private CA's and PKI.
- camnora 6y agoLocal-first software feels underrated especially in the UX realm. Peer-to-peer applications such as Manyverse load instantly due to not being blocked by network requests. My hope is that more apps are developed with a local-first mindset. CRDTs likely introduce additional complexity around data storage, so this would certainly be a drawback when considering local-first.
- amadeuspagel 6y agoPouchDB/CouchDB is great for this kind of software. Shameless self-promotion: I used it for thinktype[1], a note-taking app. [1]: https://thinktype.app https://thinktype.app
- matthewn 6y agoGlad to hear someone say this! I'm itching to make a selfhosted Workflowy clone and have pretty much zeroed in on PouchDB/CouchDB to make the syncing easy. Would love to know if you found any pitfalls while working with the pair.
- amadeuspagel 6y agoI did struggle with representing a graph and put that on ice. Though I only tried it with "raw" pouchdb, and researching this right now I found a plugin that supports many-to-many relationships[1]. [1]: https://github.com/pouchdb-community/relational-pouch#many-to-many-relationships https://github.com/pouchdb-community/relational-pouch#many-t...
- darkhorse13 6y agoI still can't believe this paradigm of PouchDB/CouchDB did not get more popular. Seems very underrated to me.
- sportsaw 6y agoI love this: > In the Trellis project we experimented with a “time travel” interface, allowing a user to move back in time to see earlier states of a merged document, and automatically highlighting recently changed elements as changes are received from other users. The ability to traverse a potentially complex merged document history in a linear fashion helps to provide context and could become a universal tool for understanding collaboration.
- hippira 6y agoMartin Kleppman has been writing quite a lot about auto merge data types.
- aklemm 6y agoGoogle Wave?
- gmueckl 6y agoRe-watch the initial presentation of Google Wave. This was a complex demo that tried to explain what Google Wave is step by step so that a pretty tech-savy audience could follow. And it took several hours to talk them through. Now imagine teaching all of that to a less technology minded audience. It probably won't go well.
- reasonabl_human 6y agoI’ve always wondered why word processors don’t take this approach out of the box.... ‘resume_v2_2021_final_done.docx’ -> resume.docz using some wrappers around git seems pretty straight forward to me... and I’d be using it in a heartbeat
- CGamesPlay 6y agoWord absolutely has this functionality, and it's about as complicated as git, which is why only people who use Word professionally use the functionality. It's just too complicated compared to using the file metaphor you're already familiar with.
- anothernewdude 6y agoI'm not convinced data can be owned.
- rhacker 6y agoIf a doctor takes a picture of your wife's anus for a medical report, should that data be allowed to be saved and resent to anyone? Posted online? Distributed by one of those websites that lets you find people? There are use-cases for data ownership, stewardship, management and security.
- anothernewdude 6y agoI don't think providing protections against the acts in your example require the presupposition of data ownership.
- oblib 6y agoMy latest version of my ezInvoice app has a local-first option. It's also offline first. The user has to install CouchDB on their desktop PC to use the local first option. Basically they just use a different html file to access the local CouchDB instead of the Cloud based CouchDB. The app is also offline first and doesn't use the internet at all unless you turn on the "Live Sync" function in the app's preferences. At that point it's still local first but it syncs with my Cloud based CouchDB and users can access that by using a different url. Since Live Sync works both ways whenever the Cloud CouchDB is updated those changes are pushed to the desktop PC if it's connected to the internet, or as soon as it is. Users can also make backups and snapshots of their DBs on their desktop CouchDB. I released ezInvoice back in 2002 and this is something I've wanted to do since then. Feels pretty good to have what's needed to get it working.
- ashdev 6y agoIn section 2 it says - "In cloud apps, the data on the server is treated as the primary, authoritative copy of the data; if a client has a copy of the data, it is merely a cache that is subordinate to the server." Exactly! Local copy is just treated as cache in those apps which offer offline support. They are called "Offline-also" apps, not Offline-first apps. I miss those days when I could just buy the software and own it. Collaboration can happen in offline-first apps too, it's tricky but it can be done. Everything is online-first web apps these days because of the reasons listed in section 3.2.1. There is one more reason for popularity of online-only web apps: When startups are testing their idea, it's far easier to put together an online-first app than offline-first. It's easier to get traction comparatively because it just requires a browser. When they get some traction, then a desktop app is a low priority to them. I want to bring back offline-first desktop apps back. I've already started with Brisqi[1] an offline-first personal Kanban app. Hope more people take an offline-first approach. For similar reasons, I could write a whole essay on why we developers need to create a better open source cross-platform framework to develop offline-first desktop apps with permissive licensing. [1] https://brisqi.com https://brisqi.com
- rklaehn 6y agoLocal first is often just plain the better technical solution. E.g. you put a pin on a map to mark the parking spot, and want to share it with somebody standing right next to you. But it does not work because the connection to some data center 1000 km away is flaky. This is just plain bad design. Or you want to print something or get two machines to interact. Any remote third party you bring into this interaction is going to increase latency, reduce bandwidth, increase the probability of failure, etc. That is why we use the local first approach for factory shop floor software at actyx.com . You don't want your factory to stop because the link to the cloud is down.
- higerordermap 6y agoIn developing nations, we often don't even have good internet. Uploading a 20 MiB file to Dropbox may fail a few times. But these days developers often forget these kind of situations.
- rklaehn 6y agoBad internet is not just a thing in developing nations. It is also an issue in developed countries as soon as you leave the cities. And factories are often in rural areas. E.g. in Germany, as soon as you leave the big cities, the options are atrocious. I live in a very rich and touristy village in the German alps. I get 50 mbit/s DSL, which is actually just 25mbit/s down because the wires are so bad. For comparison: in rural Romania, I get gigabit fiber to the premise for an eye-watering 10 EUR / month...
- holtwick 6y agohttps://onepile.app/ https://onepile.app/