NoSQL- DynamoDB

Database Types

Unstructured data is information that either does not have a predefined data model or is not organized in a predefined manner.

Unstructured information is typically text-heavy but may contain data such as dates, numbers and facts as well as examples include email, messages, word processing, documents, videos, photos, and audio files.

Semi-Structured data is information that does not reside in a relational database, but that does have some organization properties that make it easier to analyze. e.g. XML & JSON

Structured data refers to information with a high degree of organization such that inclusion in a relational database is seamless and readily searchable by simple, straightforward search engine algorithms.

All data can be stored in database SQL in the table with rows and columns. They have a relational key and can be easily mapped into predefined fields.

DynamoDB Table

  1. A table is like a collection of data items.

  2. Like all other databases, Dynamo DB stores data in tables.

Items

  1. Each table contains multiple items.

  2. An item is a group of attributes that is uniquely identifiable among all the other items.

  3. An item consists of a primary or composite key and a flexible number of attributes. Dynamodb is similar to rows, and records in another database.

Attributes

  1. Each item is composed of one or more attributes.

  2. An attribute consists of an attribute name and a value or a set of values.

  3. An attribute is a fundamental data element, something that does not need to be broken down any further.

  4. The aggregate size of an item cannot exceed 400 KB.

  5. Dynamodb allows low latency read slash write access to items ranging from 1KB to 400 KB.

  6. Dynamo DB can use pointers of S3 for storing items of size larger than 400 KB.

  7. DynamoDB attributes and items are schema-less. That is there is no predefined structure beforehand.

Dynamo DB Read Capacity Unit

  1. One read capacity unit represents one strongly consistent read per second, or two eventually consistent reads for seconds for an item up to 4 KB in size.

  2. If you need to read an item that is larger than 4 KB, Dynamo DB will need to consume additional RCUs.

  3. The total RCUs depend on the item size and whether you want eventual or strongly consistent.

Dynamo DB Write Capacity Unit

  1. 1 WCU represents one write per second for an item up to 1KB in size.

  2. If you want to write an item more than 1 KB in size, Dynamo DB will need to consume additional WCU.

  3. The total number WCUs depends on the item size.

Dynamo DB limits

  1. 256 tables per region.

  2. No limit on the size of the table.

Dynamodb Calculating Reads

RCU for Strong:

  1. 50 reads at 40KB per item

    (40/4) * 50 = 500 RCUs

  2. 10 reads at 6KB per item

    (8/4) * 10 = 20 RCUs

  3. 33 reads at 17KB per item

    (20/4) * 33 = 132 RCUs

RCU for Eventual:

  1. 50 reads at 40KB per item

    (40/4) * 50 = 500/2 = 250 RCUs