AV
Back to All ProjectsENGINEERING CASE STUDY // 04
Published Open Source SDKDelta-Diff MongoDB → Arweave Sync

fillblocks-client

Published TypeScript/JS SDK syncing MongoDB collections to Arweave using delta diff detection (uploading only modified records), CRON scheduling, and CPU/memory telemetry.

NPM PackageNode.jsTypeScript
Role & Ownership

Package Author & Maintainer

Category

Published Open Source SDK

Target Platforms

NPM Package · Node.js · TypeScript

Key Outcome

Delta-Diff MongoDB → Arweave Sync

LIVE FLOW PLAYBACK
Animated Package Execution FlowSTEP 1 / 5
SDK Initialization & Scheduled Sync
example.ts
import { FillBlocksClient } from "fillblocks-client";

const client = new FillBlocksClient({
  mongoUri: process.env.MONGO_URI!,
  collections: ["students", "fee_receipts"],
  cron: "0 */6 * * *",
  telemetry: true,
});

await client.startSync();
Animated Runtime & Telemetry Outputstdout // live stream
[fillblocks:cron] Triggered scheduled archival cycleDONE
[fillblocks:mongo] Connected & indexed 2 collectionsWAIT
[fillblocks:diff] Unchanged skipped -> uploading modified records onlyWAIT
[fillblocks:arweave] Committed delta batch to decentralized storageWAIT
[fillblocks:telemetry] Sampled process CPU & memory usage | cycle completeWAIT

01 // Problem Statement

Archiving full MongoDB collections to decentralized Arweave storage on every backup cycle wastes bandwidth, compute, and permanent storage costs.

02 // Solution & Architecture Strategy

Published a TypeScript/JS SDK that computes record-level delta diffs, uploads only modified documents to Arweave on a CRON schedule, and emits process CPU and memory telemetry—deployed in production archival backups for PhilBlocks.

03 // Key Engineering Decisions

  • Implemented deterministic delta diff detection so only newly modified MongoDB records upload to Arweave.
  • Built-in CRON scheduling automates unattended decentralized archival runs.
  • Added CPU and memory telemetry instrumentation to track synchronization resource footprint.

04 // Architectural Trade-offs & Outcomes

Challenge

Full collection snapshots repeatedly pay Arweave upload costs for unchanged documents.

Decision

Added deterministic hash/delta comparison against the previous sync checkpoint before serialization.

Verified Outcome

Only newly created or modified records hit Arweave storage.

Challenge

Silent background CRON jobs can spike Node.js memory on large collections.

Decision

Instrumented per-run CPU & heap/RSS telemetry output inside the SDK lifecycle.

Verified Outcome

Operators observe exact runtime footprint after every scheduled sync.

SYSTEM ARCHITECTURE // ANIMATED WORKFLOW

Incremental MongoDB → Arweave Sync Loop

STAGE 1 / 5

CRON-triggered Node.js SDK scans MongoDB collections, detects delta diffs, uploads only modified records to Arweave, and emits CPU/memory telemetry.

  1. [1]CRON scheduler invokes MongoDB collection synchronization at configured intervals.
  2. [2]Delta diff engine isolates only records modified since the previous checkpoint.
  3. [3]Modified records commit permanently to Arweave decentralized storage.
  4. [4]SDK logs CPU and memory telemetry metrics for operational monitoring.