Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
25fa087
docs: add MongoDB storage backend design document
diegotoledano95 Jun 6, 2026
6625c00
feat: add MongoDB storage backend (extenddb-storage-mongodb)
diegotoledano95 Jun 6, 2026
4a0af26
chore: add MongoDB test configuration and runner updates
diegotoledano95 Jun 6, 2026
7035370
docs: add MongoDB backend documentation
diegotoledano95 Jun 6, 2026
74a75b1
fix(mongodb): emit DynamoDB-compliant event names in stream records
diegotoledano95 Jul 17, 2026
72bff91
fix(mongodb): reject BETWEEN with low > high on query key path
diegotoledano95 Jul 17, 2026
d0eaf44
fix(mongodb): populate CancellationReason.Item on condition-check fai…
diegotoledano95 Jul 17, 2026
2fd5199
fix(mongodb): reject numeric key values that exceed Decimal128 precision
diegotoledano95 Jul 17, 2026
38c40be
chore(mongodb): rustfmt after contract fixes
diegotoledano95 Jul 17, 2026
e41f75a
chore(mongodb): resolve clippy collapsible_match warning in data_engi…
diegotoledano95 Jul 17, 2026
164e615
chore(mongodb): collapse nested if/if let per clippy
diegotoledano95 Jul 21, 2026
49de03f
fix(mongodb): per-shard sequence number counter
diegotoledano95 Jul 17, 2026
75d1842
fix(mongodb): TTL-invalidate GSI cache entries for multi-instance safety
diegotoledano95 Jul 17, 2026
ac15340
fix(mongodb): query tables collection by _id compound key in backup e…
diegotoledano95 Jul 17, 2026
c2fd4d0
refactor(mongodb): use server-side $out for backup and restore
diegotoledano95 Jul 17, 2026
f9caf16
test(mongodb): pure-Rust BSON filter interpreter for pushdown parity
diegotoledano95 Jul 17, 2026
9cc3a66
test(mongodb): proptest harness for pushdown-parity between compiler …
diegotoledano95 Jul 17, 2026
37d79e6
feat(mongodb): enable selective filter pushdown for conditional writes
diegotoledano95 Jul 17, 2026
d4fe909
fix(mongodb): reject ProvisionedThroughput on PAY_PER_REQUEST in Upda…
diegotoledano95 Jul 21, 2026
b92b4f2
fix(mongodb): persist and return TableClass, SSESpecification, OnDema…
diegotoledano95 Jul 21, 2026
9521d72
fix(mongodb): scope stream shards by table_id to prevent cross-tenant…
diegotoledano95 Jul 21, 2026
56049e1
fix(mongodb): use netstring encoding for composite _id to avoid delim…
diegotoledano95 Jul 21, 2026
6aba4e0
fix(mongodb): propagate stream records and GSI updates inside Transac…
diegotoledano95 Jul 21, 2026
0bc9ff0
fix(mongodb): assign stream sequence numbers inside the write transac…
diegotoledano95 Jul 21, 2026
949c299
fix(mongodb): embed base-table keys as first-class fields on index do…
diegotoledano95 Jul 21, 2026
526cffe
fix(mongodb): emit INSERT (not MODIFY) when UpdateItem creates an item
diegotoledano95 Jul 21, 2026
cd86c3e
fix(mongodb): unique index on idempotency tokens + E11000 race handling
diegotoledano95 Jul 21, 2026
5a1eb13
fix(mongodb): preserve sort-key range on Query pagination resume
diegotoledano95 Jul 21, 2026
d95b763
fix(mongodb): enforce 24-hour stream retention
diegotoledano95 Jul 21, 2026
34edabd
fix(mongodb): make UpdateTable stream enable idempotent
diegotoledano95 Jul 21, 2026
b7d1405
fix(mongodb): bump _v on UpdateItem native fast path
diegotoledano95 Jul 21, 2026
8dd6c9f
fix(mongodb): capture pre-image on UpdateItem so GSI deltas apply
diegotoledano95 Jul 21, 2026
9537436
fix(mongodb): retry transient write conflicts (folds D-M2, D-M3)
diegotoledano95 Jul 21, 2026
c04d51f
fix(mongodb): async GSI backfill on UpdateTable
diegotoledano95 Jul 21, 2026
d07a094
fix(mongodb): validate index-key types on write
diegotoledano95 Jul 21, 2026
cfc77f6
fix(mongodb): store binary sort keys as hex strings
diegotoledano95 Jul 21, 2026
2f8f236
fix(mongodb): don't drop items in Parallel Scan under key-hash skew
diegotoledano95 Jul 22, 2026
72bac3c
fix(mongodb): reject non-primary read preferences
diegotoledano95 Jul 22, 2026
db0cd8a
fix(mongodb): keep idempotency retention ≤10 min
diegotoledano95 Jul 22, 2026
f21d14f
fix(mongodb): index stream_records(shard_id, sequence_number)
diegotoledano95 Jul 22, 2026
3702387
fix(mongodb): index GSI/LSI data collections on create
diegotoledano95 Jul 22, 2026
2033f72
fix(mongodb): match postgres stream_label format
diegotoledano95 Jul 22, 2026
a23cc5c
fix(mongodb): stub out obsolete non-transactional write_stream_record
diegotoledano95 Jul 22, 2026
305c97f
fix(mongodb): correct begins_with upper bound on string sort keys
diegotoledano95 Jul 22, 2026
9d69697
fix(mongodb): lock in pushdown analyzer exclusions
diegotoledano95 Jul 22, 2026
360dfa2
feat(): add mongodb storage backend rfc
diegotoledano95 Jul 8, 2026
264401a
docs(rfc): update RFC-206 to match implementation
diegotoledano95 Jul 17, 2026
2a64b02
docs: rewrite RFC-206 and design doc to describe current backend
diegotoledano95 Jul 22, 2026
43e41b6
chore(mongodb): remove crate-wide allow(unused) and dead code
diegotoledano95 Jul 22, 2026
e8d81e5
fix(mongodb): replace broken WorkerStore impl with an explicit no-op
diegotoledano95 Jul 22, 2026
cbf0037
fix(mongodb): propagate stale-index delete_one error
diegotoledano95 Jul 22, 2026
433d15d
fix(mongodb): make init_stream_shards idempotent on E11000
diegotoledano95 Jul 22, 2026
0e864ce
fix(mongodb): sessionless fast paths for unconditional single-item wr…
diegotoledano95 Jul 22, 2026
e344751
test(mongodb): RFC-0003 §4 concurrency conformance
diegotoledano95 Jul 22, 2026
1d32950
fix(mongodb): surface single-item retry exhaustion as TransactionConf…
diegotoledano95 Jul 22, 2026
24d017b
fix(mongodb): zeroize encryption key in MongoCredentialStore on drop
diegotoledano95 Jul 17, 2026
f02e99f
fix(mongodb): warn at startup when MongoDB connection is not using TLS
diegotoledano95 Jul 17, 2026
56e1514
fix(mongodb): redact userinfo password before persisting connection s…
diegotoledano95 Jul 17, 2026
eb8c64e
fix(mongodb): fail closed when access key is_active flag is missing
diegotoledano95 Jul 17, 2026
32cf354
feat(devtools): add --backend flag to run-tests for mongo integration
diegotoledano95 Jul 23, 2026
fa944dc
docs(mongodb): bump minimum MongoDB version to 7.0
diegotoledano95 Jul 23, 2026
6383186
feat(devtools): add run-mongodb-tests orchestrator
diegotoledano95 Jul 23, 2026
191ccc4
fix(mongodb): scope get_stream_records to the shards owning account
diegotoledano95 Jul 30, 2026
921c9de
chore(devtools): fix run-mongodb-tests server lifecycle to satisfy st…
diegotoledano95 Jul 30, 2026
5fef3a7
fix(mongodb): mark Field vs Field comparisons as not pushable
diegotoledano95 Jul 30, 2026
1a90944
fix(mongodb): compute binary begins_with upper bound in hex-string space
diegotoledano95 Jul 30, 2026
6cb48d8
fix(mongodb): implement transient table CREATING state
diegotoledano95 Jul 30, 2026
0157aef
chore(mongodb): adopt set_backend registration and adapt to post-#218…
diegotoledano95 Jul 30, 2026
d9fe4da
chore(mongodb): populate TableKeyInfo secondary-index lists
diegotoledano95 Jul 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ by AWS engineers. It is not a fork of DynamoDB and contains no DynamoDB source c
protocol: any AWS SDK, CLI, or tool that works with DynamoDB works with ExtendDB, unchanged.

- **Language:** Rust (edition 2024, MSRV 1.88+)
- **Storage backend:** PostgreSQL 14+
- **Storage backends:** PostgreSQL 14+ (default), MongoDB 7.0+ (feature flag `mongodb`)
- **Architecture:** Async (tokio), trait-based storage abstraction
- **Authentication:** Mandatory SigV4 with built-in IAM (users, groups, roles, policies)
- **TLS:** Mandatory (self-signed cert generated by default)
Expand Down Expand Up @@ -51,7 +51,8 @@ extenddb/

The `TableEngine` trait in `crates/storage/src/lib.rs` defines the storage interface. All storage backends implement this trait:

- **Current:** `storage-postgres` (PostgreSQL)
- `storage-postgres` (PostgreSQL) — default backend
- `storage-mongodb` (MongoDB) — feature flag `mongodb`

The trait uses RPITIT (return-position impl Trait in traits) for async methods — no `#[async_trait]` macro.

Expand All @@ -66,12 +67,14 @@ extenddb (bin)
│ ├─> extenddb-core (pure sync, no async)
│ └─> extenddb-storage (trait definitions)
├─> extenddb-auth
└─> extenddb-storage-postgres
├─> extenddb-storage-postgres (feature: postgres)
└─> extenddb-storage-mongodb (feature: mongodb)
```

- **extenddb-core:** Pure synchronous Rust. No async, no I/O. Types, validation, expression parsing.
- **extenddb-storage:** Trait definitions only. No implementation.
- **extenddb-storage-postgres:** Concrete PostgreSQL implementation.
- **extenddb-storage-mongodb:** Concrete MongoDB implementation.
- **extenddb-engine:** Operation handlers that call storage traits.
- **extenddb-server:** HTTP server, management API, web console.
- **extenddb-auth:** SigV4 signature verification, IAM policy evaluation.
Expand All @@ -82,13 +85,22 @@ extenddb (bin)
### Prerequisites

- Rust 1.88+ (`rustup update`)
- PostgreSQL 14+ running locally (see `docs/local-postgres-setup.md`)
- Storage backend (one of):
- PostgreSQL 14+ running locally (see `docs/local-postgres-setup.md`)
- MongoDB 7.0+ with replica set (see `docs/local-mongodb-setup.md`)
- Python 3.10+ for tests (`python3 -m venv ~/venvs/extenddb-venv && source ~/venvs/extenddb-venv/bin/activate && pip install -r requirements.txt`)

### Build

```bash
# PostgreSQL backend (default)
cargo build --release

# MongoDB backend
cargo build --release --features mongodb

# Both backends
cargo build --release --features postgres,mongodb
```

Binary: `target/release/extenddb`
Expand All @@ -109,11 +121,15 @@ cargo clippy --all-targets -- -D warnings
### Initialize (first time only)

```bash
# PostgreSQL (default)
./target/release/extenddb init --config extenddb.toml

# MongoDB
./target/release/extenddb init --backend mongodb --config extenddb.toml
```

This creates:
- PostgreSQL databases (`extenddb_catalog`, `extenddb_account_<id>`)
- Databases (`extenddb_catalog`, `extenddb_data`)
- Admin user credentials (printed to stdout — save the password!)
- Self-signed TLS certificate at `~/.extenddb/tls/cert.pem`
- Config file `extenddb.toml`
Expand Down Expand Up @@ -357,6 +373,9 @@ Expression parsing lives in `crates/core/src/expression/`. This is pure sync Rus
| Differences from DynamoDB | `docs/differences-from-dynamodb.md` | Behavioral differences |
| Troubleshooting | `docs/troubleshooting.md` | Common errors and solutions |
| Storage Component Design | `docs/design/04-component-storage.md` | Storage trait design |
| MongoDB Design | `docs/design/13-storage-mongodb.md` | MongoDB backend architecture |
| Local PostgreSQL Setup | `docs/local-postgres-setup.md` | PostgreSQL installation and config |
| Local MongoDB Setup | `docs/local-mongodb-setup.md` | MongoDB installation and config |
| Testing Design | `docs/design/09-testing.md` | Test strategy and infrastructure |
| Extending Storage | `12-backend-plugin-architecture.md` | Guide to implementing storage backends |

Expand Down Expand Up @@ -448,9 +467,10 @@ Activate when the user asks about installing, configuring, running, or debugging
1. **TLS is mandatory** — server refuses to start without it. Use `AWS_CA_BUNDLE` for self-signed certs.
2. **Auth is mandatory** — all requests must be SigV4-signed. Use `extenddb manage` or web console to create credentials.
3. **Account isolation** — all operations are scoped to `account_id`. Different accounts can have tables with the same name.
4. **PostgreSQL must be running** — `extenddb init` and `extenddb serve` require a running PostgreSQL instance.
5. **Python venv** — activate the venv before running tests: `source ~/venvs/extenddb-venv/bin/activate`
6. **Test credentials** — run `devtools/provision-test-credentials` before pytest to create test users and keys.
4. **Storage backend must be running** — `extenddb init` and `extenddb serve` require a running PostgreSQL or MongoDB instance.
5. **MongoDB requires a replica set** — even single-node MongoDB must be configured with `--replSet` for transactions and streams.
6. **Python venv** — activate the venv before running tests: `source ~/venvs/extenddb-venv/bin/activate`
7. **Test credentials** — run `devtools/provision-test-credentials` before pytest to create test users and keys.

## Getting Help

Expand Down
Loading
Loading