You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/aws/services/dynamodb.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
---
2
2
title: DynamoDB
3
-
linkTitle: DynamoDB
4
3
description: Get started with DynamoDB on LocalStack
5
4
persistence: supported
6
5
tags: ["Free"]
@@ -11,7 +10,7 @@ It offers a flexible and highly scalable way to store and retrieve data, making
11
10
DynamoDB provides a fast and scalable key-value datastore with support for replication, automatic scaling, data encryption at rest, and on-demand backup, among other capabilities.
12
11
13
12
LocalStack allows you to use the DynamoDB APIs in your local environment to manage key-value and document data models.
14
-
The supported APIs are available on our [API coverage page]({{< ref "coverage_dynamodb" >}}), which provides information on the extent of DynamoDB's integration with LocalStack.
13
+
The supported APIs are available on our [API coverage page](), which provides information on the extent of DynamoDB's integration with LocalStack.
15
14
16
15
DynamoDB emulation is powered by [DynamoDB Local](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html).
17
16
@@ -27,14 +26,14 @@ We will demonstrate how to create DynamoDB table, along with its replicas, and p
27
26
You can create a DynamoDB table using the [`CreateTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html) API.
28
27
Execute the following command to create a table named `global01` with a primary key `id`:
@@ -70,12 +69,12 @@ The following output would be retrieved:
70
69
You can create replicas of a DynamoDB table using the [`UpdateTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html) API.
71
70
Execute the following command to create replicas in `ap-south-1` and `us-west-1` regions:
@@ -107,10 +106,10 @@ You can now operate on the table in the replicated regions as well.
107
106
You can use the [`ListTables`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.html) API to list the tables in the replicated regions.
108
107
Run the following command to list the tables in the `eu-central-1` region:
109
108
110
-
{{< command >}}
111
-
$ awslocal dynamodb list-tables \
109
+
```bash
110
+
awslocal dynamodb list-tables \
112
111
--region eu-central-1
113
-
{{< /command >}}
112
+
```
114
113
115
114
The following output would be retrieved:
116
115
@@ -127,34 +126,34 @@ The following output would be retrieved:
127
126
You can insert an item into a DynamoDB table using the [`PutItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html) API.
128
127
Execute the following command to insert an item into the `global01` table:
129
128
130
-
{{< command >}}
131
-
$ awslocal dynamodb put-item \
129
+
```bash
130
+
awslocal dynamodb put-item \
132
131
--table-name global01 \
133
132
--item '{"id":{"S":"foo"}}' \
134
133
--region eu-central-1
135
-
{{< /command >}}
134
+
```
136
135
137
136
You can now query the number of items in the table using the [`DescribeTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html) API.
138
137
Run the following command to query the number of items in the `global01` table from a different region:
139
138
140
-
{{< command >}}
141
-
$ awslocal dynamodb describe-table \
139
+
```bash
140
+
awslocal dynamodb describe-table \
142
141
--table-name global01 \
143
142
--query 'Table.ItemCount' \
144
143
--region ap-south-1
145
-
{{< /command >}}
144
+
```
146
145
147
146
The following output would be retrieved:
148
147
149
148
```bash
150
149
1
151
150
```
152
151
153
-
{{< callout >}}
152
+
:::note
154
153
You can run DynamoDB in memory, which can greatly improve the performance of your database operations.
155
154
However, this also means that the data will not be possible to persist on disk and will be lost even though persistence is enabled in LocalStack.
156
155
To enable this feature, you need to set the environment variable `DYNAMODB_IN_MEMORY=1` while starting LocalStack.
157
-
{{< /callout >}}
156
+
:::
158
157
159
158
### Time To Live
160
159
@@ -167,8 +166,13 @@ In addition, to programmatically trigger the worker at convenience, we provide t
The LocalStack Web Application provides a Resource Browser for managing DynamoDB tables and items.
178
182
You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the **Resources** section, and then clicking on **DynamoDB** under the **Database** section.
0 commit comments