Question

I am new to DynamoDB. I am very much confused about provisioned throughput. I am creating a iPhone game in which the users can chat within the game. I am having a Chat table. The Chat table contains GameID, UserID and Message. How do I find the size of the item to calculate throughput. The size of the item entirely depends on the Message right? How to calculate the size of an item?

Amazon tells that we can either modify the throughput by using UpdateTable API or by manually from the console. If I want to change it form code, how will I know that the provisioned throughput has been exceeded for a certain table? How to check that from code?

I am also confused about the CloudWatch. How to understand this?

Could anyone please help me? Please don't point me to the documentation.

Thanks.

Was it helpful?

Solution

I will do my best to help with the confusion.

  • DynamoDB is a key:value database
  • CloudWatch is Amazon's products monitoring tool
  • Provisioned throughput is roughly the number Items KB you plan to Read/Write per seconds

Whenever you exceed your provisioned throughput,

  1. DynamoDB answers with ProvisionedThroughputExceededException
  2. DynamoDB notifies CloudWatch

What Cloudwatch does is basically record and aggregates data-points. For most applications, it will only keep track of aggregated data over each consecutive 5min periods.

You can then access these data for "manual" monitoring or set up "alarms". There was a really interesting question on SO a couple of weeks earlier on DynamoDB auto-scaling using alarms. You might be interested in reading it: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/ErrorHandling.html

Knowing this, you can start building your application.

As for every DynamoDB services, one needs credentials to access it. Even though they can be restricted to a specific table or set of action, it is very dangerous to bundle them in an application. Would you give MySQL or MongoDB or credentials, even Read Only to any untrusted people ?

May I suggest you do build your application to rely on a server of your own ? This server being trusted and build by you, you could safely perform any authorization check there and grant it full access to your table.

I hope this helps. Feel free to ask for more precisions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top