SlideShare a Scribd company logo
DynamoDB Database
Integrate with Spring-boot
● Amazon DynamoDB is a serverless, NoSQL, fully managed database service with single-digit
millisecond response times at any scale, enabling to develop and run modern applications.
● It is a "schema-less" or "schema-flexible" database. the term "schema-less" means that don't
need to define a fixed schema for data before storing it. We can insert and retrieve data
without the need for a predefined table structure.
● What are ways to implement DynamoDB in Spring Boot Application
1. Combine Spring Data REST with Spring Data DynamoDB for RESTful endpoints.
2. Combine Spring Data JPA with DynamoDB Local for local development and testing.
3. Spring Cloud with AWS CloudFormation.
What is DynamoDB
DynamoDB Database Setup With AWS
1. AWS Identity and Access Management (IAM) Select It Manage Access to AWS Resources
2. Create Particular Group and Create User
3. While Creating a new user add the group at that time using “Permission Option”
4. The creation of IAM groups and users, along with the assignment of users to groups, enhances
security, simplifies administration, and promotes scalability and consistency in managing AWS
resources and access.
5. Create Access Key In User Section
Steps to Implement DynamoDB Database With AWS
6. Review it Check Permission Summary
7. Create Database In DynamoDB
8. Setup Table name, Partition Key, Sort Key, with Required Data Types and Select Tables Settings.
9. Use the Required Properties like Access key Id, Secret Access Key in Sprint-Boot Configuration Class.
1. Scalable NoSQL Database: DynamoDB is a fully managed NoSQL database service by AWS, designed for
seamless
scalability to handle varying workloads.
2. High Performance: Known for high performance and low-latency, DynamoDB is capable of handling
millions of requests per second, making it suitable for applications with demanding performance needs.
3. Use Case for NoSQL: DynamoDB is an excellent choice for scenarios requiring a NoSQL database, such
as applications dealing with unstructured or semi-structured data, rapid development cycles, and
horizontal scaling.
4. Faster than Traditional Databases: DynamoDB's distributed architecture and optimized storage make it
faster than traditional relational databases, especially for read and write-intensive workloads
- especially for read and write-intensive workloads. For instance, in comparison to databases like MySQL or
PostgreSQL, DynamoDB can exhibit superior performance due to its ability to horizontally scale and
distribute data across multiple nodes seamlessly. This becomes particularly advantageous in scenarios
where high throughput and low-latency access to data are critical requirements
Introduction of DynamoDB with SpringBoot Application
5. Key-Value and Document Store: DynamoDB's support for key-value and document data models provides
developers
with the flexibility to choose the most suitable approach based on the nature of the data application
requirements.
- Key-Value Store: Each item in the database is uniquely identified by a primary key, which can be a
single attribute
(simple key) or a combination of attributes (composite key). This key-value structure allows for fast and
efficient
retrieval of data based on the of data based on the unique identifier.
- Document Store: DynamoDB goes beyond the traditional key-value paradigm by supporting complex
data structures
within each item. Items can contain nested attributes and arrays, essentially allowing DynamoDB to
function as a
This is particularly useful for scenarios where data is hierarchical or nested, such as JSON-like
documents.
6. Supported Query Operations: DynamoDB supports a variety of query operations, including GetItem,
PutItem, DeleteItem, and Query. Its flexible API allows efficient retrieval and manipulation of data.
7. Use Case for NoSQL: DynamoDB is an excellent choice for scenarios requiring a NoSQL database, such
There are several limitations For DynamoDB
1. Provisioned Throughput Constraints: DynamoDB requires you to provision read and write throughput
capacity in advance. If your workload experiences unpredictable spikes or if you have varying traffic
patterns, adjusting provisioned throughput might become challenging.
2. Item Size Limitation: Each item in a DynamoDB table has a size limitation of 400 KB. If your project deals
with larger items, you may need to design the data model carefully or consider alternative storage
solutions for larger objects.
3. Limited Indexing and Query Flexibility: DynamoDB allows for global and local secondary indexes, but
their use is subject to certain limitations with constraints. Queries are based on primary key attributes
and indexed attributes. Complex querying involving multiple attributes or complex conditions may
require additional considerations or might be better suited for other database solutions.
4. No Support for Joins: DynamoDB does not support relational joins between tables. If your project
requires complex relational data modeling and querying, a traditional relational database might be
more suitable.
5. Limited Atomic Operations: DynamoDB supports atomic counters, but there are limitations on other
atomic operations. If your project heavily relies on specific atomic operations, these limitations should
be taken into account.
When connecting DynamoDB with a Spring Boot app, some difficulties may be
face include:
1. Configuring the correct network settings between Spring Boot and
DynamoDB: Need to ensure that the Spring Boot app can communicate with
the DynamoDB Aws.
2. Signature expired: 20170517T062414Z is now earlier than 20170517T062840Z
(20170517T063340Z - 5 min.) - Local Machine and AWS Console time Not
Match
3. [Request processing failed:
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingExc
eption: Employee; no mapping for HASH key] with root cause – Check Api Key,
table name with Partition Key, Lombok, aws-java-sdk-dynamodb Version
Managed NoSQL Database:
DynamoDB is a fully managed
NoSQL database service
provided by AWS. When we use
DynamoDB with a Spring Boot
application, for offload the
operational overhead of
managing and scaling the
database to AWS. don't need to
worry about tasks such as
hardware provisioning, setup,
configuration, replication, or
software patching.
Scalability and Performance:
It automatically scales to
handle varying workloads and
can accommodate massive
amounts of data and traffic. As
your Spring Boot application
grows, DynamoDB scales
horizontally to handle
increased read and write
throughput.
Why We Use DynamoDB And Integrate With AWS
Integrated Development with
Spring Data:
Spring Data provides a unified
and consistent programming
model for data access in Spring
applications, we can leverage
Spring Data DynamoDB It
allows you to use familiar
Spring Data repository
interfaces and annotations to
perform CRUD (Create, Read,
Update, Delete) operations on
DynamoDB entities.
Streamlining the Development Process
● DynamoDB Scalability and flexibility are key features that contribute to the
significance of Amazon DynamoDB, a managed NoSQL database service offered
by Amazon Web Services (AWS).
Importance of Scalability and Flexibility
1. Scalability: As our application grows and our user base increases DynamoDB is designed
to handle varying and unpredictable workloads. As the demand on your application grows or
decreases, DynamoDB can automatically scale to adapt to changing needs. This elasticity
ensures that your application remains responsive and performs well, even under varying
levels of traffic.
2.Flexibility: DynamoDB's schema-less nature and flexibility in data modeling enable easy
adaptation to evolving data structures. Developers can add or remove fields from items
within a table without the need for a predefined schema. This flexibility is particularly
valuable in scenarios where the data model is subject to change or when different items
within the same table have distinct attributes. It allows for agile development and
DynamoDB Database Integration.pptx it's dynamodb databse related stufs
DynamoDB Annotation Specific to AWS SDK For Java
1. @DynamoDBHashKey: This annotation is used to mark a field as the hash key for a DynamoDB
table. In DynamoDB, each table must have a primary key, and it can be composed of one or two
attributes: the hash key (mandatory) and the range key (optional). The hash key uniquely identifies
an item in the table.
2. @DynamoDBAttribute: This annotation is used to mark a field as an attribute in the DynamoDB
table. All fields that are persisted to DynamoDB must be annotated with @DynamoDBAttribute.
3. @DynamoDBDocument: Department Entity Class Assuming Department is another class, it is likely
a nested or complex type. In DynamoDB, you can use the @DynamoDBDocument annotation to
mark a field as a complex object, allowing you to store nested structures.
DynamoDB Query Language
• Unlike Structured Query Language (SQL), DynamoDB queries use a Javascript Object
Notation (JSON) format to structure its queries.
• DynamoDB is a key-value NoSQL database. Primarily This makes it Amazon’s preferred
database for simple and fast data models.
• While DynamoDB models data in JSON format, allowing it to serve in document use
cases Amazon recommends users to its Amazon Document DB, which is designed-for-
purpose as a document store, and is also compatible with the widely-adopted MongoDB
API. For example, DynamoDB doesn’t store data internally as JSON. It only uses JSON as
a transport method.
• Amazon DynamoDB doesn't store data internally as JSON. Instead, DynamoDB stores
data in a binary format called "DynamoDB format" or "marshalled format." This format
is proprietary and optimized for efficient storage and retrieval within the DynamoDB
service.
Command For Windows CMD
1) aws dynamodb create-table ^
--table-name Music ^
--attribute-definitions ^
AttributeName=Artist,AttributeType=S ^
AttributeName=SongTitle,AttributeType=S ^
--key-schema ^
AttributeName=Artist,KeyType=HASH ^
AttributeName=SongTitle,KeyType=RANGE ^
--provisioned-throughput ^
ReadCapacityUnits=5,WriteCapacityUnits=5 ^
--table-class STANDARD
2) aws dynamodb update-continuous-backups 
--table-name Music 
--point-in-time-recovery-specification
PointInTimeRecoveryEnabled=true
--key-schema: Specifies the
primary key of the table. In
DynamoDB, the primary key
can be composed of one or
two attributes. Here, "Artist" is
the HASH key (partition key),
and "SongTitle" is the RANGE
key (sort key).
-- Specifies the configuration
for point-in-time recovery
(PITR). PITR allows you to
restore a table to any point in
time during the last 35 days.
MongoDB DynamoDB
Source MongoDB is open-source and can be deployed
anywhere in most clouds and/or on premises.
DynamoDB is from the AWS ecosystem and can
only be used within AWS.
Management MongoDB can either be self-managed or fully
managed with the MongoDB Atlas database as a
service.
DynamoDB is a fully managed solution. Amazon
handles all server updates, patch updates, and
hardware provisioning.
Security Developers need to spend extra time upfront
reconfiguring security on MongoDB, especially
when self-managed. This is because it runs with
defaults permitting unrestricted and direct access to
data without authentication. MongoDB Atlas
requires setup of authentication and network access
via IP access controls or VPC peering.
Security for DynamoDB starts out restrictive and
incorporates with AWS IAM Policy infrastructure.
Database structure MongoDB’s database structure is made of JSON-like
documents comprising collections, keys, values,
and documents. Documents can contain nested
documents.
DynamoDB’s database structure supports either
blobs or documents as values.
Index use MongoDB supports up to 64 mutable indexes per
collection, allowing the document’s structure to
change dynamically.
DynamoDB supports up to 20 mutable global
indexes per table, which are not compatible with
underlying data, and up to 5 local indexes which
cannot be modified after table creation.
Programming language MongoDB is written in C++ and supports
programming languages like C, C++, Go, Java,
JavaScript, PHP, Perl, Ruby, Python and more.
DynamoDB supports programming languages like
Java, JavaScript, Node.js, .NET, PHP and more.
Data type and size restriction MongoDB supports various data types, and
allows document sizes of up to 16MB.
DynamoDB has limited support for data types,
and allows item sizes of up to 400 KB.
Industry use Companies use MongoDB for mobile apps and
content management systems (CMSs). MongoDB
is also excellent for scalability and caching.
The gaming and Internet of things (IoT) industries
widely use DynamoDB.
Querying MongoDB has a rich query language. You can
apply it in various ways: single keys, ranges,
graph transversals, joins and more.
DynamoDB’s querying is only available in local
secondary indexes (LSI) and global secondary
indexes (GSI).
PartiQL - SQL-compatible query language for Amazon
DynamoDB
1. Amazon DynamoDB supports PartiQL, a SQL-compatible query language, to select, insert, update, and
delete data in Amazon DynamoDB. Using PartiQL, you can easily interact with DynamoDB tables and run
ad hoc queries using the AWS Management Console, NoSQL Workbench, AWS Command Line Interface,
and DynamoDB APIs for PartiQL.
2. Support Almost all required Datatypes that Generally use for Creating Schema’s
3. DML and DDL Operations: PartiQL supports both Data Manipulation Language (DML) and Data Definition
Language (DDL) operations. This includes querying data as well as creating, altering, and dropping
tables.
4. Joins and Unions and Aggregation Functions: PartiQL supports aggregation functions like COUNT, SUM,
AVG, etc.
5. Integration with DynamoDB SDKs: PartiQL is integrated into the AWS SDKs for DynamoDB, allowing
developers to use it with existing applications written in Java, Python, Node.js, etc.
6. Transparent Interaction with Existing Data: PartiQL can be used alongside existing DynamoDB APIs,
providing a seamless experience for developers already working with DynamoDB.
Why we not continue with MongoDB Database
1.Operational Complexity:
•Increased operational overhead due to the need to manage and maintain the MongoDB
cluster within the Kubernetes environment.
2.Maintenance:
•Responsible for handling MongoDB upgrades, patches, and security updates, which may
result in planned downtime.
3.Expertise Requirement:
•Requires expertise in both MongoDB and Kubernetes and ongoing monitoring and
maintenance efforts are crucial.
4.Security Concerns:
•Full responsibility for configuring network security, encryption, and access controls, which
can be challenging and prone to errors.
5.Lack of Managed Features:
•Missing out on managed features such as automated backups, scaling, and monitoring that
are available in dedicated managed MongoDB services.
6.Potential for Downtime:
•Increased risk of downtime due to potential misconfigurations or issues with the self-
managed setup, particularly during maintenance activities or upgrades.
• In conclusion, while self-hosting MongoDB in a Kubernetes cluster provides flexibility, it
comes with increased complexity and operational responsibilities. Opting for a managed
MongoDB service can alleviate these challenges, providing a more streamlined and reliable
experience with built-in features and expert support. The choice ultimately depends on
factors such as your team's expertise, resource availability, and the level of control and
customization required for your MongoDB deployment.
• Confluence Page
Global Secondary Indexes (GSIs)
Enabling efficient retrieval of non-primary key data Cost
implications and query pattern considerations
DynamoDB Streams
Near-instantaneous data ingestion and processing pipelines
Eventual consistency vs. fine-grained control
Transactions
Atomic data consistency across tables or items
Transaction Coordination API (TCA) vs. DynamoDB Streams
Advanced Querying
Complex queries over large datasets using expressions, filters,
and conditions
Advanced Topic
DynamoDB Database Integration.pptx it's dynamodb databse related stufs

More Related Content

Similar to DynamoDB Database Integration.pptx it's dynamodb databse related stufs (20)

PPTX
Compare DynamoDB vs. MongoDB
Amar Das
 
PPTX
DBMbsbsiisnsbshsjsbshsjwnsnS_PPT final.pptx
aryanrajeshjadhao
 
PPT
CO3-Session-6(AmazonDynamoDB).ppt
AbhignaReddy30
 
PPTX
Introduction to aws dynamo db
Omid Vahdaty
 
PPTX
Dynamo db
Parag Patil
 
PDF
AWS DynamoDB
Suman Debnath
 
PPTX
brock_delong_all_your_database_final.pptx
AWS Chicago
 
PDF
2017 AWS DB Day | Amazon DynamoDB 서비스, 개요 및 신규 기능 소개
Amazon Web Services Korea
 
PPTX
Dynamodb Presentation
advaitdeo
 
PDF
Dynamodb tutorial
HarikaReddy115
 
PDF
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon Web Services Korea
 
PDF
Amazon DynamoDB Lessen's Learned by Beginner
Hirokazu Tokuno
 
PDF
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
ScyllaDB
 
PPTX
The Rise Of Scanamo: Async Access For DynamoDB In Scala
Knoldus Inc.
 
PDF
Alternator webinar september 2019
Nadav Har'El
 
PDF
Dynamo and NoSQL Databases
Amir Payberah
 
ODP
The Rise of Scanamo: Async Access for DynamoDB in Scala
Knoldus Inc.
 
PDF
Conhecendo o DynamoDB
Amazon Web Services LATAM
 
PPTX
How to Choose The Right Database on AWS - Berlin Summit - 2019
Randall Hunt
 
PDF
Exploring ScyllaDB’s DynamoDB-Compatible API by Guilherme Nogueira & Nadav Ha...
ScyllaDB
 
Compare DynamoDB vs. MongoDB
Amar Das
 
DBMbsbsiisnsbshsjsbshsjwnsnS_PPT final.pptx
aryanrajeshjadhao
 
CO3-Session-6(AmazonDynamoDB).ppt
AbhignaReddy30
 
Introduction to aws dynamo db
Omid Vahdaty
 
Dynamo db
Parag Patil
 
AWS DynamoDB
Suman Debnath
 
brock_delong_all_your_database_final.pptx
AWS Chicago
 
2017 AWS DB Day | Amazon DynamoDB 서비스, 개요 및 신규 기능 소개
Amazon Web Services Korea
 
Dynamodb Presentation
advaitdeo
 
Dynamodb tutorial
HarikaReddy115
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon Web Services Korea
 
Amazon DynamoDB Lessen's Learned by Beginner
Hirokazu Tokuno
 
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
ScyllaDB
 
The Rise Of Scanamo: Async Access For DynamoDB In Scala
Knoldus Inc.
 
Alternator webinar september 2019
Nadav Har'El
 
Dynamo and NoSQL Databases
Amir Payberah
 
The Rise of Scanamo: Async Access for DynamoDB in Scala
Knoldus Inc.
 
Conhecendo o DynamoDB
Amazon Web Services LATAM
 
How to Choose The Right Database on AWS - Berlin Summit - 2019
Randall Hunt
 
Exploring ScyllaDB’s DynamoDB-Compatible API by Guilherme Nogueira & Nadav Ha...
ScyllaDB
 

Recently uploaded (20)

PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
PPTX
darshai cross section and river section analysis
muk7971
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PDF
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PDF
Bachelor of information technology syll
SudarsanAssistantPro
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
darshai cross section and river section analysis
muk7971
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
Bachelor of information technology syll
SudarsanAssistantPro
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Ad

DynamoDB Database Integration.pptx it's dynamodb databse related stufs

  • 2. ● Amazon DynamoDB is a serverless, NoSQL, fully managed database service with single-digit millisecond response times at any scale, enabling to develop and run modern applications. ● It is a "schema-less" or "schema-flexible" database. the term "schema-less" means that don't need to define a fixed schema for data before storing it. We can insert and retrieve data without the need for a predefined table structure. ● What are ways to implement DynamoDB in Spring Boot Application 1. Combine Spring Data REST with Spring Data DynamoDB for RESTful endpoints. 2. Combine Spring Data JPA with DynamoDB Local for local development and testing. 3. Spring Cloud with AWS CloudFormation. What is DynamoDB
  • 3. DynamoDB Database Setup With AWS 1. AWS Identity and Access Management (IAM) Select It Manage Access to AWS Resources 2. Create Particular Group and Create User 3. While Creating a new user add the group at that time using “Permission Option” 4. The creation of IAM groups and users, along with the assignment of users to groups, enhances security, simplifies administration, and promotes scalability and consistency in managing AWS resources and access. 5. Create Access Key In User Section Steps to Implement DynamoDB Database With AWS
  • 4. 6. Review it Check Permission Summary 7. Create Database In DynamoDB 8. Setup Table name, Partition Key, Sort Key, with Required Data Types and Select Tables Settings. 9. Use the Required Properties like Access key Id, Secret Access Key in Sprint-Boot Configuration Class.
  • 5. 1. Scalable NoSQL Database: DynamoDB is a fully managed NoSQL database service by AWS, designed for seamless scalability to handle varying workloads. 2. High Performance: Known for high performance and low-latency, DynamoDB is capable of handling millions of requests per second, making it suitable for applications with demanding performance needs. 3. Use Case for NoSQL: DynamoDB is an excellent choice for scenarios requiring a NoSQL database, such as applications dealing with unstructured or semi-structured data, rapid development cycles, and horizontal scaling. 4. Faster than Traditional Databases: DynamoDB's distributed architecture and optimized storage make it faster than traditional relational databases, especially for read and write-intensive workloads - especially for read and write-intensive workloads. For instance, in comparison to databases like MySQL or PostgreSQL, DynamoDB can exhibit superior performance due to its ability to horizontally scale and distribute data across multiple nodes seamlessly. This becomes particularly advantageous in scenarios where high throughput and low-latency access to data are critical requirements Introduction of DynamoDB with SpringBoot Application
  • 6. 5. Key-Value and Document Store: DynamoDB's support for key-value and document data models provides developers with the flexibility to choose the most suitable approach based on the nature of the data application requirements. - Key-Value Store: Each item in the database is uniquely identified by a primary key, which can be a single attribute (simple key) or a combination of attributes (composite key). This key-value structure allows for fast and efficient retrieval of data based on the of data based on the unique identifier. - Document Store: DynamoDB goes beyond the traditional key-value paradigm by supporting complex data structures within each item. Items can contain nested attributes and arrays, essentially allowing DynamoDB to function as a This is particularly useful for scenarios where data is hierarchical or nested, such as JSON-like documents. 6. Supported Query Operations: DynamoDB supports a variety of query operations, including GetItem, PutItem, DeleteItem, and Query. Its flexible API allows efficient retrieval and manipulation of data. 7. Use Case for NoSQL: DynamoDB is an excellent choice for scenarios requiring a NoSQL database, such
  • 7. There are several limitations For DynamoDB 1. Provisioned Throughput Constraints: DynamoDB requires you to provision read and write throughput capacity in advance. If your workload experiences unpredictable spikes or if you have varying traffic patterns, adjusting provisioned throughput might become challenging. 2. Item Size Limitation: Each item in a DynamoDB table has a size limitation of 400 KB. If your project deals with larger items, you may need to design the data model carefully or consider alternative storage solutions for larger objects. 3. Limited Indexing and Query Flexibility: DynamoDB allows for global and local secondary indexes, but their use is subject to certain limitations with constraints. Queries are based on primary key attributes and indexed attributes. Complex querying involving multiple attributes or complex conditions may require additional considerations or might be better suited for other database solutions. 4. No Support for Joins: DynamoDB does not support relational joins between tables. If your project requires complex relational data modeling and querying, a traditional relational database might be more suitable. 5. Limited Atomic Operations: DynamoDB supports atomic counters, but there are limitations on other atomic operations. If your project heavily relies on specific atomic operations, these limitations should be taken into account.
  • 8. When connecting DynamoDB with a Spring Boot app, some difficulties may be face include: 1. Configuring the correct network settings between Spring Boot and DynamoDB: Need to ensure that the Spring Boot app can communicate with the DynamoDB Aws. 2. Signature expired: 20170517T062414Z is now earlier than 20170517T062840Z (20170517T063340Z - 5 min.) - Local Machine and AWS Console time Not Match 3. [Request processing failed: com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingExc eption: Employee; no mapping for HASH key] with root cause – Check Api Key, table name with Partition Key, Lombok, aws-java-sdk-dynamodb Version
  • 9. Managed NoSQL Database: DynamoDB is a fully managed NoSQL database service provided by AWS. When we use DynamoDB with a Spring Boot application, for offload the operational overhead of managing and scaling the database to AWS. don't need to worry about tasks such as hardware provisioning, setup, configuration, replication, or software patching. Scalability and Performance: It automatically scales to handle varying workloads and can accommodate massive amounts of data and traffic. As your Spring Boot application grows, DynamoDB scales horizontally to handle increased read and write throughput. Why We Use DynamoDB And Integrate With AWS Integrated Development with Spring Data: Spring Data provides a unified and consistent programming model for data access in Spring applications, we can leverage Spring Data DynamoDB It allows you to use familiar Spring Data repository interfaces and annotations to perform CRUD (Create, Read, Update, Delete) operations on DynamoDB entities.
  • 11. ● DynamoDB Scalability and flexibility are key features that contribute to the significance of Amazon DynamoDB, a managed NoSQL database service offered by Amazon Web Services (AWS). Importance of Scalability and Flexibility 1. Scalability: As our application grows and our user base increases DynamoDB is designed to handle varying and unpredictable workloads. As the demand on your application grows or decreases, DynamoDB can automatically scale to adapt to changing needs. This elasticity ensures that your application remains responsive and performs well, even under varying levels of traffic. 2.Flexibility: DynamoDB's schema-less nature and flexibility in data modeling enable easy adaptation to evolving data structures. Developers can add or remove fields from items within a table without the need for a predefined schema. This flexibility is particularly valuable in scenarios where the data model is subject to change or when different items within the same table have distinct attributes. It allows for agile development and
  • 13. DynamoDB Annotation Specific to AWS SDK For Java 1. @DynamoDBHashKey: This annotation is used to mark a field as the hash key for a DynamoDB table. In DynamoDB, each table must have a primary key, and it can be composed of one or two attributes: the hash key (mandatory) and the range key (optional). The hash key uniquely identifies an item in the table. 2. @DynamoDBAttribute: This annotation is used to mark a field as an attribute in the DynamoDB table. All fields that are persisted to DynamoDB must be annotated with @DynamoDBAttribute. 3. @DynamoDBDocument: Department Entity Class Assuming Department is another class, it is likely a nested or complex type. In DynamoDB, you can use the @DynamoDBDocument annotation to mark a field as a complex object, allowing you to store nested structures.
  • 14. DynamoDB Query Language • Unlike Structured Query Language (SQL), DynamoDB queries use a Javascript Object Notation (JSON) format to structure its queries. • DynamoDB is a key-value NoSQL database. Primarily This makes it Amazon’s preferred database for simple and fast data models. • While DynamoDB models data in JSON format, allowing it to serve in document use cases Amazon recommends users to its Amazon Document DB, which is designed-for- purpose as a document store, and is also compatible with the widely-adopted MongoDB API. For example, DynamoDB doesn’t store data internally as JSON. It only uses JSON as a transport method. • Amazon DynamoDB doesn't store data internally as JSON. Instead, DynamoDB stores data in a binary format called "DynamoDB format" or "marshalled format." This format is proprietary and optimized for efficient storage and retrieval within the DynamoDB service.
  • 15. Command For Windows CMD 1) aws dynamodb create-table ^ --table-name Music ^ --attribute-definitions ^ AttributeName=Artist,AttributeType=S ^ AttributeName=SongTitle,AttributeType=S ^ --key-schema ^ AttributeName=Artist,KeyType=HASH ^ AttributeName=SongTitle,KeyType=RANGE ^ --provisioned-throughput ^ ReadCapacityUnits=5,WriteCapacityUnits=5 ^ --table-class STANDARD 2) aws dynamodb update-continuous-backups --table-name Music --point-in-time-recovery-specification PointInTimeRecoveryEnabled=true --key-schema: Specifies the primary key of the table. In DynamoDB, the primary key can be composed of one or two attributes. Here, "Artist" is the HASH key (partition key), and "SongTitle" is the RANGE key (sort key). -- Specifies the configuration for point-in-time recovery (PITR). PITR allows you to restore a table to any point in time during the last 35 days.
  • 16. MongoDB DynamoDB Source MongoDB is open-source and can be deployed anywhere in most clouds and/or on premises. DynamoDB is from the AWS ecosystem and can only be used within AWS. Management MongoDB can either be self-managed or fully managed with the MongoDB Atlas database as a service. DynamoDB is a fully managed solution. Amazon handles all server updates, patch updates, and hardware provisioning. Security Developers need to spend extra time upfront reconfiguring security on MongoDB, especially when self-managed. This is because it runs with defaults permitting unrestricted and direct access to data without authentication. MongoDB Atlas requires setup of authentication and network access via IP access controls or VPC peering. Security for DynamoDB starts out restrictive and incorporates with AWS IAM Policy infrastructure. Database structure MongoDB’s database structure is made of JSON-like documents comprising collections, keys, values, and documents. Documents can contain nested documents. DynamoDB’s database structure supports either blobs or documents as values.
  • 17. Index use MongoDB supports up to 64 mutable indexes per collection, allowing the document’s structure to change dynamically. DynamoDB supports up to 20 mutable global indexes per table, which are not compatible with underlying data, and up to 5 local indexes which cannot be modified after table creation. Programming language MongoDB is written in C++ and supports programming languages like C, C++, Go, Java, JavaScript, PHP, Perl, Ruby, Python and more. DynamoDB supports programming languages like Java, JavaScript, Node.js, .NET, PHP and more. Data type and size restriction MongoDB supports various data types, and allows document sizes of up to 16MB. DynamoDB has limited support for data types, and allows item sizes of up to 400 KB. Industry use Companies use MongoDB for mobile apps and content management systems (CMSs). MongoDB is also excellent for scalability and caching. The gaming and Internet of things (IoT) industries widely use DynamoDB. Querying MongoDB has a rich query language. You can apply it in various ways: single keys, ranges, graph transversals, joins and more. DynamoDB’s querying is only available in local secondary indexes (LSI) and global secondary indexes (GSI).
  • 18. PartiQL - SQL-compatible query language for Amazon DynamoDB 1. Amazon DynamoDB supports PartiQL, a SQL-compatible query language, to select, insert, update, and delete data in Amazon DynamoDB. Using PartiQL, you can easily interact with DynamoDB tables and run ad hoc queries using the AWS Management Console, NoSQL Workbench, AWS Command Line Interface, and DynamoDB APIs for PartiQL. 2. Support Almost all required Datatypes that Generally use for Creating Schema’s 3. DML and DDL Operations: PartiQL supports both Data Manipulation Language (DML) and Data Definition Language (DDL) operations. This includes querying data as well as creating, altering, and dropping tables. 4. Joins and Unions and Aggregation Functions: PartiQL supports aggregation functions like COUNT, SUM, AVG, etc. 5. Integration with DynamoDB SDKs: PartiQL is integrated into the AWS SDKs for DynamoDB, allowing developers to use it with existing applications written in Java, Python, Node.js, etc. 6. Transparent Interaction with Existing Data: PartiQL can be used alongside existing DynamoDB APIs, providing a seamless experience for developers already working with DynamoDB.
  • 19. Why we not continue with MongoDB Database 1.Operational Complexity: •Increased operational overhead due to the need to manage and maintain the MongoDB cluster within the Kubernetes environment. 2.Maintenance: •Responsible for handling MongoDB upgrades, patches, and security updates, which may result in planned downtime. 3.Expertise Requirement: •Requires expertise in both MongoDB and Kubernetes and ongoing monitoring and maintenance efforts are crucial. 4.Security Concerns: •Full responsibility for configuring network security, encryption, and access controls, which can be challenging and prone to errors. 5.Lack of Managed Features: •Missing out on managed features such as automated backups, scaling, and monitoring that are available in dedicated managed MongoDB services. 6.Potential for Downtime: •Increased risk of downtime due to potential misconfigurations or issues with the self- managed setup, particularly during maintenance activities or upgrades.
  • 20. • In conclusion, while self-hosting MongoDB in a Kubernetes cluster provides flexibility, it comes with increased complexity and operational responsibilities. Opting for a managed MongoDB service can alleviate these challenges, providing a more streamlined and reliable experience with built-in features and expert support. The choice ultimately depends on factors such as your team's expertise, resource availability, and the level of control and customization required for your MongoDB deployment. • Confluence Page
  • 21. Global Secondary Indexes (GSIs) Enabling efficient retrieval of non-primary key data Cost implications and query pattern considerations DynamoDB Streams Near-instantaneous data ingestion and processing pipelines Eventual consistency vs. fine-grained control Transactions Atomic data consistency across tables or items Transaction Coordination API (TCA) vs. DynamoDB Streams Advanced Querying Complex queries over large datasets using expressions, filters, and conditions Advanced Topic