Add S3 storage backend for indexed blocks
@pthmas is already working on this.
Since Mar 24, 2026.
Assessment
This issue has not been assessed yet.
Description
Motivation
Currently all indexed data is written directly to PostgreSQL and served from there. Adding S3 as a storage backend gives us:
- Redundancy — blocks, transactions, and address data persisted to durable object storage independent of the database
- Cost efficiency — cold data in S3 is significantly cheaper than keeping everything in PG at scale
- Disaster recovery — can rebuild the database from S3 if needed
Proposal
Write path
The indexer writes all indexed data (blocks, transactions, address state) to both PostgreSQL (as today) and S3 (new). S3 writes can be async/best-effort with retries so they don't block the indexing pipeline.
Read path — in-memory cache for recent data
Hold the last N blocks (and their transactions) in an in-memory cache. Serve recent queries directly from memory, bypassing both PG and S3. This covers the hot path — most explorer traffic hits recent data.
Cache eviction: LRU or ring buffer keyed by block number.
Read path — fallback
- Check in-memory cache
- Miss → query PostgreSQL (current behavior)
- Optionally: if PG is down/slow, fall back to S3
Open questions
- S3 object layout — one object per block (including its txs)? Separate prefixes for blocks/txs/addresses? Batched ranges?
- Serialization format — JSON, bincode, protobuf?
- Consistency — how to handle S3 write failures? Retry queue? Reconciliation job?
- Cache size — what's a reasonable default for N? Should it be memory-bounded (bytes) or count-bounded (blocks)?
- Existing data backfill — do we need a one-time migration to populate S3 from PG?
- Address data granularity — store snapshots per block or cumulative state?
- Configuration —
S3_BUCKET,S3_REGION,S3_PREFIX,BLOCK_CACHE_SIZEenv vars
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from evstack/atlas
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
feat: reorg handling Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100