Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying DynamoDB Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
DynamoDB Cookbook

DynamoDB Cookbook

By : Deshpande
3.9 (8)
close
close
DynamoDB Cookbook

DynamoDB Cookbook

3.9 (8)
By: Deshpande

Overview of this book

AWS DynamoDB is an excellent example of a production-ready NoSQL database. In recent years, DynamoDB has been able to attract many customers because of its features like high-availability, reliability and infinite scalability. DynamoDB can be easily integrated with massive data crunching tools like Hadoop /EMR, which is an essential part of this data-driven world and hence it is widely accepted. The cost and time-efficient design makes DynamoDB stand out amongst its peers. The design of DynamoDB is so neat and clean that it has inspired many NoSQL databases to simply follow it. This book will get your hands on some engineering best practices DynamoDB engineers use, which can be used in your day-to-day life to build robust and scalable applications. You will start by operating with DynamoDB tables and learn to manipulate items and manage indexes. You will also discover how to easily integrate applications with other AWS services like EMR, S3, CloudSearch, RedShift etc. A couple of chapters talk in detail about how to use DynamoDB as a backend database and hosting it on AWS ElasticBean. This book will also focus on security measures of DynamoDB as well by providing techniques on data encryption, masking etc. By the end of the book you’ll be adroit in designing web and mobile applications using DynamoDB and host it on cloud.
Table of Contents (12 chapters)
close
close
11
Index

Deleting an item from the DynamoDB table using the AWS SDK for .Net


Let's understand how to delete an item from the DynamoDB table using the AWS SDK for .Net.

Getting ready

To perform this operation, you can use the IDE of your choice.

How to do it…

Let's try to understand how to delete a stored item from the DynamoDB table using .Net:

  1. Create an instance of the DynamoDBClient class:

    AmazonDynamoDBClient client = new AmazonDynamoDBClient();
    string tableName = "productTable";
  2. Create a delete table request and specify the key of the item that you wish to delete from the table. Here, we will specify both the hash and range keys, as we have created a table with the composite primary keys:

    var request = new DeleteItemRequest
    {
        TableName = tableName,
        Key = new Dictionary<string,AttributeValue>() 
    { 
    { "id", new AttributeValue { N = "20" } },
       { "type", new AttributeValue { S = "phone" }}
    }
    };
  3. Invoke the DeleteItem method specifying the request:

    var response = client.DeleteItem(request);

How...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY