Skip to content

Operations: containers + S3

The operational story for EvidentSource is intentionally small: a container for the runtime, object storage for durability. No relational database to tune, and no coordination service to run.

This page walks through what each piece does, why it’s enough, and how to run it.

One Rust binary, packaged as a container image. It serves:

  • HTTP on port 3000: the API and the browser UI;
  • gRPC on port 50051;
  • the WebAssembly runtime that runs your State Changes and State Views;
  • the write path, which commits each database’s transactions.

The same binary runs the MCP server as a separate process, on port 3001, in front of the HTTP API. See MCP API.

SlateDB is a storage engine that persists to object storage. It’s how EvidentSource gets durable writes without a separate database tier.

In production that means Amazon S3. The AWS Marketplace template also puts SlateDB’s write-ahead log on S3 Express One Zone, in an Availability Zone you choose, which should be the one your servers run in, for lower write latency.

There is no required:

  • relational database;
  • cache or coordination service, such as ZooKeeper, etcd or Consul.

Kafka is needed only if you use async commands.

Durable state lives in object storage, not on the container. A server can be replaced at any time; its replacement reads the database back from storage and carries on.

Servers are interchangeable. Run several, and each database’s writes go to one of them at a time, its writer, which the servers choose among themselves. If a writer goes away, another server takes over its databases.

The log is already durable. Nothing has to be replicated into a second system to be safe, so a consumer can read the same object storage the server writes. See Kafka streaming for getting events onto a broker when you want them there.

Terminal window
docker run -d -p 3000:3000 -p 50051:50051 evidentsource/evidentsource-dev:0.8.38@sha256:16c279e5dee4a1b0e3951067ed871040251266fd1d7404554744b31b04bbbc69 \
server --scheme http --dev --node-id node-1 --writer memory

This keeps everything in memory, so data is lost when the container stops, and needs no cloud setup. The arguments matter:

  • memory selects in-memory storage. The explicit arguments make this pinned release independent of image defaults; S3 storage requires its own backend arguments and AWS credentials.
  • --writer makes this lone server the writer for its databases. Without it, every write is refused.

Releases after 0.8.38 replace --writer with --role (EVIDENTSOURCE_ROLE), and refuse --writer at startup:

  • --role both is what --writer means here: the server writes its databases and serves clients.
  • --role writer writes databases and serves no client API; its HTTP port answers health checks only.
  • --role peer, the default, serves clients and sends writes to a server that writes. A lone peer refuses every write.

Then open http://localhost:3000, or set up the TodoMVC example against it.

Deploy through the AWS Marketplace listing. Its CloudFormation template stands up an ECS service, a load balancer, the S3 buckets, IAM roles and logging, in a VPC you already have. See AWS Marketplace deployment.

The server’s HTTP port answers two probes:

  • /health/ready answers 200 once the server is ready for traffic, and 503 until then. Route traffic on it.
  • /health answers 200 while the process is alive. Use it only to decide whether to restart the container.

Keep the two apart: a server opens its databases from object storage before it serves them, which a slow store can stretch to minutes, and /health stays 200 throughout. In releases after 0.8.38 the port answers from the moment the server starts: /health is 200, /health/ready is 503, and any other path is a retryable 503 with Retry-After until the server is ready. The Marketplace template’s load balancer already routes on /health/ready.

  • Manage schema migrations
  • Tune a database for transactional workloads
  • Operate ZooKeeper
  • Build a change-data-capture pipeline to get events out
  • Design shard keys: each database is its own unit of write partitioning
  • Monitor the servers. They emit OpenTelemetry metrics and traces; the Marketplace template runs a collector alongside them that sends traces to AWS X-Ray and metrics to CloudWatch.
  • Size them for your workload. See Tuning and AWS Marketplace deployment.
  • Decide your retention for the S3 buckets.
  • Configure authentication and authorization. See Security.
  • Repair a lifecycle file if one becomes unreadable. See below.

Each database name has one lifecycle file, databases/<name>/root.json under your storage prefix in the data bucket (EVIDENTSOURCE_S3_BUCKET). It names the name’s current database by its database ID. If the file is corrupt, or has a format_version this server doesn’t read, the server refuses to guess: the name can be neither created nor deleted, and its storage is not reclaimed. The server logs an error naming the file, with a reason field that tells the two cases apart. API clients see only that the database’s lifecycle file is unreadable. Nothing repairs it automatically.

  1. An unknown format_version was written by another release, normally a newer one. Run that release again rather than editing the file: overwriting it discards that release’s state.
  2. List the name’s database roots: the directories under databases/<name>/ named by a database ID, in the data bucket and, if you set one, the WAL bucket (EVIDENTSOURCE_WAL_BUCKET).
  3. Choose the database ID to keep from evidence, not from the directory listing alone. When the server opens a database it logs its storage path, which contains databases/<name>/<database-id>/, and a database with Kafka has topics named for its ID (see Kafka prerequisites). The newest ID is not necessarily the right one: it can be a database whose deletion was in progress, or one whose creation never finished. If you can’t tell, free the name instead.
  4. Copy anything you need from the roots you won’t keep. The next step makes the server delete them.
  5. Overwrite the file in the data bucket:
    • to keep a database: {"format_version":1,"current":{"id":"<database-id>","state":"live"},"retired":[]};
    • to free the name: {"format_version":1,"current":null,"retired":[]}.
  6. Within a few minutes, the server deletes every root the file doesn’t name, in both buckets.

Prefer overwriting the file to deleting it. Deleting it also frees the name, but the name’s storage in the WAL bucket is then kept until the name is created again. Storage cleanup warns about those roots on each pass until then, and if no other database name was ever created in the deployment, it refuses every pass with a storage-prefix error instead. No restart is needed. Kafka topics for a database ID you drop are yours to delete, as for any deleted database; see Kafka prerequisites.