Skip to content

[Proposal] Optional DynamoDB persistence backend #5615

Open

Description

@ZephyrYWZhou

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 manager relational-jdbc already 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 dynamodb backend 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.

Design doc

Full design: https://docs.google.com/document/d/1vc7FCvznlfdBoHe0DJQo1vRzcd0AXHFX4cGrFhuiF9Y/edit?usp=sharing

Activity

  1. added
    enhancement
    on Sep 25, 2026
  2. dimas-b commented on Sep 25, 2026

    @dimas-b
    Contributor

    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.

  3. ZephyrYWZhou commented on Sep 25, 2026

    @ZephyrYWZhou
    ContributorAuthor

    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.

  4. dimas-b commented on Sep 25, 2026

    @dimas-b
    Contributor

    how a single shared commit point behaves when there are a lot of concurrent, independent writes.

    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

  5. dimas-b commented on Sep 25, 2026

    @dimas-b
    Contributor

    @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 dev ML.

  6. ZephyrYWZhou commented on Sep 25, 2026

    @ZephyrYWZhou
    ContributorAuthor

    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 dev ML 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.

  7. snazy commented on Sep 28, 2026

    @snazy
    Member

    Related/duplicate of #844

  8. dennishuo commented on Sep 28, 2026

    @dennishuo
    Contributor

    +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.

  9. github-actions commented on Oct 29, 2026

    @github-actions

    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.

  10. ZephyrYWZhou commented on Nov 6, 2026

    @ZephyrYWZhou
    ContributorAuthor

    This proposal is under active development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementproposal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions