1 / 11

Amazon SimpleDB

Amazon SimpleDB. Developer Brown Bag Jakub, Rande, Stefano, Tim, & Brett. Agenda. Recap/clarification on recent releases BatchPutAttributes Long running Select queries Select Count Step-by-step SimpleDB tutorial Your questions. BatchPutAttributes API.

lizina
Download Presentation

Amazon SimpleDB

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Amazon SimpleDB Developer Brown Bag Jakub, Rande, Stefano, Tim, & Brett

  2. Agenda • Recap/clarification on recent releases • BatchPutAttributes • Long running Select queries • Select Count • Step-by-step SimpleDB tutorial • Your questions

  3. BatchPutAttributes API • Natural extension to PutAttributes • Up to 25 items per batch • Up to 256 attributes per item • Same as PutAttributes • One megabyte maximum request size • Improved throughput compared to PutAttributes • Fewer round trips with SimpleDB • Server side optimizations

  4. BatchPutAttributes parameters • Rest:Item.X.ItemName=ItemNameItem.X.Attribute.Y.Name=AttributeNameItem.X.Attribute.Y.Value=AttributeValueItem.X.Attribute.Y.Replace=true/falseX: 0-24 itemsY: 0-255 attributes per item • Soap:<Item> <ItemName>...</ItemName> <Attribute> <Name>...</Name> <Value>...</Value> <Replace>...</Replace> </Attribute></Item> • Replace flag is optional and defaults to FALSE • Specify only when strictly necessary

  5. More on BatchPutAttributes • BatchPutAttributes can be executed in parallel • Can achieve even higher throughput • Requests throttled aggressively (503) if excessive parallelism • Excessive depends on dataset • All or nothing semantics • API Call either accepted or rejected in its entirety • Call rejected when throttled (503) • Call rejected when limit exceeded

  6. Long Running Selects • Query, QueryWithAttributes and Select all have a 5 seconds timeout • When timeout elapses • Query and QueryWithAttributes return 408 (timeout) error and no data • Select returns partial result set accumulated so far and NextToken to pick up where it left off • Individual partial result set could be empty • Client responsible for combining result sets • Select can complete even very complex queries over multiple iterations

  7. Select Count(*) • Counts number of items that qualify predicate • Server side counting much more efficient • Count all items in domain: select count(*) from MyDomain • Count blue eyes in domain:select count(*) from MyDomain where EyeColor = 'blue' • Count up to 500 blue eyes in domain:select count(*) from MyDomain where EyeColor = 'blue' limit 500

  8. Count(*) and timeouts • 5 second timeout enforced for Count(*) as well • Select will return NextToken together with partial count • Partial counts must be accumulated by client • Client issues “select count(*) from MyDomain” with no token • SimpleDB returns 20,000 and NextToken T1 • Client issues “select count(*) from MyDomain” with NextToken T1 • SimpleDB returns 50,000 and NextToken T2 • Client issues “select count(*) from MyDomain” with NextToken T2 • SimpleDB returns 35,000 and no NextToken • Final count is 20,000 + 50,000 + 35,000 = 105,000

  9. Interchangeable NextToken • NextToken returned by Count(*) can be used for Select • WHERE and ORDER BY clauses must match • Can be used to efficiently bypass records in result set • Return 100 items after the first 100,000 forselect * from MyDomain where EyeColor = 'blue' and Age > '30’ order by Age • Client issues with no tokenselect Count(*) from MyDomain where EyeColor = 'blue' and Age > '30' order by Age limit 100000 • SimpleDB returns 65,000 and NextToken T1 • Client issues with NextToken T1 select Count(*) from MyDomain where EyeColor = 'blue' and Age > '30' order by Age limit 35000 • SimpleDB returns 35,000 and NextToken T2 • Client issues with NextToken T2select * from MyDomain where EyeColor = 'blue' and Age > '30' order by Age limit 100

  10. SimpleDB Tutorial AWS Evangelist Mike Culver

  11. Questions?

More Related