dynamodb deep dive

Download DynamoDB Deep Dive

Post on 26-Jan-2015

106 views

Category:

Technology

3 download

Embed Size (px)

DESCRIPTION

Slides do Webinar Deep Dive de DynamoDB, o banco de dados NoSQL gerenciado e as a service da Amazon Web Services

TRANSCRIPT

  • 1. Deep dive on DynamoDB to create scalable app Eduardo Horai AWS Solutions Architect

2. 1What is DynamoDB? 3. DynamoDB is a managed NoSQL database service. Store and retrieve any amount of data. Serve any level of request traffic. 4. Without the operational burden. 5. Consistent, predictable performance. Single digit millisecond latency. Backed on solid-state drives. 6. Flexible data model. Key/attribute pairs. No schema required. Easy to create. Easy to adjust. 7. Seamless scalability. No table size limits. Unlimited storage. No downtime. 8. Durable. Consistent, disk only writes. Replication across data centers and availability zones. 9. Focus on your app. 10. Provisioned throughput. Reserve IOPS for reads and writes. Scale up for down at any time. 11. Pay per capacity unit. Priced per hour of provisioned throughput. 12. Write throughput. Size of item x writes per second >= 1KB 13. Consistent writes. Atomic increment and decrement. Optimistic concurrency control: conditional writes. 14. Transactions. Item level transactions only. Puts, updates and deletes are ACID. 15. Strong or eventual consistencyRead throughput. 16. Strong or eventual consistencyRead throughput. Provisioned units = size of item x reads per second >= 4KB 17. Strong or eventual consistencyRead throughput. Provisioned units = size of item x reads per second 2 18. Strong or eventual consistencyRead throughput. Same latency expectations. Mix and match at read time. 19. Provisioned throughput is managed by DynamoDB. 20. Data is partitioned and managed by DynamoDB. 21. Partitioning DynamoDB automatically partitions data by the hash key Hash key spreads data & workload across partitions Auto-Partitioning driven by: Data set size Provisioned Throughput Tip: large number of unique hash keys and uniform distribution of workload across hash keys lends well to massive scale! 22. Indexed data storage. Tiered bandwidth pricing: aws.amazon.com/dynamodb/pricing 23. Reserved capacity. Up to 53% for 1 year reservation. Up to 76% for 3 year reservation. 24. Authentication. Session based to minimize latency. Uses the Amazon Security T oken Service. Handled by AWS SDKs. Integrates with IAM. 25. Monitoring. CloudWatch metrics: latency, consumed read and write throughput, errors and throttling. 26. Libraries, mappers and mocks. ColdFusion, Django, Erlang, Java, .Net, Node.js, Perl, PHP Python, Ruby , http://j.mp/dynamodb-libs 27. 2NoSQL Data Modeling 28. id = 100date = 2012-05-16-09-00-10total = 25.00id = 101date = 2012-05-15-15-00-11total = 35.00id = 101date = 2012-05-16-12-00-10total = 100.00 29. T ableid = 100date = 2012-05-16-09-00-10total = 25.00id = 101date = 2012-05-15-15-00-11total = 35.00id = 101date = 2012-05-16-12-00-10total = 100.00 30. id = 100date = 2012-05-16-09-00-10total = 25.00id = 101date = 2012-05-15-15-00-11total = 35.00id = 101date = 2012-05-16-12-00-10total = 100.00Item 31. date = 2012-05-16-09-00-10total = 25.00id = 101date = 2012-05-15-15-00-11total = 35.00id = 101date = 2012-05-16-12-00-10total = 100.00id = 100Attribute 32. Where is the schema? T ables do not require a formal schema. Items are an arbitrarily sized hash. 33. Indexing. Items are indexed by primary and secondary keys. Primary keys can be composite. Secondary keys are local to the table. 34. IDDateT otal 35. Hash keyIDDateT otal 36. Hash keyRange keyIDDateComposite primary keyT otal 37. Hash keyRange keySecondary range keyIDDateT otal 38. Programming DynamoDB. Small but perfectly formed API. 39. CreateTablePutItemUpdateTableGetItemDeleteTableUpdateItemDescribeTableDeleteItemListTables Query ScanBatchGetItem BatchWriteItem 40. CreateTablePutItemUpdateTableGetItemDeleteTableUpdateItemDescribeTableDeleteItemListTables Query ScanBatchGetItem BatchWriteItem 41. CreateTablePutItemUpdateTableGetItemDeleteTableUpdateItemDescribeTableDeleteItemListTables Query ScanBatchGetItem BatchWriteItem 42. Conditional updates. PutItem, UpdateItem, DeleteItem can take optional conditions for operation. UpdateItem performs atomic increments. 43. One API call, multiple items BatchGet returns multiple items by key. BatchWrite performs up to 25 put or delete operations. Throughput is measured by IO, not API calls. 44. CreateTablePutItemUpdateTableGetItemDeleteTableUpdateItemDescribeTableDeleteItemListTables Query ScanBatchGetItem BatchWriteItem 45. Query vs Scan Query returns items by key. Scan reads the whole table sequentially. 46. Query patterns Retrieve all items by hash key. Range key conditions: ==, , >=,