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.
Package Author & Maintainer
Published Open Source SDK
NPM Package · Node.js · TypeScript
Delta-Diff MongoDB → Arweave Sync
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();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.
Incremental MongoDB → Arweave Sync Loop
CRON-triggered Node.js SDK scans MongoDB collections, detects delta diffs, uploads only modified records to Arweave, and emits CPU/memory telemetry.
- [1]CRON scheduler invokes MongoDB collection synchronization at configured intervals.
- [2]Delta diff engine isolates only records modified since the previous checkpoint.
- [3]Modified records commit permanently to Arweave decentralized storage.
- [4]SDK logs CPU and memory telemetry metrics for operational monitoring.