Skip to main content

S3 Datastore

@swamp/s3-datastorev2026.09.10.2· 4d agoDATASTORES
01README

Store data in an Amazon S3 bucket with local cache synchronization. Provides distributed locking via S3 conditional writes with exponential backoff under contention and bidirectional sync between a local cache directory and S3. Emits OpenTelemetry spans for S3 operations, lock acquisition/release, and push/pull sync so datastore activity is visible in traces when a TracerProvider is configured. Features shard-first indexing with per-model/per-workflow partition shards under _index/ as the source of truth (v2 repos skip the monolithic index upload entirely), commitSeq-based zero-diff fast path, two-phase sync to narrow the global-lock critical section, SHA-256 content hashing, per-path dirty tracking, namespace-scoped sync for multi-repo shared datastores, configurable transfer concurrency, configurable per-request timeout, and managed config refresh for pulling config partitions from the datastore.

Authentication

Uses the default AWS credential chain — no credentials in config. Provide credentials via one of:

  • Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • AWS profile: ~/.aws/credentials
  • IAM role attached to the instance or task

Required IAM Permissions

  • s3:GetObject (authorizes GetObject, HeadObject)
  • s3:PutObject
  • s3:DeleteObject
  • s3:ListBucket (authorizes ListBucket, HeadBucket)

Usage

swamp datastore setup @swamp/s3-datastore \
  --config '{"bucket": "my-bucket", "prefix": "swamp", "region": "us-east-1"}' --json

S3-Compatible Endpoints

Supports S3-compatible services (MinIO, DigitalOcean Spaces, etc.) via the endpoint and forcePathStyle config options.

02Datastores1
Amazon S3configurable
@swamp/s3-datastores3.ts

Store data in an Amazon S3 bucket with local cache synchronization.

Config Fields

FieldTypeDescription
bucketstringS3 bucket name
prefix?stringKey prefix within the bucket
region?stringAWS region (defaults to environment/credentials)
endpoint?stringCustom S3-compatible endpoint URL (e.g., https://nyc3.digitaloceanspaces.com)
forcePathStyle?booleanUse path-style addressing (bucket in path, not subdomain). Default: false
pullConcurrency?numberMaximum concurrent S3 downloads during pull. Default: 50
pushConcurrency?numberMaximum concurrent S3 uploads during push. Default: 25
requestTimeoutMs?numberPer-request timeout in milliseconds. Default: 30000.
03Previous Versions19
2026.09.10.1
2026.09.10.0
2026.09.08.1
2026.09.06.1
2026.09.03.1
2026.08.31.1
2026.08.31.0
2026.08.28.1
2026.08.27.3
2026.08.27.2
2026.08.27.1
2026.08.26.1
2026.08.25.2
2026.08.25.1
2026.08.12.1
2026.08.07.1
2026.07.31.1
2026.07.30.2
2026.07.30.1
04Stats
A
100 / 100
Downloads
101,004
Archive size
404.6 KB
Verified by Swamp
  • 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
05Platforms
06Labels