> For the complete documentation index, see [llms.txt](https://docs.hardpoint.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hardpoint.dev/guides/invar/operations/storage-and-caching.md). Agents can also search and read this documentation through its [MCP server](https://docs.hardpoint.dev/~gitbook/mcp).

# Storage and Caching

## Why the object storage vendor matters

Invar's single-writer safety isn't just "don't run two instances and hope." SlateDB's writer-fencing protocol relies on **conditional writes** — specifically, `PUT` with an `If-None-Match` precondition — to atomically detect and shut out a stale writer that's still trying to make progress after a new one has taken over.

If the underlying object store can't honor that precondition, fencing can't be enforced: two writers could both believe they hold the lock, and the failure mode is silent data corruption, not an error message.

This means the object store you point Invar at isn't a purely operational choice (cost, region, egress fees) — it has to support conditional `PUT`. That's a smaller set of providers than "speaks the S3 API," since plenty of S3-compatible stores implement the basic REST surface without implementing preconditions correctly.

## Known good

* **AWS S3** — the reference implementation. AWS added conditional write support (`If-None-Match`) in August 2024, and it's available on every bucket today with no opt-in required. No surprises here.
* **Tigris** — confirmed working. Config below.
* **MinIO** (self-hosted) — supported since February 2023, ahead of AWS itself. A solid option if you'd rather run your own object storage than depend on a cloud vendor for it.

## Documented support, not yet validated against Invar

{% hint style="warning" %}
Treat both as "promising, do your own verification before trusting it in production" rather than "known good."
{% endhint %}

* **Cloudflare R2** — Cloudflare's docs describe `If-Match`/`If-None-Match` support on `PutObject`. (There's a separate, currently-beta feature for conditional `CopyObject` writes to a destination object — don't confuse the two; it's the plain `PutObject` precondition support that matters here, and that part isn't marked beta.) Worth trying, but nobody's run it against Invar's fencing path yet as far as we know.
* **Scaleway Object Storage** — same situation: their docs confirm `If-None-Match` support, but it's unverified against Invar specifically.

## Known not to work

{% hint style="danger" %}
**Backblaze B2** — no conditional `PUT` support as of this writing. Don't point Invar at B2; fencing silently can't be enforced.
{% endhint %}

## Not applicable

* **Azure Blob Storage, Google Cloud Storage** — Invar only speaks the S3 API and SigV4-style auth. Azure and GCS use different APIs and auth models entirely, so they're not reachable through `--backend slate` regardless of their own conditional-write support.

There are other S3-compatible vendors out there — Wasabi, DigitalOcean Spaces, and others — that haven't been checked one way or the other. Absence from this page means "unverified," not "known bad." If you test one, it's worth feeding back so this list can grow.

## Configuring a vendor

Two environment variables are Invar-specific:

| Variable              | Purpose                                                                                                                          |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `INVAR_S3_BUCKET`     | The bucket Invar stores data in (same as `--bucket`)                                                                             |
| `INVAR_BUCKET_PREFIX` | Key prefix within the bucket (same as `--prefix`, default `/invar`) — namespace multiple instances or tenants sharing one bucket |

Everything else is standard AWS SDK configuration — `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, and, for non-AWS endpoints, `AWS_ENDPOINT_URL_S3` (some vendors also need a separate IAM endpoint). Invar doesn't define any of these itself; it inherits whatever the SDK's normal credential and endpoint resolution supports.

Here's a working example against Tigris:

```bash
AWS_ACCESS_KEY_ID=... \
AWS_SECRET_ACCESS_KEY=... \
AWS_ENDPOINT_URL_IAM=https://iam.storage.dev \
AWS_ENDPOINT_URL_S3=https://t3.storage.dev \
AWS_REGION=auto \
invar --backend slate --bucket invar-local-test --redis
```

For real AWS S3, drop the two `AWS_ENDPOINT_URL_*` variables entirely and set `AWS_REGION` to your bucket's actual region — everything else resolves through the normal SDK defaults.

## Caching and other tunables

SlateDB does real caching work under the hood — in-memory block caches, bloom filters, a local SST disk cache to cut down on repeat reads from object storage — but none of it is exposed as a configurable knob yet.

{% hint style="info" %}
Invar currently runs with SlateDB's defaults, full stop; there's no flag or environment variable for cache size, flush interval, or anything similar today.
{% endhint %}

This section will get filled in once those knobs are exposed. For now, if you're hitting a workload where caching behavior matters, that's worth raising directly rather than assuming there's a setting for it.
