Skip to content

Commit

Permalink
fix: Sort scheduling info and replace values individually
Browse files Browse the repository at this point in the history
  • Loading branch information
thisispvb committed Oct 5, 2024
1 parent e655a63 commit 6dd4a06
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/docs/en/data-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ For example:

---
sr-due: 2024-07-01
sr-interval: 3
sr-ease: 269
sr-interval: 3
---

### Single Scheduling File
Expand Down
4 changes: 2 additions & 2 deletions docs/vaults/en/Computing/AWS/DynamoDB/Amazon DynamoDB.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sr-due: 2024-08-03
sr-interval: 4
sr-ease: 270
sr-interval: 4
---

#review

Hi guys in this lesson, we're going to go over some of the fundamentals of Amazon DynamoDB. So what is DynamoDB. Well, it's a fully managed NoSQL database service. So it's more of an unstructured database compared to SQL which has more of a rigid structure. It's a key value store and also a document store. It's non-relational, key value. It's fully serverless and you get push button scaling. So that means it's very easy to adjust how your database scales by adjusting the throughput, which will look at in this section. So you have a DynamoDB table and it's essentially scaling horizontally as you give it more throughput. And on the backend that's happening across various partitions in the Amazon data center. So data is stored in partitions and they are replicated across multiple AZs within a single region. DynamoDB provides low latency. So it's in the range of milliseconds. If you need lower latency, like microsecond and these are keywords to look for in exam questions then you would need to use DynamoDB accelerator which we'll also cover in this section. All data gets stored on SSD storage. So it's solid state drives which are high performance. Data gets replicated as we mentioned in the previous slide across multiple AZs within a region. And there's a feature called Global Tables and that will synchronize your tables across regions if you need to have replication across regions. Maybe you're running an application in another region or you might be using it in a DR HA set up. Now, let's look at some of the features of DynamoDB. So as I mentioned, it is fully serverless, it's fully managed, and it's fault tolerant. It's highly available with four nines availability and five nines if you use Global Tables. It's a NoSQL type of database with a name/value structure, has a flexible schemer, which is good for when your data is not well structured or it's unpredictable. Scaling is horizontal by adjusting the throughput. And then AWS takes care of how it actually scales your database across partitions on the backend. And you can also use Auto Scaling. DynamoDB streams is a feature that allows you to capture a time-ordered sequence of item level modifications in a table and it stores that information for up to 24 hours. DynamoDB accelerator is a fully managed in-memory cache for DynamoDB. So that reduces the latency to microseconds. And that runs on EC2 instances. There are various transaction options, including strongly consistent and eventually consistent reads and support for ACID transactions. We'll go into more detail about that. For backup, you get point in time recovery down to the second in the last 35 days and also on-demand backup and restore. And global tables is a fully managed multi-region, multi-master solution. So with global tables you can make changes in each of the regions your table is replicated to. So let's look at the core components of DynamoDB. Firstly we have a table. So everything you see here would constitute the contents of a table. Then we have items. An item is essentially a row in the DynamoDB table. And then we have attributes. The attribute is the information that's associated with each of the items in the database. For the exam it's worth understanding some of the API actions. Now all operations are categorized as control plane or data plane. So let's have a look at some control plane. API actions. For instance create table to create a new table, describe table to get information about an existing table, and list tables will return the names of all your tables in a list. Update table is where you're able to modify the settings of a table or its indexes. And then delete table will delete the table and all the contents. Data plane API actions can be performed using PartiQL, which is SQL compatible or classic DynamoDB, create, read, update, delete or CRUD APIs. So let's have a look at some examples. You've got PutItem to write a single item into a table. BatchWriteItem so you can actually write up to 25 items to a table. So that's more efficient. And then GetItem which will retrieve a single item from a table. BatchGetItem retrieves up to 100 items from one or more tables. So the batch options give you more efficiency when you have large reads or large writes. Update item will modify one or more attributes in an item. And we have delete item to delete a single item from a table. Now let's have a look at some of the supported data types. DynamoDB does support many data types and they're categorized as follows. We've got scalar. A scalar type can represent exactly one value. And those are number, string, binary, boolean, and null. We've then got document types. Those are list and map. And we've got set types. A set type represents multiple scalar values and those are set, number set, and binary set. Now there are a couple of classes of table we can use. We've got the standard which is the default and it's recommended for most workloads. We've then got DynamoDB Standard Infrequent Access or DynamoDB Standard IA. This is lower cost storage for tables that store infrequently accessed data. For example, application logs, old social media posts, E-commerce order history, or past gaming achievements. Let's move on to access control. Access control is managed using IAM. So its identity-based policies that we're using to control access to DynamoDB. You can attach a permissions policy to a user or a group in your account and you can apply a permissions policy to a role. And you can grant cross-account permissions through that option as well. DynamoDB does not support resource-based policies. you can use a special IAM condition to restrict user access to only their own records. The primary DynamoDB resources are tables but it also supports additional resource types, indexes, and streams. You can create indexes and streams only in the context of an existing table. So there are several resources of the actual DynamoDB table. The resources and sub resources will have unique ARNs of their own. And we can see in the table here what the format is. So we've got a table, an index, and a stream and you can see the format of the ARN. Of course where it's highlighted in red that's that's where you would actually replace these values with your region, your account ID, and then your table name or your stream label. Now let's have a look at a couple of example policies. The following example policy grants permissions for one DynamoDB action. That's DynamoDB list tables. So we can see the policy here. The effect is allow. The action is DynamoDB list tables. The resource in this case is *, so any DynamoDB table. The resource is * so that means any table. So it's not specifying a specific ARN. Let's look at another policy. This one grants permissions for three DynamoDB actions. And we can see those are DynamoDB describe table, query, and scan and in this case we're actually specifying the ARN of one individual table. That table is named Books. So the actions that are allowed through this policy will only be allowed on that specific table. So that's it for some of the core fundamentals of DynamoDB. We've got lots more to get on with, and I'll see you in the next lesson.
Hi guys in this lesson, we're going to go over some of the fundamentals of Amazon DynamoDB. So what is DynamoDB. Well, it's a fully managed NoSQL database service. So it's more of an unstructured database compared to SQL which has more of a rigid structure. It's a key value store and also a document store. It's non-relational, key value. It's fully serverless and you get push button scaling. So that means it's very easy to adjust how your database scales by adjusting the throughput, which will look at in this section. So you have a DynamoDB table and it's essentially scaling horizontally as you give it more throughput. And on the backend that's happening across various partitions in the Amazon data center. So data is stored in partitions and they are replicated across multiple AZs within a single region. DynamoDB provides low latency. So it's in the range of milliseconds. If you need lower latency, like microsecond and these are keywords to look for in exam questions then you would need to use DynamoDB accelerator which we'll also cover in this section. All data gets stored on SSD storage. So it's solid state drives which are high performance. Data gets replicated as we mentioned in the previous slide across multiple AZs within a region. And there's a feature called Global Tables and that will synchronize your tables across regions if you need to have replication across regions. Maybe you're running an application in another region or you might be using it in a DR HA set up. Now, let's look at some of the features of DynamoDB. So as I mentioned, it is fully serverless, it's fully managed, and it's fault tolerant. It's highly available with four nines availability and five nines if you use Global Tables. It's a NoSQL type of database with a name/value structure, has a flexible schemer, which is good for when your data is not well structured or it's unpredictable. Scaling is horizontal by adjusting the throughput. And then AWS takes care of how it actually scales your database across partitions on the backend. And you can also use Auto Scaling. DynamoDB streams is a feature that allows you to capture a time-ordered sequence of item level modifications in a table and it stores that information for up to 24 hours. DynamoDB accelerator is a fully managed in-memory cache for DynamoDB. So that reduces the latency to microseconds. And that runs on EC2 instances. There are various transaction options, including strongly consistent and eventually consistent reads and support for ACID transactions. We'll go into more detail about that. For backup, you get point in time recovery down to the second in the last 35 days and also on-demand backup and restore. And global tables is a fully managed multi-region, multi-master solution. So with global tables you can make changes in each of the regions your table is replicated to. So let's look at the core components of DynamoDB. Firstly we have a table. So everything you see here would constitute the contents of a table. Then we have items. An item is essentially a row in the DynamoDB table. And then we have attributes. The attribute is the information that's associated with each of the items in the database. For the exam it's worth understanding some of the API actions. Now all operations are categorized as control plane or data plane. So let's have a look at some control plane. API actions. For instance create table to create a new table, describe table to get information about an existing table, and list tables will return the names of all your tables in a list. Update table is where you're able to modify the settings of a table or its indexes. And then delete table will delete the table and all the contents. Data plane API actions can be performed using PartiQL, which is SQL compatible or classic DynamoDB, create, read, update, delete or CRUD APIs. So let's have a look at some examples. You've got PutItem to write a single item into a table. BatchWriteItem so you can actually write up to 25 items to a table. So that's more efficient. And then GetItem which will retrieve a single item from a table. BatchGetItem retrieves up to 100 items from one or more tables. So the batch options give you more efficiency when you have large reads or large writes. Update item will modify one or more attributes in an item. And we have delete item to delete a single item from a table. Now let's have a look at some of the supported data types. DynamoDB does support many data types and they're categorized as follows. We've got scalar. A scalar type can represent exactly one value. And those are number, string, binary, boolean, and null. We've then got document types. Those are list and map. And we've got set types. A set type represents multiple scalar values and those are set, number set, and binary set. Now there are a couple of classes of table we can use. We've got the standard which is the default and it's recommended for most workloads. We've then got DynamoDB Standard Infrequent Access or DynamoDB Standard IA. This is lower cost storage for tables that store infrequently accessed data. For example, application logs, old social media posts, E-commerce order history, or past gaming achievements. Let's move on to access control. Access control is managed using IAM. So its identity-based policies that we're using to control access to DynamoDB. You can attach a permissions policy to a user or a group in your account and you can apply a permissions policy to a role. And you can grant cross-account permissions through that option as well. DynamoDB does not support resource-based policies. you can use a special IAM condition to restrict user access to only their own records. The primary DynamoDB resources are tables but it also supports additional resource types, indexes, and streams. You can create indexes and streams only in the context of an existing table. So there are several resources of the actual DynamoDB table. The resources and sub resources will have unique ARNs of their own. And we can see in the table here what the format is. So we've got a table, an index, and a stream and you can see the format of the ARN. Of course where it's highlighted in red that's that's where you would actually replace these values with your region, your account ID, and then your table name or your stream label. Now let's have a look at a couple of example policies. The following example policy grants permissions for one DynamoDB action. That's DynamoDB list tables. So we can see the policy here. The effect is allow. The action is DynamoDB list tables. The resource in this case is *, so any DynamoDB table. The resource is * so that means any table. So it's not specifying a specific ARN. Let's look at another policy. This one grants permissions for three DynamoDB actions. And we can see those are DynamoDB describe table, query, and scan and in this case we're actually specifying the ARN of one individual table. That table is named Books. So the actions that are allowed through this policy will only be allowed on that specific table. So that's it for some of the core fundamentals of DynamoDB. We've got lots more to get on with, and I'll see you in the next lesson.
Loading

0 comments on commit 6dd4a06

Please sign in to comment.