-
Notifications
You must be signed in to change notification settings - Fork 1
Bucket eventing - Phase 2 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| #### Configuration Storage | ||
|
|
||
| We will explore two approaches for storing bucket notification configurations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a third option that we can support, which is to use the entitlements service, defined here: https://github.com/storj/storj/tree/main/satellite/entitlements
Basically, it is backed by a generic DB table that has two main columns: scope and features (JSONB, very similar to your "approach A")
Currently, the only "scope" we are using looks like proj-id:<project ID>, and it maps to project-level features related to new bucket placements and pricing. However, when designing the entitlements service, we had possibilities of bucket-level features in mind, including bucket eventing.
Basically, we can add a new scope without modifying the DB schema - e.g. the scope could look like bucket:<project ID>:<bucket name> with feature json like {"eventing": {...}}, and extensible for other bucket-level features that are not yet planned or implemented.
It would require a caching layer to entitlements since this probably needs to be accessed much more frequently than the projects scope.
Anyway, I just want to make sure you are aware of this option, and that the entitlements table is (hopefully) designed to avoid needing a schema update every time we want to add features like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was actually my plan here, before I realized that this phase 2 design doc existed 😅 https://github.com/storj/storj-private/issues/1666
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you pointed out, it is similar to Approach A. So it has the same disadvantages. If the bucket eventing configuration were simpler, we could use Approach A and add a new column to the bucket_metainfo table, like we've done for versioning and eventing. What would be the entitlements benefit compared to Approach A?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the entitlements benefit compared to Approach A?
In my opinion the primary benefits compared to Approach A:
- No DB schema update necessary
- Setting a precedent for enabling/configuring bucket-level features in entitlements table, so that future bucket-related features can also be added the same way without requiring a schema update
If there are not going to be a lot of features like this in the future, it is probably not a huge benefit. However, if we anticipate a lot of similar and unrelated features to be set at the bucket level, how many of these features is it reasonable to add a new column to bucket_metainfos? I might be overthinking it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using entitlements is definitely more effort because it requires an additional caching layer and making sure things like bucket deletion are properly handled. So that approach should only be taken if it makes sense from a longer-term strategy perspective, which I tried to outline in my previous comment.
| Deliver S3-compatible bucket notification configuration API to allow customers to self-manage bucket eventing. | ||
|
|
||
| - S3-compatible `PutBucketNotificationConfiguration` and `GetBucketNotificationConfiguration` APIs | ||
| - Project-level gating: Projects must be explicitly enabled for bucket eventing via satellite configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ This would be a nice to have in the admin @mobyvb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The admin behavior for "entitlements" in the back-office/NG UI is a proof-of-concept for what it could look like. These screenshots are all using the entitlements service+new admin UI



These screenshots represent the features for project-level entitlements:
{"compute_access_token":"dGVzdDI=","new_bucket_placements":[30,31,32],"placement_product_mappings":{"30":10,"31":11,"32":12}}
If the configuration for bucket eventing is also JSON, we can do something really similar, just at the bucket-level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project-level gating is temporary: we’re limiting bucket eventing to a small group of initial customers. Once we’ve built confidence, we’ll remove the gate and open it to everyone. No need to overthink it.
|
This is great, very thorough. |
No description provided.