This document discusses NoSQL databases and when they should be used. It describes what NoSQL databases are, when to consider using one over a relational database, and introduces DynamoDB as an AWS NoSQL solution. Specific topics covered include the differences between relational and NoSQL data models, common use cases for NoSQL databases, and how to access and query DynamoDB tables.
24. Amazon DynamoDB
NoSQL Database
Fast & predictable performance
Seamless Scalability
Easy administration
“Even though we have years of experience with large, complex NoSQL
architectures, we are happy to be finally out of the business of managing it
ourselves.” - Don MacAskill, CEO
ADMIN
25. Access and Query Model
Two primary key options
Hash key: Key lookups: “Give me the status for user foo”
Composite key (Hash with Range): “Give me all the status updates for user ‘foo’ that occurred
within the past 24 hours”
Support for multiple data types
Scalar: number, string, binary
Multi-valued: number set, string set, binary set
Consistency: Supports both strong and eventual consistency
Pick consistency mode at per API call
Different parts of applications can make different choices
30. User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
Social Network
Users Table
31. User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
Social Network
Users Table
Item
32. User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
Social Network
Users Table
Attribute
(string, number, binary, set)
33. User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
Social Network
Users Table
Primary Key
(Hash)
34. User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
Social Network
Friends Table
User Friend
Bob Alice
Alice Bob
Alice Carol
Alice Dan
Users Table
35. Social Network
Friends Table
User Friend
Bob Alice
Alice Bob
Alice Carol
Alice Dan
Hash-and-Range
Primary Key Schema
Users Table
User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
36. Social Network
Friends Table
User Friend
Bob Alice
Alice Bob
Alice Carol
Alice Dan
Query for Alice’s friends
Users Table
User Birthday
Bob 11.02
Alice 15.10
Carol 30.06
Dan 05.01
37. DynamoDB Highlights: Performance
Typical service-side latency: single digit milliseconds
Solid State Drive (SSD)-backed service
Latency is consistent
– As throughput increases
– As storage grows
No need for tuning.
38. DynamoDB Highlights: Reliability
Durability
– Synchronous replication for high durability
– A write is only acknowledged (committed) once it exists in at least two
physical data centers
– All writes occur to disk, not memory
Availability
– Regional service
– spans multiple availability zones
– All data is continuously
replicated to multiple AZ’s
39. Provisioned Throughput
Reserve the throughput needed for each table
– Set at table creation
– Example: My table needs 1,000 writes/second and 5,000
reads/seconds of capacity
Increase / decrease any time via API call
Pay for throughput and storage (not instances)
40. Provisioned Throughput
Why?
– Simpler capacity planning
– Easy to translate calls to Apps => calls to database
– Not in terms of servers and disk IOPS
– Do not be locked in your peak for month or year!
41. Capacity we needed before DynamoDB
Actual traffic
Capacity we can provision
with DynamoDB
No compromise on durability or availability for performance
Scale will be our problem and not customers
DynamoDB will be extremely easy to use with no administration
Help express scale needs in simpler terms instead of servers and disks
Provide consistently low latencies
This lets you do efficient key-value lookups, but not more complex queries. But for this table and use case, this is all we need.
So, who is using DynamoDB?
Many companies within Amazon and outside Amazon.
Amazon CloudDrive, Smugmug, Amazon retail are examples within Amazon.
Smugmug is using us for storing their metadata on DynamoDB.
Formpsring and Tapjoy are one of our early adopters.
Finally, the shazam the popular voice recognition application for ads and music is using us to store its data for various applications.