DynamoDB multitenant metering

0

How can we know each tenant's storage usage in bytes in a pooled model? More specifically, how is the "ShardSize" in figure 1 of this whitepaper calculated?

Should we be using DynamoDB transactions to maintain the accuracy of this count? Transactions might work, but they are expensive and be a performance bottleneck. AWS itself has obviously solved this problem (otherwise how does it bill us?), and I wonder if guys at Amazon can share how their DynamoDB storage metering and billing is implemented.

Figure 1, AWS multitenant whitepaper DynamoDB multitenant

shaoyu
질문됨 6달 전179회 조회
1개 답변
2

Transactions wouldn't be required. The pooling method looks like over kill to me. If you have a multi-tenant table, you can simply keep the billing information for storage on a table using tenantID.

PKSKData
Tenant1Item1Data
Tenant1Item2Data
Tenant1Item3Data
Tenant3Item1Data
Tenant3Item1Data

Now every time you add or remove an item, you gain its consumed capacity which can give you an indication of how much data is being stored, rounded up to the nearest 1KB. So for every 1WCU, you will attribute that to 1KB. Then you can update your billing table asynchronously as you feel fit.

PKSKStorage
Tenant1Billing3KB
Tenant2Billing1KB
profile pictureAWS
전문가
답변함 6달 전
  • Thanks Leeroy, but the method you described is a simple accumation, which unfortunately under the presence of failures is not accurate. As we all know, one of maxims of AWS is to embrace failures, because they are everywhere in the cloud. To protect against failures, we have to wrap the operations you described with a transaction, which brings us back to my question.

    Is there an AWS native way to do multitenant metering in DynamoDB?

  • Typically metering for storage does not need to be so accurate. You can make approximations and then once per month run a sweeper on those approximations to correct the estimate. Another solution would be to listen to the stream changes for inserts/deletes, if all your items are approximately the same size you can keep an approximate count without the need for transactions. Unfortunately there is no native solution.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠