Architecture & Transaction Guarantees
Deterministic two-way replication protocol between client outboxes and PocketBase sync_changes journal. Built for zero-loss offline runtimes with explicit sequence monotonicity.
Local embedded persistent storage with immediate optimistic rendering and transactional mutation outbox.
Intercepts mutations, assigns immutable client UUIDs, manages backoff queues, and hydrates downstream patches.
UUID, op, delta.Stateless transport pipeline managing deduplication, partial batch retries, and realtime invalidation nudges.
Idempotent batch transaction with client mutation UUIDs. PocketBase ignores previously applied sequence hashes.
High-efficiency retrieval of committed server changes since client's last verified authoritative monotonic sequence.
Thin lightweight wake ping. PocketBase alerts connected clients that mutations arrived: client fires pull. No data in SSE payload.
Go-based runtime embedding native SQLite transactions with synchronous change journaling hooks.
Hooks into PocketBase DAO lifecycle: intercepts OnModelBeforeCreate/Update/Delete.
Every mutation (client push, standard PocketBase REST API, or PocketBase Admin UI) is captured in the same transaction as the data write. If the write aborts, no sync entry is recorded. If it commits, replays are strictly deduplicated by the engine runtime.
Deliberate Architectural Boundaries
To maintain extreme determinism and zero-edge corruption in early versions, complex distributed consensus modes are explicitly deferred.
Shared / Multi-User Write Records
Strictly per-user record ownership. Documents belong to exactly one user partition. Collaborative real-time document co-authoring is explicitly out of scope for v0.1.
File & Binary Content Sync
Large media and binary blobs do not travel through the mutation outbox or sync_changes table. Handled independently via signed direct upload URLs.
Operation Mutations / Distributed Counters
No delta math operators like INCREMENT(likes, 1). The protocol synchronizes state values, not operational execution logic.
Complex CRDT Trees (Yjs / Automerge)
Deterministic Last-Write-Wins (LWW) field patch evaluation chosen deliberately for absolute code simplicity and transparent SQLite column inspection.
Custom Server-Side Merge Handlers
No complex three-way interactive merge UI on the host. PocketBase acts as an immutable sequence log and authoritative rev assigner.
Running PocketBase Binaries on Edge Devices
PocketBase runs on your server. Mobile/Web clients run tiny SQLite or IndexedDB adapters via standard TypeScript SDKs, not compiled Go binaries.
Protocol Specifications & Interface Definitions
Wire Protocol & Change Journal Schema
Complete wire spec defining HTTP endpoints, error envelope schemas, JSON patch formatting (RFC-6902 subset), and monotonic cursor pagination semantics.
PocketBase Plugin & SQLite Hook Internals
Deep architectural breakdown of the Go plugin implementation, SQLite transaction hooks, WAL mode locking guarantees, and outbox reconciliation lifecycles.