Service - User Resource Use

From Izara Wiki
Revision as of 13:38, 18 January 2023 by Sven the Barbarian (talk | contribs) (Created page with "= 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 === <syntaxhighlight lang="JavaScript"> { configKey: "UserAccountBalanceServiceName" configTag: "UserAccountBal...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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..

.. some way of recording resourceUse need to add to Account Balance...

Working documents

User Resource Use