In the past ten years, all web development has been about the cloud-first ideology. Any click, any keystroke, and even each data piece we produce gets sent immediately to the distant centralized server. While such approach makes syncing very convenient, it brings along some drastic compromises: total absence of user privacy and the need for uninterrupted internet connection.
But now the software development world is moving towards an extremely powerful paradigm called Local-First Software.
The thing about the local-first application is that it stores the initial copy of data right in the user's device via some kind of client-side storage such as IndexedDB, SQLite, and others. Application works without delays when there is no internet connection because there is no need for waiting for a response from the distant cloud-based database.
At the same time, the local-first approach doesn't imply isolation. As soon as connection appears, the application automatically synchronizes data between all user devices by means of CRDTs (Conflict-Free Replicated Data Types). Since all data is produced and processed on the client side, any cloud sync can be fully end-to-end encrypted. Server simply becomes a blind messenger that just stores encrypted blocks of data without ever looking inside and seeing user's information.
For modern-day programmers, building local-first application solves two extremely challenging problems at once:
Total Privacy: It provides user with complete control over his/her digital footprint.
Efficiency of Infrastructure: it significantly reduces costs of server management and work with backend database.
Now as there is increasing interest to data privacy, the local-first architecture is gradually becoming a development standard. It proves that software can be highly connected and very secure.
Do you use client-side databases and local-first approach in your coding projects? Let's talk about difficulties of data synchronization in the comments below!