Skip to content

Feature request: Local-first / offline sync foundation #58

Description

@melodysdreamj

Summary

EdgeBase already has strong realtime and room primitives, but there is still a meaningful product gap around local-first application behavior.

The hard part here is not just persistence on the server. It is making the client experience feel native when the network is slow, flaky, or absent:

  • optimistic writes
  • local cache as the default read path
  • pending mutation queue
  • reconnect replay
  • conflict handling
  • snapshot restore
  • authoritative server reconciliation

This feels like a valuable next layer because many open-source pieces exist, but shipping a cohesive local-first developer experience still requires a lot of glue code.

Why this seems valuable

A lot of apps want some version of this:

  • mobile apps that must survive backgrounding and poor connectivity
  • collaboration flows that should stay responsive while reconnecting
  • dashboards and CRUD apps that want optimistic UX without ad-hoc merge bugs
  • apps that want retry/replay semantics without rebuilding them feature by feature

Today, developers often stitch together local storage, optimistic state, retry queues, cache invalidation, and realtime subscriptions by hand.

Important framing

This seems primarily like an SDK-first feature rather than a server-only feature.

The main value would likely live in client SDK behavior, with a supporting server contract underneath it.

Proposal

Add a local-first/offline sync foundation that can be adopted incrementally.

Client-side goals

  • local cache / persisted snapshot support
  • optimistic mutation application
  • pending mutation queue
  • retry and replay after reconnect
  • subscription-driven reconciliation with server state
  • hooks/events for pending, synced, conflicted, and failed states

Supporting server contract

  • stable version / sequence metadata
  • idempotency keys for mutations
  • snapshot + delta fetch support where appropriate
  • clear reconciliation semantics after reconnect
  • authoritative ack/error responses for queued writes

Possible first scope

Start with a small, composable surface instead of a full framework:

  • per-table or per-query local cache opt-in
  • optimistic insert/update/delete helpers
  • pending mutation persistence
  • reconnect replay with idempotency
  • conflict callback / resolution hooks

Why this fits EdgeBase

EdgeBase already has many of the ingredients:

  • realtime subscriptions
  • room/session reconnect behavior
  • edge-hosted authoritative backends
  • multi-platform client SDKs

What is missing is the productized layer that turns these ingredients into a consistent local-first developer experience.

Design notes

A good version would likely need:

  • opt-in behavior rather than always-on caching
  • clear persistence adapters per platform
  • strong defaults for optimistic reconciliation
  • explicit conflict surfaces instead of hidden magic
  • docs that separate "works offline" from "full local-first app architecture"

Nice outcome

This could make EdgeBase much more compelling for mobile and collaboration-heavy apps, while also reducing a lot of app-specific optimistic/reconnect glue code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions