Summary
Local-first architecture refers to a modern development pattern where primary read and write operations occur to a local database on clients’ devices while data is synced across devices and users automatically in the background. This provides benefits like instant UI, offline support, and real-time capabilities while still syncing to the cloud automatically. With Basic, you can avail these features in your applications for your users by starting a new app or integrating Basic into your existing React app.What is local-first sync?
Native property | Local-only | Local-first | Cloud |
---|---|---|---|
Low-latency / Instant UI | ✓ | ✓ | |
Offline support | ✓ | ✓ | |
Real-time sync | ✓ | ✓ | |
Multi-device support | ✓ | ✓ | |
Backup to cloud | ✓ | ✓ |
Figma co-founder explains its local-first architecture, 2019

Linear co-founder explains developer benefits of local-first sync, 2024

ElectricSQL

Pierre

Zero

Benefits of local-first sync
Instant and snappy UI
Regular UI

Instant UI

Fewer network calls
1
Lower network costs
Fewer network calls across all your users mean a lower load on the server, therefore lowering server costs.
2
Fewer points of failure
Having to rely on the network for primary read/write operations introduces many points of failure. Local-first sync overcomes issues like lost connectivity, unreachable servers, and slow networks that often make apps unusable.
Simpler architecture
Automatic state management
Manual state management
Automatic with Basic SDK
db.collection('tablename').get()
without worrying about updating state.
Offline support
Real-time capabilities
Trade-offs with local-first sync
It would be insincere to discuss a new technology without mentioning its trade-offs. Here are a few we’ve identified:1
More storage requirements on client device
Local-first apps require more storage on the client device as they store more data locally.
As more of the internet becomes local-first, more storage will be required to support this.However, storage has gotten really cheap, with phones and laptops coming with higher storage capacities by default.Additionally, good partial-sync algorithms (as those provided by Basic) manage this automatically on behalf of developers and users.
2
More processing on client device
Local-first apps offload a lot of primary read/write operations to the client device.
While most modern devices are more than capable of handling this, some older devices or devices with limited processing power may face faster battery drain.Basic’s sync engine is designed to be efficient in terms of processing power, and we regularly make optimizations to ensure that your app remains fast and responsive even as its data grows.