2

Amazon DynamoDB For The .NET Developer

 1 year ago
source link: https://www.rahulpnath.com/blog/amazon-dynamodb-dotnet-developer/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

This article is sponsored by AWS and is part of my AWS Series.

DynamoDB is a cloud-hosted NoSQL database provided by Amazon Web Services (AWS). DynamoDB provides reliable performance, a managed experience, and a convenient API access to interact with it.

This blog post is a collection of other posts that covers various aspects of Amazon DynamoDB and other services you can integrate with when building serverless applications.

Getting Started With Amazon DynamoDB

If you are completely new to AWS DynamoDB and just getting started, check out my getting started article below.

aws_dynamodb.jpg

It covers an introduction to DynamoDB, an understanding of how to create tables, and doing basic Create Read, Update, and Delete (CRUD) operations from the .NET application using the DynamoDB SDK.

Running DynamoDB on Your Dev Machine

DynamoDB Local is available as a download that is useful for developing and test applications without accessing the DynamoDB Web Service. The database is self-contained and runs on your computer.

laptop_developer.jpg

Check out the above article, where I walk through in detail how to set up a local instance of DynamoDB, access it from applications, and the different modes it supports. I also cover the various GUI tools that can interact with the locally installed database instance.

Retrieving Data From DynamoDB

To retrieve data from DynamoDB, you have multiple querying options.

The Query operation is ideal for retrieving items that match specific criteria using partition and sort key values. Another option is the Scan operation, which filters results based on conditions but can be costly and impact performance for large tables.

As a rule of thumb, when querying data, you can consider that each record that you retrieve from the database has a direct cost attached to it. Limiting the items you retrieve has a direct impact on saving cost and also performance. Pagination helps with breaking down the items into smaller groups and loading them as required.

To learn more about different ways you can query DynamoDB and how to paginate data in your requests, check out the posts below.

Writing Data To DynamoDB

DynamoDB provides two primary methods to write/modify data in a table: PutItem and UpdateItem. These are part of the Low-Level API IAmazonDynamoDB. The High-Level API, IDynamoDBContext wraps the two methods into a single SaveAsync method.

By default, when using the .NET DynamoDB SDK, it serializes .NET classes, with a default constructor, as JSON objects. However, you can customize the data written into DynamoDB using Custom Converters.

When writing data to DynamoDB, it is essential to ensure data consistency when multiple users or applications access the same data simultaneously. Check out the below articles to explore the different ways you can ensure data consistency when writing to DynamoDB.

DynamoDB and AWS Lambda

DynamoDB Triggers allow you to automatically invoke a Lambda function in response to specific actions on a DynamoDB table, such as item updates, inserts, or deletions.

DynamoDB Triggers enable you to build powerful and scalable applications that can automatically respond to changes in your DynamoDB tables without the need for any polling or manual intervention.

Check out the below articles to understand more about DynamoDB and AWS Lambda Triggers.

I hope this helps you get a good understanding of Amazon DynamoDB, and how to read/write to tables and integrate it with other AWS Services from your .NET application.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK