person
Home/Documentation
Architecture Spec v2.4

Platform Architecture & Reference

DataForge combines browser-isolated Rust WebAssembly threads with an acyclic directed graph (DAG) solver to generate relational data with zero network egress.

Core Engine·Thread Isolation

1. WebAssembly Execution Engine

DataForge compiles its core pseudo-random generators and relational solvers from Rust into optimized 64-bit WebAssembly bytecode. By spawning dedicated Web Workers, the browser thread executes without DOM-blocking latency.

// Initialize client WASM runtime worker
import { initForgeEngine } from '@dataforge/wasm-runtime';

const engine = await initForgeEngine({
  seed: 'seed_8941_prod',
  zeroTelemetry: true,
  memoryAllocMb: 128
});
Algorithms·Foreign Keys

2. Relational DAG Solver

Synthetic schemas with inter-table foreign keys are modeled as Directed Acyclic Graphs (DAGs). Topological sorting determines the exact insertion order to prevent orphan records or referential constraint breaches.

  • 1:1 Relationships: Coordinated primary key derivation.
  • 1:N Parent-Child: Bounded Poisson sampling of child rows per parent ID.
  • N:M Polymorphic Join: Synthetic junction mapping with unique composite indexing.
Statistics·Empirical Curves

3. Empirical Statistical Distributions

To prepare database query optimizers and machine learning models for genuine production anomalies, generated numerical values adhere to configurable probability densities:

Gaussian NormalBiometrics, sensor telemetry, body temperatures (μ, σ).
Pareto (Power-Law)E-commerce order totals, revenue, customer lifetime value (α).
Weibull HazardSubscription churn events, hardware failure lifetimes (k, λ).
Automation·CI/CD Runner

4. CLI & CI/CD Pipeline

Seed local Docker databases before running integration tests with Cypress or Playwright. Install the lightweight CLI runner:

# Install globally or as dev-dependency
npm install -g @dataforge/cli

# Run deterministic database seeding
dataforge generate \
  --schema ./schemas/b2b-billing.json \
  --count 10000 \
  --format sql \
  --output ./seed.sql