Basics of DynamoDB

 DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It's a fully managed, multiregion, multimaster database with built-in security, backup and restore, and in-memory caching for internet-scale applications. DynamoDB can handle more than 10 trillion requests per day and support peaks of more than 20 million requests per second.

DynamoDB does not support locking of object the way a relation DB typically does. It uses a strategy called optimistic locking.

CAP theorem- Consistency, Availability, partition tolerance. Theorem states that at the most we can only have two at a time.

Eventual consistency- reads a data that might be stale and not replicated across all the partitions. But guarentees speed and maximum throughput.

Strong- makes sure that the data read has been replicated across all partitions. Returns most latest data but throughput might be affected.

Partition tolerance- systems capability to maintain functionality, data retention and consistency promises in event of network failures or component failures.

Relational systems are great for analytical processing.

No SQL DB do not have cross table relationships.

There are three type of NoSQL DB - key-value, column based and document based.

document based- mongoDB. Document based storage consisting of tagged elements. 

column- Cassandra and HBase- data is stored and optimized for fast retrieval of a lot of data. Relational DB are row based retrieval. In column based database you are able to work and retrieve large datasets because of the column based retrieval.

key-value- DynamoDB

table is a collection of zero or more items. Items can be organized and queries through their keys. The items are made up of their attributes. Attributes are values associated with the keys that are setup for the table. Primary key or the partition key describes the table. Sort key. Data modelling is important in NoSQL DB. when creating a table you need to immediately specify the partition you are going to use. When you set your key you also need to specify the data type to use. Stronger consistency is going to be heavier processing for the system.

DynamoDB limits

Individual table size does not have a limit. Individual Items do have a limit of 400KB. hence its not recommended to use DynamoDB for large data blobs. Keep your data in S3 and keep the metadata in DynamoDB. The minimum size for partition and sort key is 1byte. the maximum size/length for the partition key is 2048 bytes. The maximum key length for sort key is 1024 bytes.  












Comments