<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhishektegur</title>
    <description>The latest articles on DEV Community by Abhishektegur (@abhishektegur).</description>
    <link>https://dev.to/abhishektegur</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3981796%2Fc6cef621-a7ed-4bb8-8b9a-b335523755c9.jpeg</url>
      <title>DEV Community: Abhishektegur</title>
      <link>https://dev.to/abhishektegur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishektegur"/>
    <language>en</language>
    <item>
      <title>Building VeloSync: A Zero-Dependency, Offline-First Vector Sync Engine in Python</title>
      <dc:creator>Abhishektegur</dc:creator>
      <pubDate>Fri, 12 Jun 2026 18:42:59 +0000</pubDate>
      <link>https://dev.to/abhishektegur/building-velosync-a-zero-dependency-offline-first-vector-sync-engine-in-python-c0p</link>
      <guid>https://dev.to/abhishektegur/building-velosync-a-zero-dependency-offline-first-vector-sync-engine-in-python-c0p</guid>
      <description>&lt;p&gt;To learn more about database replication and distributed systems, I designed VeloSync: an offline-first vector database synchronization engine written in pure Python. I used AI to assist in writing and organizing the codebase.&lt;/p&gt;

&lt;p&gt;The system runs a local SQLite store on edge devices, performs vector search locally, and bidirectionally synchronizes updates with a FastAPI master server over HTTP.&lt;/p&gt;

&lt;h3&gt;
  
  
  System Architecture &amp;amp; Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local Storage &amp;amp; Search&lt;/strong&gt;: Saves AI vector embeddings locally in SQLite as packed float64 BLOBs (via the Python &lt;code&gt;struct&lt;/code&gt;module) and performs exact Cosine Similarity search offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replication Log&lt;/strong&gt;: Tracks every local edit using a Write-Ahead Log (WAL) and Log Sequence Numbers (LSN).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI Server&lt;/strong&gt;: Ingests push payloads over HTTP, verifies integrity checksums, and uses version vector clocks to causally resolve concurrent edit conflicts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log Compaction&lt;/strong&gt;: Compacts offline changes locally before replication to minimize network bandwidth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Echo Suppression&lt;/strong&gt;: Ensures devices do not receive their own pushes back during pull cycles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building this provided hands-on experience with database transactions, version vector clocks, and preventing replication loops in distributed databases.&lt;/p&gt;

&lt;p&gt;The source code and system architecture details are available on my GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Abhishektegur" rel="noopener noreferrer"&gt;
        Abhishektegur
      &lt;/a&gt; / &lt;a href="https://github.com/Abhishektegur/velosync-engine" rel="noopener noreferrer"&gt;
        velosync-engine
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A zero-dependency Python database sync engine that replicates vector embeddings between SQLite on edge devices and a central FastAPI server.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;VeloSync ⚡&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;VeloSync is a &lt;strong&gt;zero-dependency, offline-first vector database synchronization engine&lt;/strong&gt; written in Python. It is designed for edge environments (mobile phones, IoT nodes, embedded devices) that need to perform fast local vector searches on SQLite and synchronize mutations bidirectionally with a central cloud database over HTTP.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;System Architecture&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;         +----------------------------------+          +----------------------------------+
         |     Device A (edge-phone-01)     |          |    Device B (edge-tablet-07)     |
         +----------------------------------+          +----------------------------------+
          | SQLite DB |   | Logical WAL log |           | SQLite DB |   | Logical WAL log |
          +-----------+   +-----------------+           +-----------+   +-----------------+
                      \       /                                     \       /
                    (HTTPSyncEngine)                                (HTTPSyncEngine)
                        \   /                                           \   /
                         v v                                             v v
                   POST /sync (Replicate)                          POST /sync (Replicate)
                   POST /ack  (Commit)                             POST /ack  (Commit)
                         \   /                                           \   /
                          \ /                                             / /
                           v                                             v
                 +-------------------------------------------------------------+
                 |                     FastAPI HTTP Server                     |
                 +-------------------------------------------------------------+
                 |                Master Store (server_store.db)               |
                 +-------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Key Components&lt;/h3&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Local Edge Storage (&lt;code&gt;client.py&lt;/code&gt;)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;A SQLite file database on the device…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Abhishektegur/velosync-engine" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;I would appreciate any feedback on the design decisions, SQLite integration, or suggestions on what database internals or distributed algorithms I should study next.&lt;/p&gt;

</description>
      <category>python</category>
      <category>showdev</category>
      <category>database</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
