4

Local-First Web Development: Closing The Gap Between Your Users And Their Data

 8 months ago
source link: https://devm.io/software-architecture/local-first-architecture
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

High-performance user experience without sacrificing collaboration and synchronization

Local-First Web Development: Closing The Gap Between Your Users And Their Data


Fashion dictates that apps should be mere thin clients, displaying data that's stored somewhere in the cloud. But there is another way! There’s a movement growing around an alternative architecture - "local-first" apps - designed instead with data primarily stored on the device, and facilitating high performance user-experiences without sacrificing collaboration and synchronization. In this article, we’ll discuss some of the pros and cons of cloud-first vs local-first apps, and take a look at a JavaScript state management library called TinyBase that's built with these principles in mind.

Over the last year, I’ve been lucky enough to leave my professional life in Silicon Valley, and move onboard a sailboat. Gone are the days of commuting up the 101 Freeway, back-to-back meetings, and an overflowing inbox of work emails.

But so too are the days of fast or even reliable internet connectivity! In fact, it has been a real wake-up call: every timeline that never loads, every stuttering podcast, every message that fails to send - all serve as a reminder that my apps and web experiences seem to assume that I am constantly online.

Anticipating this, one thing I did before I moved onto the boat was to archive that historical digital footprint off my laptop. I categorized my local files by date and copied them over, year-by-year, to an archive. I noticed a very interesting thing: during the 2000s, I had more and more local artifacts every year. But around 2010, the archiving process accelerated: I had accumulated fewer and fewer files on my computer each year. By 2021, I barely had anything to show for myself:

Fig. 1

Now maybe I was getting less creative, less productive? But no, that didn’t seem right. It was more just like my life’s work just wasn’t on my computer.

And of course, that’s exactly what had happened. My mail isn’t in Outlook .pst files any more. My photos aren’t on my hard drive. Most of my code isn’t even on my laptop. Documents, spreadsheets, designs, sketches, presentations: they’re all on someone else’s computer now - what we call, of course, ‘the cloud’.

After a decade, we take for granted that the cloud brings huge benefits. I can drop my laptop in the sea and everything important is still on a quietly humming computer in a rack in a big tech company’s data center. I can access content from my phone just as easily as from my laptop. And it’s easier than ever to work together: you and I don’t have to send attachments back and forwards over email to collaborate on, with increasingly ridiculous filenames! All we need is that fast internet connection

And that’s when it hit me: not only do my apps and web experiences assume that I am connected, but my content assumes I am connected too. And when I’m offline? I literally can’t access anything that I created over the last ten years of my life.

There’s a saying in the maker community that “if you can't fix it, you don't truly own it”. Maybe we should also say that “if your data is only on someone else's computer, it's not truly yours”.

Local-First Software

Once upon a time, our devices were everything. Our electronic destiny was in our own hands. When we, as developers, built apps, they were ‘device-first’: state was always stored on the user’s computer. The web was a useful way to share and consume, but not fundamental to daily creative workflows.

Now, the pendulum has swung hard the other way to ‘cloud-first’. Intelligence, data, and business logic is nearly always hosted elsewhere. And, our devices, which aren’t just desktop computers now, act as thinner and dumber clients, entirely beholden to connectivity.

By the way, despite this huge architectural shift, apps and their user experiences haven’t often changed that much. Cloud-first spreadsheets in 2023 really aren’t that different from the local-first spreadsheets we had in 1997!

So has it been worth it? I suspect we’ve lost some trade-offs as this pendulum has swung. And I am not alone. Over the last few years, a new movement has emerged, re-exploring the benefits of ‘Local-First Software’. Is it possible to reconcile the best of both worlds? To reclaim the ownership of your content? And have data reside on a local device so that it’s useful when you’re disconnected - whilst also being able to switch between devices and collaborate with others when you are connected?

The closest thing to a manifesto that this movement has is this powerful article by the research lab...


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK