Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Roman
Roman

Posted on • Originally published atromankurnovskii.com

     

AWS DynamoDB Cheat Sheet

  • Global tables are useful for having multiple copies of tables in different region.
  • All DynamoDB tables are encrypted at rest using an AWS owned CMK by default.
  • A primary key can either be a sinale-attribute partition key or a composite partition-sort key.
  • Both partition and sort keys attributes must be defined as type string, number, or binary.
  • Global secondary index:
    • Different partition key and sort key from base table
    • Only eventually consistent
    • Can be created after table is created
    • Using a random prefix for the GSI partition key enables to have high cardinality for the partition key
  • Local secondary index
    • Same partition key, different sort key from base table
    • Eventual and strongly consistent
    • Should be created when creating a table
  • Calculate RCU (read capacity unit) & WCU (write capacity unit):
    • 1 RCU = 2 eventual consistent read of 4 KB, 1 strongly consistent read of 4 KB
    • 1 WCU = 1 write per second for data for an item as large as 1 KB.
  • Queries or scan on GSI consumeRCU on indexnot on table
  • Storing session state could be on elastic cache or dynamodb
  • Best practices when usingScan in dynamodb -Use parallel scan
    • to control the amount of data returned per request use theLimit parameter. This can help prevent situations where one worker consumes all the provisioned throuahput at the expense of all other workers
    • DynamoDB does not support item locking, and conditional writes are perfect for implementing optimistic concurrency.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

More fromRoman

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp