A

Hybrid Local-First E-Commerce: Reconciling Offline Capability with Strict Data Consistency

Zenodo (CERN European Organization for Nuclear Research)

Abstract

The architectural evolution of mobile e-commerce has historically relied on server-centric models that remain vulnerable to network volatility and latency. While the "Local-First Software" paradigm offers a compelling alternative by relocating data and computational authority to the client device, its adoption in retail faces significant hurdles. Specifically, the "Invariant Problem" and strict financial regulations (e.g., PSD2) complicate this approach. Standard local-first data structures, such as Conflict-Free Replicated Data Types (CRDTs), excel at structural convergence but struggle to enforce the strict semantic consistency and server-authoritative gatekeeping required for rivalrous inventory and secure checkout. This thesis investigates the architectural viability and performance trade-offs of applying a hybrid local-first paradigm to e-commerce. Following the Design Science Research (DSR) methodology, a "Three-Pillar" software artifact was designed and instantiated. By decomposing consistency requirements through the lens of the PACELC framework, the architecture applies a highly available, optimistic read-path for catalog browsing and collaborative cart management using locally-reactive replication (ElectricSQL) and CRDTs (Yjs). Conversely, it enforces strict serializability for checkout operations via a synchronous, server-authoritative RPC write-path (tRPC), unified by a Command-Query Responsibility Segregation (CQRS) reconciliation loop. The artifact was empirically benchmarked against an industry-standard SSR-Hydrated SPA across varying network conditions, hardware profiles, and dataset sizes. The evaluation reveals a paradigm shift in systemic bottlenecks. The hybrid architecture neutralizes network latency during active navigation and provides robust offline autonomy, but relocates the computational burden heavily onto the client device's CPU and memory. While the local-first approach outperforms the SSR-SPA baseline under degraded network conditions, it imposes a severe initial synchronization penalty and degrades performance on constrained hardware. Crucially, the CQRS-driven hybrid design resolves the tension between optimistic offline availability and transactional integrity, blocking semantic conflicts without requiring complex client-side formal verification. Ultimately, the findings validate that a hybrid consistency model can reconcile local-first principles with the strict constraints of digital retail. However, due to the high initial data payload and reliance on client-side processing, this architecture is currently most viable for B2B commerce and industrial field operations, offering a pragmatic compromise between seamless edge responsiveness and authoritative transactional security. Keywords: Local-First, E-Commerce, Distributed Systems, CRDT, PACELC, CQRS, DSR

Authors 1

  1. Simon Felix Conrad corresponding Aachen

    FH Aachen

    Affiliation as printed

    FH Aachen

Cited by 0 stored of 0

No patents citing this paper on Lens.org (checked 2026-10-06).

References 0