Live data from Hacker News

What is Local first development

alexop.dev

41–50 of 56 posts

Re: What is Local first development

#41
the problem with this is that most browsers employ persistency rules for OPFS that are not very transparent, at least for the user, or not very predicable, at least for the developer. In other words, a user can find his/her data wiped out all of a sudden.

Here some info: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API...

There is also a discussion on HN: https://news.ycombinator.com/item?id=39222328

You can use the file system API as an alternative, which is permanent, but it's slow, requires the user to remember where the file was stored, and not recommended for things such as databases.

This makes the whole purpose of it a bit pointless in my opinion. What is your experience with it?

Re: What is Local first development

#42

Earlier quoted context omitted.

IME, and experiences may vary, "Well Enough" merge function usually means corrupt data, confusing outputs, incoherent semantics, and frustrating debugging sessions at any kind of scale beyond playing around. YMMV.

I find actual lock on edit or last-save-wins to work best of what I have seen for structured data. You can add nice visual tools that show who is editing (so you can wait for them) and pass the object lock to someone else etc, but this way at least there is no merge mechanism (that generally knows very little about the ins/outs of the data) which will merge two semantically incompatible fields into one record. For of…

This is what people actually do in practice when collaborating on large non-code documents.

The example I’m familiar with is assets in the video games industry. Everyone used Perforce (or maybe SVN) and artists/designers lock the 3D model or whatever they’re editing. People ask each other to give up a lock all the time.

Re: What is Local first development

#44
post #33

Earlier quoted context omitted.

XML had XML Schema and DTDs, making automatic validation a breeze. Its only issue was that it was a massive pain to type by hand and no good GUI editors really emerged. And some developers didn't understand the format and shoved stuff into attributes that should've been elements and vice versa.

lol i remember those days. most XML documents were missing DTDs and schemas (or that third type of schema whose name escapes me) and because the data structure of an XML document didnt map cleanly to lists and hashmaps you needed an ugly hacky xpath to grab whatever data you needed. Dont even get me started on the mess that was serialisation and deserialization. It was awful, overengineered design-by-committee mess.…

> or that third type of schema whose name escapes me

RRELAX NG, perhaps?

Re: What is Local first development

#46

> Effortless Collaboration: The app supports easy collaboration, even in offline scenarios. mmm, yes, i see

well, see, if you just hand wave away the really difficult part, and ignore the other really difficult thing (we have a perfect track record over 40+ years of users being terrible at sysadmin of their own computers), then this local first thing is super easy.

edit: to be clear, local first is interesting in theory, but I need a little more than draw the rest of the fucking owl.

Re: What is Local first development

#47
post #22

Earlier quoted context omitted.

That's literally how all software development used to work. All of these, except merge conflicts, are solved by expiring licenses, collecting logs and uploading them when asked or when connectivity comes back and it doesn't matter if it doesn't, it's the user's choice. Merge conflicts are truly the only unsolved issue and for good reasons. Notably offline IDEs work together with on-demand-online version control softw…

Well, Yes. But users today are used to everything being saved remotely, especially on a website. I think customers would be very angry if suddenly their data were gone because a sync didn't go through and data were lost because they cleaned their cache on perhaps another site that then affected all sites. People do have higher expectations on software than they used to have. There are also other issues with syncable…

> While all of these things are certainly possible, I also do think that the development time is longer.

I agree, but I don't think dev time is longer due to some intrinsic reality that local-first is technically harder. Nearly 2 decades of work has been put towards tailoring building blocks for SaaS systems. Similar building blocks can be made for local-first.

Re: What is Local first development

#49

Earlier quoted context omitted.

IME, and experiences may vary, "Well Enough" merge function usually means corrupt data, confusing outputs, incoherent semantics, and frustrating debugging sessions at any kind of scale beyond playing around. YMMV.

I find actual lock on edit or last-save-wins to work best of what I have seen for structured data. You can add nice visual tools that show who is editing (so you can wait for them) and pass the object lock to someone else etc, but this way at least there is no merge mechanism (that generally knows very little about the ins/outs of the data) which will merge two semantically incompatible fields into one record. For of…

> For offline-first, the user would be alerted that someone changed the record(s) while you changed them as well and ask what to do.

There are few sync strategies worse than "you worked hard on this, but now you have to choose to either throw away your change or everyone else's changes". May any product doing that fail miserably.

Re: What is Local first development

#50
post #23

Earlier quoted context omitted.

CRDTs with LLM suggested conflict resolution might just be the thing. Next best thing is keeping conflicts unresolved, but marked as such as a first-class citizen of the document content (see pijul, jj).

But then you don’t get convergence which is a requirement and LLMs will be just as good for Git as they will be for CRDTs.

You can get convergence with the same mechanism that OT uses for compaction: assign a special server role that does it.
Post reply on HN