Mohamed KEITA

CortexDB v5

Replication, offline synchronization, and mobile or edge support.

1. Overall Vision of V5

V5 transforms CortexDB into a lightweight distributed engine with replication, offline sync, and mobile support. It is divided into three sub-versions:

  • V5.1: Replication Core (leader or follower, WAL-based, catch-up, idempotence)
  • V5.2: Offline Sync and Conflict Resolution (offline mode, CRDT-lite, vector clocks)
  • V5.3: Mobile and Edge (Android or iOS SDK, edge edition, optimizations)

Main objectives:

  • Enable replication between instances
  • Support offline-first mobile applications
  • Provide automatic conflict resolution
  • Allow deployment on edge devices

2. V5 Structure

V5.1 — Replication Core

Features:

  • Asynchronous leader or follower replication
  • WAL-based replication
  • Automatic catch-up
  • Guaranteed idempotence
  • Source order preserved

V5.2 — Offline Sync and Conflict Resolution

Features:

  • Offline mode with operation queue
  • Incremental synchronization
  • CRDT-lite (LWW plus simple merge)
  • Simplified vector clocks
  • Sync API

V5.3 — Mobile and Edge

Features:

  • Android SDK
  • iOS SDK
  • Edge edition for constrained devices
  • Battery and memory optimizations
  • Intelligent auto-sync

3. V5 Non-Goals

  • No sharding (V7)
  • No full distributed consensus (V7)
  • No distributed transactions (V7)
  • No full multi-master
  • No synchronous replication

4. V5 Architecture Overview

┌─────────────┐         ┌─────────────┐
│   Leader    │────────▶│  Follower   │
│  (Primary)  │  sync   │  (Replica)  │
└─────────────┘         └─────────────┘
      │                        │
      │                        │
      ▼                        ▼
┌─────────────┐         ┌─────────────┐
│  Mobile App │◀───────▶│  Edge Node  │
│  (Offline)  │  sync   │  (Offline)  │
└─────────────┘         └─────────────┘

5. Write Model

5.1. Principle

Clarification of the write model for replication and offline sync.

5.2. Rules

  • Leader or Server: the only global writer when online
  • Offline nodes: temporary local writers
  • Reconciliation at sync: conflicts resolved during synchronization
  • No permanent multi-master: offline is temporary, sync restores consistency

5.3. Flow

  1. The leader accepts all writes as the global writer
  2. Offline nodes accept local writes as temporary writers
  3. Sync reconciles conflicts according to the configured strategy
  4. Consistency is restored after synchronization

6. V5 Objective

At the end of V5 (V5.1 + V5.2 + V5.3), CortexDB becomes:

  • Distributed: replication and sync operational
  • Offline-first: full support for offline applications
  • Mobile-ready: Android and iOS SDKs available
  • Edge-ready: Edge edition for constrained devices

This is the version that makes CortexDB suitable for modern offline-first and mobile applications.