SyncSolve API — Conflict Resolution Engine
Comprehensive suite for all causality & delta edge cases
Field-level LWW, Vector Clock causality & RFC 6902 Patch
Field-level JSON dot-path diffing minimizes payload transfers
Stateless, lightweight deterministic mathematical reconciliation
Vector clock causality graph math & recursive JSON delta patching
About the Project
SyncSolve API is a high-performance, stateless, mathematical conflict-resolution service designed for offline-first mobile applications, collaborative tools, and distributed databases. When multiple users or devices edit the same record offline and synchronize at different times, conflicts inevitably occur. SyncSolve acts as a pure deterministic engine that reconciles data collisions using distributed systems algorithms. Key Core Engines & Capabilities: 1. Last-Write-Wins (LWW) Engine (POST /api/v1/resolve/lww): Merges conflicting JSON payloads by timestamp at field-level granularity (e.g. User A updated title at 10:05, User B updated status at 10:06 -> keeps User A's title and User B's status). Handles nested JSON objects recursively with custom tie-breaker logic. 2. Vector Clock Causality Evaluator (POST /api/v1/resolve/vector): Uses version vectors (Va vs Vb) to mathematically evaluate causal relationships. Automatically selects the dominant state (200 OK) or detects simultaneous offline edits (Va || Vb) with no clear winner, returning an HTTP 409 Conflict response containing exact conflicting JSON dot-paths, delta diffs, and an LWW fallback proposal. 3. JSON Delta & RFC 6902 Patch Engine (POST /api/v1/diff & POST /api/v1/patch): Computes minimal bandwidth diffs between any two JSON documents. Generates structured deltas (added, updated, deleted fields with dot-notation paths) and standard RFC 6902 JSON Patch operation arrays (add, replace, remove). 4. Built-in Visual Dashboard UI: Includes a responsive, glassmorphic Web Dashboard hosted at the root route (/) allowing developers to interactively test conflict resolution algorithms, select pre-built payload presets, and visually inspect JSON diffs.
Challenges
Designing a stateless mathematical reconciliation engine capable of handling deeply nested JSON trees while maintaining strict determinism required fine-tuned recursion and tie-breaker handling. Distinguishing between true causal dominance and simultaneous concurrent updates required rigorous vector clock comparison logic to safely issue HTTP 409 Conflict states with structured diff payloads without data loss.
Learnings
Built with Python 3.11/3.14 and FastAPI + Pydantic v2, this project honed my skills in distributed systems algorithms, vector clock causality graphs, field-level CRDT-like delta patching (RFC 6902), and writing 100% covered Pytest suites for deterministic backend APIs.
Development Journey
Vector Clock Causality Evaluator
Implemented version vector comparison routines to evaluate causal dominance (Va > Vb) vs concurrency (Va || Vb) returning HTTP 409 Conflict payloads.
Recursive Last-Write-Wins Engine
Engineered recursive field-level JSON merging algorithms with timestamp comparison and deterministic client_id tie-breakers.
JSON Dot-Path Diff & Patch Generator
Built diff calculations generating minimal dot-notation change arrays and compliant RFC 6902 add/replace/remove operations.
FastAPI Web UI & Serverless Deployment
Created a responsive glassmorphic web dashboard for live payload testing and deployed the production service to Render.
