Building Software That Works Without the Cloud
Introduction: The End of Always-On Software
- When the Cloud Goes Away
- What Local First Actually Means
- Why This Book Exists
Chapter 1: Foundations and the Evolution from Offline-First to Local-First
- The Evolution of Offline Support
- Offline First Versus Local First
- Edge Computing and Distributed Systems
- Peer-to-Peer Architectures
- Why Now: Latency, Privacy, and Resilience
Chapter 2: Local Data Ownership and Embedded Databases
- The Primacy of Local Data
- SQLite: The World’s Most Deployed Database
- Alternatives and Specialized Stores
- Browser Storage and IndexedDB
- Designing Your Local Schema
Chapter 3: Building the Core Application Locally
- Project Setup and Architecture Decisions
- The Local Data Model
- CRUD Operations Without a Server
- Optimistic Updates and Immediate Feedback
- Testing the Offline Experience
Chapter 4: Synchronization Fundamentals
- What Synchronization Actually Is
- The Conflict Problem
- Consistency Models in Practice
- Designing a Sync Protocol
Chapter 5: Conflict Detection and Resolution
- Types of Conflicts
- Last-Write-Wins and Its Pitfalls
- Version Vectors and Causal Ordering
- Tombstones and Logical Deletion
- Idempotent Operations
Chapter 6: Conflict-Free Replicated Data Types (CRDTs)
- The Mathematics of Convergence
- State-Based Versus Operation-Based CRDTs
- Common CRDT Types
- Yjs: A Practical CRDT Engine
- Automerge and Document-Oriented CRDTs
- When CRDTs Help and When They Do Not
Chapter 7: Event Sourcing, Operational Transformation, and Alternatives
- Event Sourcing Basics
- Operational Transformation Explained
- OT Versus CRDTs
- Hybrid Approaches
- Choosing Your Concurrency Model
Chapter 8: Multi-Device Synchronization in Practice
- Architecture of a Sync Backend
- Change Streams and Incremental Sync
- Durable Queues for Reliable Delivery
- Background Synchronization
- Connectivity Detection and Retry Strategies
- Handling Partial Failures
Chapter 9: Peer-to-Peer Communication and Real-Time Collaboration
- Direct Device-to-Device Communication
- WebRTC for Local-First Applications
- Mesh Networks and Gossip Protocols
- Real-Time Presence and Cursors
- Trade-offs of Pure P2P
Chapter 10: Security, Encryption, and Privacy
- Authentication Without a Central Authority
- End-to-End Encryption for Local Data
- Key Management and Rotation
- Secure Sharing and Access Control
- Privacy by Design
Chapter 11: Platform-Specific Implementation Details
- Web Applications and Service Workers
- Desktop Applications
- Mobile Platforms
- Edge Runtimes and WASM
- Cross-Platform Data Sharing
Chapter 12: Testing, Debugging, and Observability
- Testing Offline Behavior
- Simulating Network Partitions
- Testing Synchronization Correctness
- Debugging Distributed State
- Observability Without the Cloud
Chapter 13: Operations, Performance, and Production Deployment
- Storage Management and Cleanup
- Caching Strategies
- Schema Evolution and Migrations
- Backup and Recovery
- Performance Optimization
- Deployment Patterns
Chapter 14: Hybrid Architectures and When the Cloud Is Optional
- The Hybrid Philosophy
- Cloud-Assisted Discovery and Coordination
- Optional Backup Layers
- Technology Landscape Overview
- Architectural Decision Framework
Conclusion: Designing for Resilience
- The Local First Checklist
- What We Have Learned
- The Future of Offline-Native Software
References
- Official Documentation
- CRDT Libraries and Projects
- Local-First Frameworks and Sync Engines
- Foundational Papers and Articles
- Books
- Distributed Systems Concepts
- Technical Articles and Resources
- Verification and Testing Research
- Industry and Community