Repository navigation
Persistence: Add DynamoDB backend module skeleton - #5622
Conversation
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.
1f987ef to
cdde6c4
Compare
|
This PR by itself it pretty simple and non-intrusive, but I believe we need to reach consensus on the |
|
@ZephyrYWZhou can you open a draft PR containing the whole work? |
|
Hey @snazy, thanks for the comment! I thought the alignment the community reached during the sync was: 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. |
|
@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". |
|
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 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. |
| polaris-runtime-common=runtime/common | ||
| polaris-runtime-test-common=runtime/test-common | ||
| polaris-relational-jdbc=persistence/relational-jdbc | ||
| polaris-persistence-dynamodb=persistence/dynamodb |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Sounds good to me. Thanks both for the naming suggestions, just made the changes.
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.
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.
5475d2f to
118d681
Compare
flyrain
left a comment
There was a problem hiding this comment.
The skeleton looks good to me. Thanks @ZephyrYWZhou ! Left one minor comment.
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.
118d681 to
dfb2378
Compare
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.
dfb2378 to
281546e
Compare
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.
281546e to
06ee8f4
Compare
| * <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; |
There was a problem hiding this comment.
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
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.
06ee8f4 to
643133f
Compare
| */ | ||
|
|
||
| /** | ||
| * Optional Amazon DynamoDB persistence backend for Polaris. |
There was a problem hiding this comment.
nit: this javadoc does not have to describe the backend as optional. Higher-level code makes it obvious already.
There was a problem hiding this comment.
Sounds good will polish this
|
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. 🙂 |
|
@ZephyrYWZhou , only committer can merge PRs per ASF policy. |
|
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. |
Summary
First step toward an optional DynamoDB persistence backend (#5615). This adds the
persistence/dynamodbGradle module — wired into the build and the published BOM — with theDynamoDbConfigurationcontract. The factory andBasePersistenceadapter land in follow-up PRs.The backend will reuse the existing
AtomicOperationMetaStoreManager(per-entity compare-and-set) over a newBasePersistenceadapter — the same layeringrelational-jdbcuses — 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
polaris-persistence-dynamodb(persistence/dynamodb) ingradle/projects.main.propertiesand in the published BOM (bom/build.gradle.kts).persistence/dynamodb/build.gradle.kts, mirroring therelational-jdbcmodule (polaris-server+jandexplugins, depends on:polaris-core).DynamoDbConfiguration— a config contract (table name + optional endpoint override) mirroringRelationalJdbcConfiguration; interface declarations only, no implementation.package-info.javadocumenting 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
CHANGELOG.mdupdate needed