Aws - DynamoDB

Card Puncher Data Processing

About

Amazon implementation inspired by dynamo

Amazon DynamoDB is a nosql database that store its data as a key/value.

DynamoDB was introduced to address the limitations of SimpleDB

DynamoDb combine the best parts of:

Table

DynamoDB tables do not have a fixed schema but instead allow each data item to have any number of attributes, including multi-valued attributes.

The key (primary and sort) can not be changed.

Installation

Local

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html

Management

Create table

  • AWS Management Console > Services > DynamoDB
  • Choose Create table.
  • Enter Table name. This field is case sensitive.
  • Enter the id for the Partition key and select the key type. This field is case sensitive.
  • Check the Use default settings box and choose Create.
  • Scroll to the bottom of the Overview section of your new table where you will see the ARN.

Key features

  • Service Level Agreement (SLN) at the 99th percentile, and not on mean/median/variance (the heavy users are penalized) “Respond within 300ms for 99.9% of its requests”
  • DHT with replication:
    • Store value at k, k+1, …, k+N-1
    • Eventual consistency through vector clocks
  • Reconciliation at read time:
    • Writes never fail (“poor customer experience”)
    • Conflict resolution: “last write wins” or application specific

Consistency

A feature of Dynamo is eventual consistency through vector clocks.

vector clock

Each data item associated with a list of (server, timestamp) pairs indicating its version history.

Which pairs of vector clocks do not conflict? Select all that apply.

  • Data 1: ([SX, 10], [SY, 20], [SZ, 3]); Data 2: ([SX, 10], [SY, 10], [SZ, 60])
  • Data 1: ([SX, 5], [SY, 10]); Data 2: ([SX, 10], [SZ,30])
  • Data 1: ([SY, 10]); Data 2: ([SY, 1])
  • Data 1: ([SX, 5], [SY, 10]); Data 2: ([SX, 10], [SY, 20], [SZ,30])

Answer C and D

Vector clocks conflict when all values in one clock are not later than or equal to all values in the other clock. This means the vector clock [(SX, A), (SY, B), (SZ, C)] does not conflict with the vector clock [(SX, D), (SY, E), (SZ, F)] if and only if A ≥ D, B ≥ E, and C ≥ F OR D ≥ A, E ≥ B, and F ≥ C. If a server has no entry in a specific clock, you can treat its time stamp as 0.

Configurable Consistency

  • R = Minumum number of nodes that participate in a successful read
  • W = Minumum number of nodes that participate in a successful write
  • N = Replication factor

If R + W > N, you can claim consistency but R + W < N means lower latency.

Documentation / Reference





Discover More
Aws Serverless Web App
AWS - Serverless Web Application

Note the AWS tuto Amazon tuto - Build a Serverless Web Application that create a serverless...
Card Puncher Data Processing
Aws - Dynamo Storage system

dynamo is a key-value storage system (file system ?) that has inspired the dynamo db database See Dynamo_(storage_system) Amazon...
Card Puncher Data Processing
Aws - Lambda Function

AWS Lambda run code in response to events such as an HTTP request. A lambda function (Serverless code) can defined using AWS SAM. Every Lambda function has an IAM role associated with it. This role...
Database Design Space
Database - (Software|Design Space|Category)

, Greenplum Massively parallel open source data warehouse Originally based on PostgreSQL (See also: ) Drill A single query can...
Data System Architecture
Database - Model

relational model the Hierarchical_database_modelhierarchical model and network model. object-oriented databases. Object-Relation type-Object model is based on the assumption that any fact can...
Data System Architecture
What is a Key Value Database/Store?

A key-value database / store is a NoSQL database based on the key-value data that is stored in btree or map data structure. You store some data, called a value, inside a key. The data can later be...
Data System Architecture
What is a Nosql Database?

This page explains as if you were 5 what is a NoSQL database.



Share this page:
Follow us:
Task Runner