Service - User Resource Use
Overview
Records resource use allocated to each user, this can be used to bill users according to their resource use, eg after free limits have been exceeded.
Repository
https://bitbucket.org/izara-core-user-accounts/izara-core-user-accounts-user-resource-use
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "UserAccountBalanceServiceName"
configTag: "UserAccountBalanceServiceName"
configValue: xxx // eg: "AccBalance"
}
ResourceUse
{
userIdResource: xxx
useTime: xxx
details: xxx
}
- partition key: userIdResource
- sort key: useTime
- userIdResource: userId + "_" + "resourceTag"
- useTime: {timestamp of use}_{uniqueRequestId}, add uniqueRequestId to ensure each record is unique
- details: an object with additional information about the resource use, eg what Lambda function, query, etc..
- resourceTag: Lambda/Dynamo/Neo4j/etc..