Menu

Showing posts with label DynamoDB. Show all posts
Showing posts with label DynamoDB. Show all posts

Setup DynamoDB in local machine and use as SQL

DynamoDB is a NoSQL database provided by Amazon. Those who are working on Dynamo DB always have to connect and work on dynamo DB using the web browser. But now Amazon came with NoSQL workbench that is an application which helps developers to connect with dynamo DB instance hosted on Amazon or local dynamo DB installed in local machine. Let's see how a NoSQL workbenchhelps developer and how a developer can connect and use NoSQL Workbench.
 

Prerequisite

You should have the latest Docker installed in your local machine.

Install and Setup DynamoDB

 
1. Run the docker.
2. Download the latest DynamoDB Docker image. 
2.1 Open a command prompt and run this command to download the docker image file for dynamo DB.
The command needs to run docker pull amazon/dynamodb-local

Download dynamo DB docker image
Download dynamo DB docker image


2.2 To start the docker run the following command docker run -d 8000:8000 amazon/dynamodb-local
Status of docker image downloading

2.3 Check the status of docker using command >> docker ps


3. Download the NoSQL workbench tool from Amazon site.  

4. Open the NoSQL workbench, go to operation builder and click on "Add connection" to create a new database connection.
NoSQL benchmark for Amazon DynamoDB
NoSQL benchmark for Amazon DynamoDB

5. Now NoSQL benchmark is connected with dynamoDB. You can now run your SQL command and perform transactions.

Hope this helps you! Thank You!  

SQL query to update DynamoDB records

In this post, we will look at how to alter or update records in the No-SQL DynamoDB table. The SQL language provides the UPDATE statement for modifying data. Amazon DynamoDB uses the UpdateItem operation to accomplish similar tasks.

Syntax to run the update command


UPDATE <"TableName">
SET <column name> = <value>
WHERE <column name> = <value>

e.g.

UPDATE "user"
SET enabled='true'
WHERE id='dynamoDBUser'


Here SET clause is to set the value which you want to set, and WHERE clause is to identify the right row or data from the table.

Reference:

Amazon DynamoDB SQLtoNoSQL UdateData