[comment]: # (mdslides presentation.md --include media) [comment]: # (The list of themes is at https://revealjs.com/themes/) [comment]: # (The list of code themes is at https://highlightjs.org/) [comment]: # (markdown: { smartypants: true })
DevOpsTheHardWay
These are the slides we use in class, you're welcome to explore them. Enjoy your learning journey!
# DynamoDB  By Alon Itach
### Today's agenda - Dynamo overview - Tables, items, and attributes - Index keys
### DynamoDB - Amazon DynamoDB is a fully managed [NoSQL](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.html) (key-value) database service. - Allows to store and retrieve **any amount** of data. - Serves **any level** of request traffic. - Dynamo tables' throughput capacity is scalable (without any downtime). - On-demand backup capability allows [point-in-time recovery](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PointInTimeRecovery.html). - Supports TTL expiration for items in the table.
### Tables, items, and attributes - A [table](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.TablesItemsAttributes) is a collection of data - Each table contains zero or more [items](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.TablesItemsAttributes). An item is a group of one or more [attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.TablesItemsAttributes). - An attribute is a fundamental data element (similar to JSON format) 
### Index keys - Each item in the table has a unique identifier called [primary key](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey). - The primary key can be consisted by two attributes - **Partition key** and **sort key**. - DynamoDB uses the **partition key**'s value as input to an internal hash function to determine the partition (physical storage internal to DynamoDB) - In a table that has a partition key and a **sort key**, all items with the same partition key value are stored together, in sorted order by sort key value.
### Index keys 
### Index keys - cont. - A composite primary key gives you additional flexibility when querying data. - For example, if you provide only the value for **Artist**, DynamoDB retrieves all of the songs by that artist. To retrieve only a subset of songs by a particular artist, you can provide a value for Artist along with a range of values for **SongTitle**. 
### Secondary indices - You can create one or more [secondary indexes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.SecondaryIndexes) on a table. A secondary index lets you query the data in the table using an alternate key, in addition to queries against the primary key. - **Global secondary index** – An index with a partition key and sort key that can be different from those on the table. - **Local secondary index** – An index that has the same partition key as the table, but a different sort key. - The diagram in the next slide shows the example Music table, with a new index called `GenreAlbumTitle`. In the index, Genre is the partition key and `AlbumTitle` is the sort key.
### Secondary indices 
### DynamoDB Streams - [Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.Streams) is a feature that captures data modification events in DynamoDB tables. - Events appear in the stream in near-real time, and in the order that the events occurred. 
# Thanks