Repository navigation
Description
Summary
Add an optional DynamoDB persistence backend, selected with polaris.persistence.type=dynamodb. It reuses the existing AtomicOperationMetaStoreManager (per-entity compare-and-set) over a new DynamoDbBasePersistence adapter — the same layering relational-jdbc uses — so the manager, the catalog API, and the entity model are unchanged. The change is additive and opt-in; no migration.
Motivation
Polaris's durable backends today are relational-jdbc (Postgres) and nosql (MongoDB) — both mean running a stateful database purely to hold metadata. For teams on AWS, that's often the last stateful piece to manage: the surrounding stack (S3, IAM, EKS/ECS/Lambda) is already fully managed, but there's no serverless, AWS-native metastore to match. A DynamoDB backend closes that gap — useful for serverless compute (Fargate/Lambda), EKS/small teams (drop RDS/Mongo, on-demand capacity), and local dev/CI (DynamoDB Local).
Proposed design (high level)
- Reuses the Atomic manager unchanged, adds one adapter behind
BasePersistence— DynamoDB becomes a second adapter under the managerrelational-jdbcalready runs on. No manager / API / entity-model changes. - Single table, three item types (entity, name-sentinel, grant), each partitioned by its own identity; two sparse GSIs for list-children and grants-by-grantee.
- Name uniqueness via a name-sentinel item +
TransactWriteItems(DynamoDB has no native UNIQUE constraint). - Consistency: every correctness decision rides a strongly-consistent single-key read + conditional write; GSIs are used only for discovery/listing.
- Multi-entity atomic writes (e.g. Iceberg multi-table commit) via
TransactWriteItems. - Config/credentials: client via the Quarkus Amazon DynamoDB extension; credentials via the AWS SDK default provider chain (IAM role) — never in Polaris config.
Scope
- Goals: an optional
dynamodbbackend that passes the shared conformance suite; high write concurrency via per-entity CAS; correct multi-entity atomic writes. - Non-goals: not the default; no API/entity-model/manager changes; no cross-backend migration; metrics-reports and events proposed for a later phase.
Backward compatibility
Fully backward compatible — dynamodb is opt-in; existing backends and the default are untouched, no migration.
Activity
dimas-b commentedon Sep 25, 2026
Thanks for opening proposal, @ZephyrYWZhou !
I believe DynamoDB was part of @snazy 's original work on NoSQL persistence.
https://lists.apache.org/thread/s1v7svrbvq7y4gt3lm88y79td58o644x
@ZephyrYWZhou : would the existing NoSQL framework be of interest to you as a layer on top of DynamoDB?
I am sure @snazy still has the NoSQL/DynamoDB code available for contributing to Polaris.
ZephyrYWZhou commentedon Sep 25, 2026
Thanks @dimas-b - appreciate the pointers. And yes, the NoSQL framework was on my radar; I'd weighed it as an option in the design doc before landing on the current direction.
If I'm reading it right, the framework commits catalog changes through a single named pointer (the HEAD), which gives really nice atomic multi-entity commits and strong consistency. The thing I'm still trying to get my head around is how a single shared commit point behaves when there are a lot of concurrent, independent writes.
That's basically where my proposal was coming from - leaning on per-entity CAS so independent writes each stand on their own instead of queuing behind a shared commit point, which fits and plays to DynamoDB's strength with lots of small independent conditional writes.
Would you or @snazy be able to share the DynamoDB code? I'd love to look at how it handles the concurrent-write path and compare notes.
dimas-b commentedon Sep 25, 2026
It is a bottleneck, indeed. Heavy contention causes longer commits (many internal retries).
However, the benefit is strong consistency and ability to (in theory) guarantee that each commit is valid with respect to various properties (specifically validation rules) present in other entities in the catalog. The latter point is being discussed in:
https://lists.apache.org/thread/622d0sn4wzhw993dr5yhmz5zhy4228hp
dimas-b commentedon Sep 25, 2026
@ZephyrYWZhou : If you want to go ahead with your alternative design for DynamoDB persistence, I do not see any problems with that if we follow the usual patterns of making the new code pluggable / elective for downstream projects. I'd suggest opening a parallel discussion thread for this proposal on the
devML.ZephyrYWZhou commentedon Sep 25, 2026
Thanks @dimas-b, that makes perfect sense. It does sound like a fair trade-off that's worth discussing properly, so I'll follow your suggestion to open a thread on the
devML for it.And on the pattern - absolutely: the DynamoDB backend will be fully pluggable and opt-in, both for users and downstream projects, with no enforcement of any kind.
ZephyrYWZhou commentedon Sep 25, 2026
Mailing list thread is up: https://lists.apache.org/thread/6lvvvm5x0xszb0ymxtqn5jx858xjmbls
Persistence: Add DynamoDB backend module skeleton
snazy commentedon Sep 28, 2026
Related/duplicate of #844
dennishuo commentedon Sep 28, 2026
+1 thanks for opening this @ZephyrYWZhou and providing such a detailed design doc! I'll discuss further on the mailing list, but I do think DynamoDB is a great candidate for a more grounded comparison between the AtomicMetaStoreManager approach and the NoSQL approach.
github-actions commentedon Oct 29, 2026
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment if you think it's still relevant.
ZephyrYWZhou commentedon Nov 6, 2026
This proposal is under active development
Persistence: DynamoDB (atomic) multi-entity writes (writeEntities)