Skip to content

Persistence: Add DynamoDB backend module skeleton - #5622

Merged
flyrain merged 2 commits into
apache:mainfrom
ZephyrYWZhou:dynamodb-persistence-skeleton
Oct 5, 2026
Merged

flyrain merged 2 commits into
apache:mainfrom
ZephyrYWZhou:dynamodb-persistence-skeleton

Conversation

@ZephyrYWZhou

@ZephyrYWZhou ZephyrYWZhou commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First step toward an optional DynamoDB persistence backend (#5615). This adds the persistence/dynamodb Gradle module — wired into the build and the published BOM — with the DynamoDbConfiguration contract. The factory and BasePersistence adapter land in follow-up PRs.

The backend will reuse the existing AtomicOperationMetaStoreManager (per-entity compare-and-set) over a new BasePersistence adapter — the same layering relational-jdbc uses — and is fully optional and opt-in (polaris.persistence.type=dynamodb). This PR contains no business logic and no behavior change: nothing selects or runs the backend yet.

Changes

  • Register polaris-persistence-dynamodb (persistence/dynamodb) in gradle/projects.main.properties and in the published BOM (bom/build.gradle.kts).
  • Add persistence/dynamodb/build.gradle.kts, mirroring the relational-jdbc module (polaris-server + jandex plugins, depends on :polaris-core).
  • Add DynamoDbConfiguration — a config contract (table name + optional endpoint override) mirroring RelationalJdbcConfiguration; interface declarations only, no implementation.
  • Add package-info.java documenting the module's purpose.

Testing

./gradlew :polaris-persistence-dynamodb:build :polaris-bom:verifyBomDependencies :polaris-persistence-dynamodb:spotlessCheck — all pass (compile, javadoc, checkstyle, spotless, BOM verification). No business logic yet; unit and conformance tests land with the implementation PRs.

Checklist

  • 🛡️ Not a security issue
  • 🔗 First PR of the DynamoDB backend series; related to [Proposal] Optional DynamoDB persistence backend #5615
  • 🧪 Skeleton only (no logic yet); tests land with the implementation PRs
  • 💡 No complex logic
  • 🧾 No CHANGELOG.md update needed
  • 📚 No documentation update needed

First step toward an optional DynamoDB persistence backend (apache#5615): adds the
persistence/dynamodb Gradle module (wired into the build and the published BOM)
with the DynamoDbConfiguration interface. No logic and no behavior change;
the factory and adapter land in subsequent PRs.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from 1f987ef to cdde6c4 Compare September 27, 2026 23:20
@dimas-b

dimas-b commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

This PR by itself it pretty simple and non-intrusive, but I believe we need to reach consensus on the dev discussion thread before proceeding: https://lists.apache.org/thread/6lvvvm5x0xszb0ymxtqn5jx858xjmbls

@snazy

snazy commented Oct 2, 2026

Copy link
Copy Markdown
Member

@ZephyrYWZhou can you open a draft PR containing the whole work?

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Hey @snazy, thanks for the comment! I thought the alignment the community reached during the sync was:

Since alternative Persistence modules are optional for end users (opt-in
config), it is reasonable to develop the contribution in a series of small
/ fast PRs merged to `main` sequentially.

Personally, I find it easier for both the developer and reviewer to work with incremental CRs, as it allows us to steer the development direction along the way without having to leave a massive number of comments on one big PR.

Is there any specific reason you’d prefer a whole work-in-progress PR here? If you need a high-level overview of the development details, I believe my design doc here would be a good reference - https://docs.google.com/document/d/1vc7FCvznlfdBoHe0DJQo1vRzcd0AXHFX4cGrFhuiF9Y/edit?tab=t.0#heading=h.qa6ef2kk8gd2.

@dimas-b

dimas-b commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@ZephyrYWZhou : I think @snazy 's idea is for (some) particularly interested reviewers to be able to see the end-to-end picture before all the intermediate PRs are ready. The big PR does not have to be "production grade", as long as it shows fundamental code.

If you already have an end-to-end working code locally, please consider sharing it in a draft PR and reference to/from incremental small PRs.

If not, I personally think it would be ok to work gradually by merging small PRs to main until we have a working solution.... as discussed in the sync call.

We just have to be careful to properly label the partial feature code to inform users that it is "work in progress" and "experimental".

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Gotcha @dimas-b, I see - thanks for the explanation!

Unfortunately, at the moment I still don't have the end-to-end code locally. However, the idea of having a draft PR for reviewing the overall implementation makes sense to me, so I'll work on trying to get the end-to-end code locally while continuing with the incremental PRs for merging into main.

Feel free to let me know if this skeleton PR looks good to your folks as well! Since the incremental PR approach benefits from fast merges, let’s see if we can keep the ball rolling quickly.

Tagging @flyrain for review visibility as well.

Comment thread gradle/projects.main.properties Outdated
polaris-runtime-common=runtime/common
polaris-runtime-test-common=runtime/test-common
polaris-relational-jdbc=persistence/relational-jdbc
polaris-persistence-dynamodb=persistence/dynamodb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given parallel proposals for adding Dynamo support under the current NoSQL framework (#5668) and this PR, I think we have to be able to distinguish them.

So we need a more specific name for this module 😅

How about persistence/dynamodb-atomic? I believe the plan is to implement it under AtomicMetaStoreManager, right?

Other names are welcome too. The only problem is that "dynamodb" alone is too narrow and confusing WRT #5668.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both names looks good to me. I'd assume the nosql version would be something like:
polaris-persistence-nosql-dynamodb=persistence/nosql/persistence/db/dynamodb, which won't confuse with polaris-persistence-dynamodb=persistence/dynamodb, and given this is not a user-face configure, I'm less worry about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Thanks both for the naming suggestions, just made the changes.

ZephyrYWZhou added a commit to ZephyrYWZhou/Apache-Polaris that referenced this pull request Oct 2, 2026
Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort (apache#5668). This module implements the
  Atomic (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it experimental / work-in-progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
ZephyrYWZhou added a commit to ZephyrYWZhou/Apache-Polaris that referenced this pull request Oct 2, 2026
Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort (apache#5668). This module implements the
  Atomic (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it experimental / work-in-progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from 5475d2f to 118d681 Compare October 2, 2026 22:30
flyrain
flyrain previously approved these changes Oct 2, 2026

@flyrain flyrain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skeleton looks good to me. Thanks @ZephyrYWZhou ! Left one minor comment.

Comment thread persistence/dynamodb-atomic/README.md Resolved
ZephyrYWZhou added a commit to ZephyrYWZhou/Apache-Polaris that referenced this pull request Oct 2, 2026
Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort (apache#5668). This module implements the
  Atomic (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it experimental / work-in-progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from 118d681 to dfb2378 Compare October 2, 2026 22:31
ZephyrYWZhou added a commit to ZephyrYWZhou/Apache-Polaris that referenced this pull request Oct 2, 2026
Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort. This module implements the Atomic
  (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it work in progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from dfb2378 to 281546e Compare October 2, 2026 22:31
ZephyrYWZhou added a commit to ZephyrYWZhou/Apache-Polaris that referenced this pull request Oct 2, 2026
Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort. This module implements the Atomic
  (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it work in progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from 281546e to 06ee8f4 Compare October 2, 2026 22:40
@ZephyrYWZhou
ZephyrYWZhou requested a review from flyrain October 2, 2026 22:43
@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Thanks @flyrain @dimas-b for the review! Please feel free to take another look at the PR and help merge it if everything looks good.

* <p>The implementation lands incrementally across a series of pull requests; this initial module
* provides the skeleton and build wiring only.
*/
package org.apache.polaris.persistence.dynamodb;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: how about org.apache.polaris.persistence.atomic.dynamodb?

Existing examples:

  • JDBC qualifies as "relational": org.apache.polaris.persistence.relational.jdbc
  • NoSQL has a sub-package too, and defines its own MetaStore Manager (so it's not "atomic" in that it does not extend AtomicOperationMetaStoreManager): org.apache.polaris.persistence.nosql.metastore.NoSqlMetaStoreManager

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligned and changed. Thanks @dimas-b

Address review feedback on apache#5622:
- Rename polaris-persistence-dynamodb -> polaris-persistence-dynamodb-atomic
  (persistence/dynamodb -> persistence/dynamodb-atomic) to distinguish it from the
  parallel NoSQL-framework DynamoDB effort. This module implements the Atomic
  (per-entity compare-and-set) approach under AtomicOperationMetaStoreManager.
- Add a module README marking it work in progress.

Updates the project mapping and published BOM reference accordingly. No behavior change.
@ZephyrYWZhou
ZephyrYWZhou force-pushed the dynamodb-persistence-skeleton branch from 06ee8f4 to 643133f Compare October 3, 2026 00:29
*/

/**
* Optional Amazon DynamoDB persistence backend for Polaris.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this javadoc does not have to describe the backend as optional. Higher-level code makes it obvious already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good will polish this

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Hey @flyrain, could you help merge the PR as well?

By the way, what’s the community policy around granting merge permissions? I’d like to check whether I could be granted merge permission so that I don’t need to bother you folks each time a PR is fully reviewed and approved. 🙂

@flyrain

flyrain commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@ZephyrYWZhou , only committer can merge PRs per ASF policy.

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Also, as suggested, I opened a draft that builds the whole backend on top of this skeleton so we can see where it's headed: #5694

The draft PR is fairly large, so it's mainly for high-level guidance rather than a line-by-line review. The lower-level details will be addressed in each incremental PR as this implementation is actually shipped.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants