Amazon DynamoDB - Part1
Amazon Cloud Concepts Learning --> Day20
Amazon DynamoDB
Fully managed schema-less NOSQL database service.
Non-Relational, Key/value and document store.
It has Four 9s. (99.99%) of availability (5 in case of global tables)
Data is synchronously replicated across 3 different availability zones within a single region.
Data is stored in SSD Storage.
Offers encryption at rest.
Multi-AZ Redundancy and Cross-Region Replication option is available.
Session state data may be stored using DynamoDB.
As a serverless service, DynamoDB requires no provisioning or managing of instances.
DynamoDB is made up of
Tables --> Tables are collection of items.
Items --> basically a row (Maximum record size is 400KB) Partition key and Sort Key make up the Primary Key used access items in the tables (primary key is also known as Composite Key when both attributes are present - you can also specify a PK without SK).
Attributes --> the information associated with that item (columns).
Since DynamoDB is schema less, once you defined the structure of the primary key (Partition and Sort Keys), every item/row can have its own structure.
TTL (TimeToLive) defines when items in a table expire and they will be automatically deleted.
DynamoDB Backups and Restore
On demand backups are non-expiring and may be planned. They are completed in a matter of seconds, with no effect on table availability or performance.
On demand backups are non-expiring and may be planned. They are completed in a matter of seconds, with no effect on table availability or performance.
DynamoDB Streams
Whenever a record is added, changed, or withdrawn from a DynamoDB database, it is written to the stream and kept there for a maximum of 24 hours.
Streams enable the recording of an item-level change sequence that is time-ordered.
You can construct a trigger—code that executes automatically whenever an event of interest occurs in a stream—by combining DynamoDB Streams with AWS Lambda.
In addition, the event timestamp, the table name, and other metadata are included in each stream record.
Secondary Indexes
Permits you to do searches against the primary key in addition to queries against the data in the table using an alternate key.
A table may have one or more secondary indexes created for it.
Two kinds of Indexes
Global Secondary Index --> An index with a partition key and sort key that can be different from those on the table.
Local Secondary Index --> An index that has the same partition key as the table, but a different sort key.
There is a default quota of 20 global secondary indexes and 5 local secondary indexes for each DynamoDB table.
DynamoDB Consistency
The user can choose between the two consistency models offered by DynamoDB when reading data: eventually consistent and strongly consistent.
Eventually Consistent Reads
The read throughput is maximized by the eventual consistency option.
Usually, consistency is achieved across all copies in a few of seconds.
Nevertheless, the outcomes of a recently finished writing might not be reflected in an eventually consistent read.
After a little while, repeating a read ought to yield the updated data.
By default, DynamoDB employs eventually consistent reads.
Strongly Consistent Reads
A very consistent read yields a result that includes all writes that were answered successfully before the read.
Strongly consistent reads are only supported on tables and local secondary indexes.
Strongly consistent reads use more throughput capacity than eventually consistent reads.
Read operations such as GetItem, Query, and Scan provide an optional ConsistentRead parameter.
"Thank you for reading! If you found this blog helpful, don't forget to subscribe and follow for more insightful content. Your support keeps me motivated to bring you valuable insights. Stay updated and never miss out on our latest posts. Feel free to leave comments or suggestions for future topics. Happy learning!"
https://awslearner.hashnode.dev/amazon-web-services-via-category
Subscribe to my newsletter
Read articles from Utkarsh Rastogi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Utkarsh Rastogi
Utkarsh Rastogi
👨💻 AWS Cloud Engineer | Around 6 years of Corporate Experience | Driving Innovation in Cloud Solutions 🔧 Day-to-Day Tasks: Specialize in creating AWS infrastructure for Migration Projects. Leveraging services such as S3, SNS, SQS, IAM, Lambda, System Manager, Kinesis, OpenSearch, Cognito, Storage Gateway, Cloud Watch, API Gateway, AWS Event Scheduler, Secret Manager, ECS, Application Load Balancer, VPC among others. Additionally, I excel in crafting Splunk Dashboards and implementing alerting mechanisms for Cloud Watch logs to monitor failures. My approach involves constructing AWS infrastructure using the Serverless framework and Cloud Formation templates, while automating tasks through Boto3 (Python Scripting) Lambdas. 🎯 Passion: I am deeply passionate about continuously learning new technologies and eagerly anticipate the transformative impact of cloud computing on the tech landscape. 📧 Connect: Feel free to reach out to me at awslearningoals@gmail.com. Let's connect and explore potential collaborations! https://www.linkedin.com/in/rastogiutkarsh/