Skip to content
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

Store channel_ids as a "set" #572

Closed
data-sync-user opened this issue Jan 24, 2024 · 0 comments
Closed

Store channel_ids as a "set" #572

data-sync-user opened this issue Jan 24, 2024 · 0 comments
Assignees

Comments

@data-sync-user
Copy link
Collaborator

We store the users’s channel_ids as a set in DynamoDB.

The current Bigtable layout stores each channel_id as an individual row in the router column family. When we eventually enable garbage collection on router, we’ll need to update each row to bump their expiry (timestamp), as well as the main router columns: requiring writes to number of channel_ids + 1 number of rows.

We also should be updating the channel_ids with a condition that the channel_id still exists. To update the cell timestamp, Bigtable requires us to 1) read the data 2) update its timestamp 3) write the data backout. A client could potentially unsubscribe from a channel_id in between #1 and #3.

Whereas the DynamoDB style lets us update the expiry time of all channel_ids with one write to a single row.

The recently added Bigtable for DynamoDB users doc points out that we can represent a Set of values within one row by using column qualifiers as data: this would work more similarly to DynamoDB where we only require one row write (though we still need to write conditionally – it simplfies the condition to being dependent on one single row).

┆Issue is synchronized with this Jira Task

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

No branches or pull requests

2 participants