Introduction of AWS DynamoDB!!

DynamoDB is a NoSQL document database service that is fully managed. Unlike traditional databases, NoSQL databases, are schema-less. Schema-less simply means that the database doesn’t contain a fixed (or rigid) data structure.

Advantages:- 

  • DynamoDB is found under the Database section on the AWS Management Console.
  • DynamoDB can handle more than 10 trillion requests per day.
  • DynamoDB is serverless as there are no servers to provision, patch, or manage.
  • DynamoDB supports key-value and document data models.
  • DynamoDB synchronously replicates data across three Availability Zones in an AWS Region.
  • DynamoDB supports GET/PUT operations using a primary key.

Fast and flexible NoSQL database service for any scale

Features:- 

  1. Performance at scale
  2. High Availability and Durability
  3. No servers to manage
  4. Enterprise-ready

DynamoDB is a NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale. Its flexible data model and reliable performance make it a great fit for mobile, web, gaming, ad-tech, IoT, and many other applications.

Applications best suit:- 

  1. Serverless Web Apps
  2. Mobile app backend
  3. Microservices

Let us make hands dirty

  • Create a table
  • Add data to a table
  • Query data in a table
  • Cleanup or delete table

Go to Services and select DynamoDB service 

→ On the DynamoDB Console, click “Create table

→Enter UsersInfo as the Table name. 

→Enter Name in for the Partition key and ensure String is selected.

→For now, keep everything default and click on Create button.

Now the table is ready, Add data into it

→Click on “Create Item”.

 →Enter the value e.g your good name

 → Then click on + button then select ” Insert ” → then select datatype as String provides field name as “EmailId” enter value → Click on “Save” button.

Now data is ready you can add more records for your testimonials.

Query record in a table:-

 → Select the “Query” from drop-down

→ Where it says, Enter value in the row next to the name Partition key. i.e Mahesh, in this case, it may be different for you.

 →Click on “Start search” button.

→You should see your search results

Once everything is done cleanup resources, delete resources.

 → Click on the Delete table button.

 → Ensure Delete all CloudWatch alarms for this table is selected and click Delete.

If you want to create a backup check “Create a backup before deleting this table”.

AWS lambda HelloWorld!!!

AWS Lambda is an event-driven, serverless computing platform provided by Amazon as a part of the Amazon Web Services. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code. It was introduced in November 2014.

Function as a Service — FAAS (Server less)

In this tutorial, we are taking an existing blueprint hello world example to explore lambda. 

AWS Lambda provides you with computing power in the cloud by allowing you to execute code without standing up or managing servers.

AWS Lambda is offer service to run code without thinking about the server and pay only for the compute time you consume.

Topics Covered:-

  • Author a Lambda function using Node.js via the aws management console
  • Test a Lambda function via the aws console

Tips

  • Lambda is found under the Compute section on the AWS Management Console.
  • Lambdas have a time limit of 15 minutes.
  • The code you run on AWS Lambda is called a “Lambda function.”
  • Lambda code can be triggered by other AWS services.
  • AWS Lambda supports Java, Go, PowerShell, Node.js, C#/.NET, Python, and Ruby. There is a Runtime API that allows you to use other programming languages to author your functions.
  • Lambda code can be authored via the management console.

Go to Lambda →Click on create function → in search select Runtime and runtime environment is nodejs you can select what you prefer.

Then select the hello-world blueprint.

Steps:-

  1. Create a Lambda Function:- Enter function name. Execution role select “Choose or create an execution role” 

2. Click on create function:- 

3. Click on the Test button to provide some test data:- provide some test data and click on creat button

Once this is done scroll down, you will see code editor and on top of that “Test” button is there click on it and you will see the result on the console.

This is very basic let us do one thing modify the existing function line no 5 with below line of code and save 

body: JSON.stringify('Hello ' + event.key1 + ' from Maheshwar!'),

Scroll down to the “Basic settings” section.

  • For the Description, enter “My Function”.
  • Change the “TimeOut” from 3 seconds to 5 minutes.
  • Click the “Save” button in the upper right-hand corner.

Now Test your code changes and enjoy!!