DynamoDB – is a NoSQL database service by AWS designed for fast processing of small data, which dynamically grows and changes
Usage
- Gaming: high-scores, world changes, player status and statistics
- Advertising services :
- Messaging and blogging
- Data blocks systematization and processing
Your data is automatically replicated among 3 AZ within the selected region
- There is no limit to the amount of data you can store in an Amazon DynamoDB table. As the size of your data set grows, Amazon DynamoDB will automatically spread your data over sufficient machine resources to meet your storage requirements.
- To achieve high uptime and durability, Amazon DynamoDB synchronously replicates data across three facilities within an AWS Region.
Amazon DynamoDB supports two types of secondary indexes:
- Local secondary index — an index that has the same partition key as the table, but a different sort key. A local secondary index is “local” in the sense that every partition of a local secondary index is scoped to a table partition that has the same partition key.
- Global secondary index — an index with a partition or a partition-and-sort key that can be different from those on the table. A global secondary index is considered “global” because queries on the index can span all items in a table, across all partitions.
Global secondary indexes are indexes that contains a partition or partition-and-short keys that can be different from the table’s primary key.
DynamoDB cross-region replication allows you to maintain identical copies (called replicas) of a DynamoDB table (called master table) in one or more AWS regions. After you enable cross-region replication for a table, identical copies of the table are created in other AWS regions. Writes to the table will be automatically propagated to all replicas.
If you wish to exceed throughput rates of 10,000 writes/second or 10,000 reads/second, you must first contact Amazon
– DynamoDB data is automatically replicated across multiple AZs
– DynamoDB allow for the storage of large text and binary objects, but there is a limit
DynamoDB cross-region replication allows you to maintain identical copies (called replicas) of a DynamoDB table (called master table) in one or more AWS regions. After you enable cross-region replication for a table, identical copies of the table are created in other AWS regions. Writes to the table will be automatically propagated to all replicas.
-Strong Consistency
Atomic counter
DynamoDB supports atomic counters, where you use the updateItem method to increment or decrement the value of an existing attribute without interfering with others write request. ( All write request are applied in the order in which there were received)
Conditional writes
PutItem, DeleteItem, UpdateItem
Conditional writes are idempotent – that mean you can send the same conditional write request multiple times, but it will have no future effect on the item after the first time DynamoDB performs the specific update .
Batch Operations
If your application needs to read multiple items, you can use BatchGetItem. A single BatchGetItem request can retrieve up to 16 MB of data, which can contains as many as 100 items.
DynamoDB supports eventually consistent and strongly consistent reads .
Eventually consistent reads
When you read data from a DynamoDB table, the response might not reflect the results of recently completed writhe operations. The response might include some stale data. If you repeat your read request after a short time , the response should return the latest data.
Strongly consistent Reads
When you request strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that where successful. A strongly consistent read might not be available in the case of network delay or outage.
DynamoDB uses eventually consistent reads, unless you specify otherwise. Read operations ( such as GetItem, Query, and Scan )provide a ConsistentRead parameter: if you set this parameter to true, DynamoDB will use strongly consistent reads during the operation.
Units of Capacity required for writes = Number of item writes per second x item size in 1KB blocks
Units of Capacity required for reads* = Number of item reads per second x item size in 4KB blocks
* If you use eventually consistent reads you’ll get twice the throughput in terms of reads per second.
Error Components :
An HTTP code 200 – success
An HTTP code 400 – indicate a problem with your request ( client error)
e.g authentication failure, missing required parameters, or exceeding table’s provisioned throughput
Ann HTTP code 5xx – status code indicates a problem that mus be resolved by Amazon Web Services
Optimistic locking is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in DynamoDB. If you use this strategy, then your database writes are protected from being overwritten by the writes of others — and vice-versa.
-DynamoDB supports nested attributes up to 32 levels deep.
Reference