Skip to main content
S2 Lite is configured through command-line arguments and environment variables. This guide covers all available configuration options.

Command-Line Arguments

Storage Options

string
S3 bucket name for object storage backend. If not specified, uses in-memory storage (unless --local-root is set).
string
Local filesystem directory for storage. Conflicts with --bucket.
Local filesystem mode does not provide the same durability guarantees as object storage.
string
default:""
Base path prefix within object storage. Allows multiple instances to share a bucket.

Network Options

integer
Port to listen on. Defaults to 443 if TLS is enabled, otherwise 80.
boolean
default:"false"
Disable permissive CORS headers. By default, S2 Lite allows browser-based clients from any origin.

TLS Options

boolean
default:"false"
Use a self-signed certificate for TLS. Useful for development and testing.
Clients will need to use --insecure or configure SSL verification to trust self-signed certificates.
string
Path to TLS certificate file (e.g., cert.pem). Must be used with --tls-key.
string
Path to TLS private key file (e.g., key.pem). Must be used with --tls-cert.

Initialization Options

string
Path to JSON file defining basins and streams to create at startup. Can also be set via S2LITE_INIT_FILE environment variable.
See Init File Format below for details.

Environment Variables

S2 Lite Configuration

string
Path to initialization file. Alternative to --init-file.
boolean
default:"false"
Enable append pipelining for improved performance against high-latency object storage.
Pipelining is currently disabled by default for safety. It will be enabled by default in a future release after further testing.
When enabled, S2 Lite pipelines up to 25 MiB of appends.

AWS Configuration

string
AWS access key ID for S3 authentication.
string
AWS secret access key for S3 authentication.
string
AWS region for S3 bucket.
string
Custom S3 endpoint URL. Required for S3-compatible services like MinIO, Tigris, or Cloudflare R2.
string
AWS profile name from ~/.aws/credentials.

SlateDB Configuration

S2 Lite uses SlateDB as its storage engine. Configure SlateDB using SL8_ prefixed environment variables. See the SlateDB Settings reference for all available options.
duration
Interval at which to flush writes to object storage.Defaults:
  • 50ms for S3 bucket
  • 5ms for in-memory or local filesystem
Lower values reduce latency but increase object storage API calls. Higher values improve throughput but increase latency.
duration
Interval at which to poll for manifest updates. Used for fencing out previous instances.
integer
Number of L0 SSTables before triggering compaction.

Logging Configuration

string
default:"info"
Logging level configuration. Supports module-level filtering.
Available levels: error, warn, info, debug, trace

Init File Format

The init file is a JSON document that defines basins and streams to create at startup. It uses create-or-reconfigure semantics, making it safe for repeated restarts.

Schema

schema.json

Example

resources.json

Field Reference

Basin Config

boolean
Automatically create streams on append if they don’t exist, using the default stream configuration.
boolean
Automatically create streams on read if they don’t exist, using the default stream configuration.
object
Default configuration for auto-created streams in this basin.

Stream Config

string
Storage class for recent writes.Options:
  • standard - Standard S3 storage
  • express - S3 Express One Zone (ultra-low latency)
string
Retention policy for the stream.Options:
  • infinite - Retain records indefinitely
  • Duration string - Auto-trim older records (e.g., 7days, 24hours, 1week)
Duration formats:
  • 1day, 7days, 30days
  • 1hour, 24hours
  • 1week, 2weeks
  • 1min, 30mins
object
Timestamping behavior for appends.
string
Timestamping mode.Options:
  • client-prefer - Use client timestamp if provided, otherwise arrival time
  • client-require - Require client timestamp (reject if not provided)
  • arrival - Always use server arrival time
boolean
Allow client-specified timestamps to exceed arrival time. If false, client timestamps are capped at arrival time.
object
Delete-on-empty configuration.
string
Minimum age before an empty stream can be deleted automatically. Set to 0 (or omit) to disable auto-deletion.

Performance Tuning

Flush Interval

The most important performance knob is SL8_FLUSH_INTERVAL:
  • Lower values (10-50ms): Lower latency, higher API call costs
  • Higher values (100-500ms): Higher throughput, lower costs, higher latency

Pipelining

Enable pipelining for better performance with high-latency object storage:
This allows up to 25 MiB of appends to be in-flight simultaneously.

Storage Class

Use S3 Express One Zone for ultra-low latency:
S3 Express requires an Express One Zone bucket (ending in --x-s3).

Example Configurations

Development (In-Memory)

Production (S3 with IAM)

Tigris with Static Credentials

Local Filesystem

Next Steps

Deployment

Deploy S2 Lite to production

Monitoring

Set up monitoring and alerts