Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

DynamoDB in real life

150 vues

Publié le

For every advantage of a new(ish) technology, there is an equal and opposite disadvantage. AWS DynamoDB is no exception. Follow the triumphs and despairs of using this document store in a real-life project.

Publié dans : Logiciels
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

DynamoDB in real life

  1. 1. DynamoDB in Real Life Jonathon Hill - Upstate PHP
  2. 2. @compwright compwright.com
  3. 3. For every advantage there is an equal and opposite disadvantage.
  4. 4. Cost-efficient Unlimited scaling Stateless Transactions Parallel operations
  5. 5. Atomic counters Conditional writes Expiration Encryption Streaming
  6. 6. No indexes* No date support Small records Slow console Bad design = $$$
  7. 7. Idiosyncrasies
  8. 8. Query Scan GetItem PutItem UpdateItem DeleteItem TransactGetItems TransactWriteItems BatchGetItem BatchWriteItem …and more
  9. 9. 500 InternalServerError 400 ProvisionedThroughputExceededException 400 RequestLimitExceeded 400 ResourceNotFoundException
  10. 10. NULL: null BOOL: boolean S: string N: number B: binary SS: string set NS: number set BS: binary set L: list M: map
  11. 11. Eventually Consistent Strongly Consistent Transactional Read per 4k 1/2 RCU 1 RCU 2 RCU Write per 1k 1 WCU 2 WCU
  12. 12. Dual-key sharded design
  13. 13. Partition key value Possible values Uniformity User ID Many Good Status code Few Bad Timestamp, rounded to day, hour, etc Few Bad Device ID, uniform traffic Many Good Device ID, a few “hot” devices Many Bad
  14. 14. Query by key vs. Scan all
  15. 15. Secondary Indexes
  16. 16. Global Secondary Index
  17. 17. Local Secondary Index
  18. 18. Size Shape Velocity
  19. 19. Idempotence and Concurrency
  20. 20. Webhooks Amazon SQS Amazon SNS Amazon Lambda
  21. 21. Real Life
  22. 22. Table Partition Key Sort Key Size RCUs WCUs OrderEvents messageId 3GB 5-100 5-500 PendingOrders clientId messageId 56KB 5-500 5-500 Failures messageId 68KB 5-50 5-50
  23. 23. Ran out of compute units
  24. 24. Not enough
 time to retry
  25. 25. Race conditions
  26. 26. Status ConditionExpression created #id <> :id and #did <> :did started #status = :current and #status <> :newStatus queued #status <> :final and #status <> :newStatus finished
  27. 27. Search and filter
  28. 28. More race conditions
  29. 29. Status Step UpdateExpression created 1 started 2 SET #status = :newStatus, #step = :step queued 4 SET #status = :newStatus, #step = :step error 128 SET #status = :newStatus, #step = :step finished +1 SET #status = :newStatus, #step = #step + :step
  30. 30. Hard 10GB limit
  31. 31. Tips
  32. 32. RTFM!
  33. 33. It ain’t a lock
  34. 34. Bind attribute names
  35. 35. Handle ConditionalCheckFailed errors and retry
  36. 36. Use CloudFormation
  37. 37. Auto-scale
  38. 38. X-Ray
  39. 39. Questions?
  40. 40. Thank You! http://compwright.com/talks/dynamodb-in-real-life @compwright jonathon@compwright.com 864-245-5885

×