Skip to main content

Bench Datastore

@webframp/bench-datastorev2026.07.24.1· 1d agoMODELSWORKFLOWS
01README

Datastore benchmarking harness for swamp. Two workflow-based test scenarios that exercise any swamp datastore backend under sustained load without lock contention.

Scenario A: Throughput (breadth)

Each worker owns isolated models. Cycles through write → read → query operations measuring per-step latency. Tests: sync push/pull speed, chunked storage, GSI queries, workflow overhead.

Scenario B: Write Stress (depth)

Each worker owns one model, writes continuously with varying payload sizes. Tests: sustained single-writer throughput, version accumulation, chunked vs inline performance, hot-partition behavior.

Usage

swamp extension pull @webframp/bench-datastore

# Create harness instance for worker 1 (throughput scenario)
swamp model create @webframp/bench-datastore/harness bench-harness-w001 \
  --global scenario=throughput --global worker_id=1 --global models_per_worker=50

# Setup (creates worker-owned models)
swamp model method run bench-harness-w001 setup

# Run throughput cycle once
swamp workflow run @webframp/bench-throughput-cycle \
  --input harness_model=bench-harness-w001 \
  --input probe_model=bench-probe-w001 \
  --input iteration=1

# Run write-stress once
swamp workflow run @webframp/bench-write-stress \
  --input harness_model=bench-harness-w001 \
  --input probe_model=bench-probe-w001 \
  --input iteration=1

Both workflows are designed to be called in a tight loop by an ECS Fargate worker or local script. Duration is controlled by the caller.

02Release Notes

2026.07.24.1

Added: Initial release of the datastore benchmarking harness.

  • Two workflow-based scenarios: throughput (breadth) and write-stress (depth)
  • Zero lock contention by construction — each worker owns isolated models
  • Backend-agnostic measurement of datastore I/O independent of swamp core locking
  • Configurable at runtime via workflow inputs (scenario, worker count, duration controlled by caller)
  • Deployable on ECS Fargate or runnable locally
  • Payload delivery uses stdin streaming via temp files to avoid Linux MAX_ARG_STRLEN (131072 bytes) limit on large (500KB) write-stress payloads
  • Probe measurements in workflows are scoped to the worker's harness model via --model filter to prevent cross-worker data inflation under concurrent load
  • payload_size accepted as an optional workflow input on bench-write-stress for controlled single-size runs
03Models1
@webframp/bench-datastore/harnessv2026.07.24.1harness.ts
fn setup()
Create the required models for this worker's scenario. Idempotent — safe to re-run.
fn execute()
Run a single iteration of the configured scenario. Returns timing data.

Resources

setup(infinite)— Setup result — models created for this worker.
result(infinite)— Single iteration execution result with timing data.
04Workflows2
@webframp/bench-throughput-cycled1a2b3c4-e5f6-7890-abcd-ef1234567890

Single iteration of the throughput benchmark. Executes one model method (rotated by iteration), then reads back the data and checks datastore health. Designed to be called in a tight loop by an ECS worker. Measures: write latency, read latency, datastore health, and workflow orchestration overhead.

writeExecute a model method (write operation with sync push).
1.run-method${{ inputs.harness_model }}.execute— Run the harness execute method for one throughput iteration.
readRead back data to measure sync pull latency.
1.data-search${{ inputs.probe_model }}.execute— Search recent data scoped to the harness model.
healthDatastore health check (round-trip latency).
1.status${{ inputs.probe_model }}.execute— Check datastore connectivity and latency.
@webframp/bench-write-stressa9b8c7d6-e5f4-4210-aedc-ba0987654321

Single iteration of the write-stress benchmark. Writes a payload of configured size to the worker's model, then reads it back to verify. Designed to be called in a tight loop with no sleep between iterations. Payload sizes rotate: small (100B), medium (10KB), large (500KB+). Large payloads exercise the chunked storage path. Measures: write throughput, chunk handling, version accumulation, read-after-write latency, sustained single-writer performance.

writeWrite a payload to the worker's single model.
1.execute-write${{ inputs.harness_model }}.execute— Run the harness execute method for one write-stress iteration.
verifyRead back the written data to confirm integrity.
1.read-back${{ inputs.probe_model }}.execute— Search recent data scoped to the harness model to verify write.
05Stats
A
100 / 100
Downloads
0
Archive size
9.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels