-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Design doc] For deciding the final indexes on the table. #31
Comments
Where are we going to use status from feature flag table? And in featureflag-user mapping |
How sure are we that it will always be unique since it will be running over the web I think there might be chances when 2 users create a feature flag at the same time. |
We can use feature flag status to switch off a flag in case of features breaking on production, we can check this before checking feature for user, if the feature is enabled or not |
The sort key need not be unique, the partition key which is flagId (generated by uuid package) is going to be unique in Feature Flag table, we can have the sort key (optional) to get the data in ordered fashion. @RitikJaiswal75 |
LGTM 👍 |
[Note]
This document is to decide the final Indexes on thefeature flag
andFeature flag User mapping
table.Feature Flag table.
The
number
is dynamodb datatype for Go we are usingint64
I'm thinking to have Id as the Partition key., as its auto generated and it will avoid Hot Partition problem
The sort key can be
CreatedAt
, we can order the rows using created time. (Optional as Partition key will be unique)We can have an GSI on the
Name
attribute.Initially I thought to get the Id generated by the user, in that case we need to have checks on its uniqueness and it can lead to Hot Partition problem.
FeatureFlag-User mapping table
Here the
flag Id
andUser Id
combination can form the partition key, as User can have multiple feature flags.We can have GSI on
User Id
, to fetch all the feature flags for the User.Links:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html
The text was updated successfully, but these errors were encountered: