【AWS】Amazon DocumentDB (with MongoDB compatibility).pdf

blackangel52 70 views 58 slides Aug 01, 2024
Slide 1
Slide 1 of 58
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58

About This Presentation

• Introduction to DocumentDB
• Why DocumentDB?
• DocumentDB architecture
• Service overview
• Recent feature releases
• Pricing
• Q&A


Slide Content

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon DocumentDB
(with MongoDB compatibility)
Overview
Jason Plank
Sr. GTM Specialist
[email protected]
Douglas Bonser
Sr. Specialist SA
[email protected]

© 2023, Amazon Web Services, Inc. or its affiliates.
Agenda
2
•Introduction to DocumentDB
•Why DocumentDB?
•DocumentDBarchitecture
•Service overview
•Recent feature releases
•Pricing
•Q&A

© 2023, Amazon Web Services, Inc. or its affiliates.
Relational
databases
Non-relational
databases
Data
warehouses
Hadoop
and Spark
Redshift EMR
Operational
analytics
OpenSearch
Service
Aurora DynamoDB
Business
Intelligence
QuickSight
RDS DocumentDBElastiCache
Real-time
analytics
Managed
Streaming for
Apache Kafka
Keyspaces
RelationalKey-value In-memory
Comprehensive set of services across Databases & Analytics

© 2022, Amazon Web Services, Inc. or its affiliates. 4© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon DocumentDB
A scalable, highly durable and fully managed enterprise database service for operating JSON workloads
with ease
Supports millions of
document read requests
per second by scaling
compute and storage
independently.
Fast and scalable
Maintains high
availability and durability,
built-in security best
practices, and low-latency
global reads.
Automates hardware
provisioning, patching,
setup, backups, and other
database management
tasks.
Fully managed
Supports hundreds of APIs,
operators, and stages;
Applications, drivers, and
tools can be used with little
or no change.
MongoDB compatibleEnterprise ready

© 2022, Amazon Web Services, Inc. or its affiliates. 5© 2023, Amazon Web Services, Inc. or its affiliates. 5
eCommerce: Search RecommendationMedia: Content Management
Marketing Agency: Analytics
SaaS: Personalization
Profile Management
Technology: Various
Technology: IoT
eCommerce: Catalogs
https://aws.amazon.com/documentdb/customers/
Amazon DocumentDB customers across industries
Technology: Financial Services

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Document Databases
•Why Document DBs
•Use Cases
•Example Structure

© 2023, Amazon Web Services, Inc. or its affiliates.
Why document databases
7
•Data is stored in JSON-like
documents
•Documents map naturally to
how humans model data
•Flexible schema and indexing
•Expressive query language
built for documents (ad hoc
queries and aggregations)
Documents are first-class objects
in the database
{
id: 1,
name: "sue",
age: 26,
email: "[email protected]",
promotions: ["new user", "5%", "dog lover"],
memberDate: 2018-2-22,
shoppingCart: [
{product:"abc", quantity:2, cost:19.99},
{product:"edf", quantity:3, cost:2.99}
]
}
Document: Fields: Values

© 2023, Amazon Web Services, Inc. or its affiliates.
Industry Use Case –Examples
8
Catalogs
Content
management
Mobile and web
applications
IoT Profile
management
Personalization
Great for complex documents that are dynamic and may
require ad hoc querying, indexing, and aggregations

© 2023, Amazon Web Services, Inc. or its affiliates.
Document Use Case: Gaming User Profile
9
{
userid: 181276,
username: "sue1942",
name: {
first: "Susan",
last: "Benoit"
}
}
{
userid: 181276,
username: "sue1942",
name: {
first: "Susan",
last: "Benoit"
},
ExplodingSnails: {
hi_score: 3185400,
global_rank: 5139,
bonus_levels: true
},
promotions: ["new user","5%","snail lover"]
}
{
userid: 181276,
username: "sue1942",
name: {
first: "Susan",
last: "Benoit"
},
ExplodingSnails: {
hi_score: 3185400,
global_rank: 5139,
bonus_levels: true
}
}

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Challenges
scaling document
databases

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
11
Application
Not designed for
the cloud
API
Query processor
Caching
Logging
Storage
Single monolithic
architectures
Scale monolithically
Fail monolithically

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #1: Add read capacity on-demand
Node 1
Disk
Node 2
Disk
Node 3
Disk

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #1: Add read capacity on-demand
Node 1
Disk
Node 2
Disk
Node 3
Disk
Node 4
Disk

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #1: Add read capacity on-demand
Node 1
Disk
Node 2
Disk
Node 3
Disk
Node 4
Disk
Replication

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #2: Recover quickly from node failure
Node 1
Disk
Node 2
Disk
Node 3
Disk

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #2: Recover quickly from node failure
Node 1
Disk
Node 2
Disk
Node 3
Disk

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #2: Recover quickly from node failure
Node 1
Disk
Node 2
Disk
Node 3
Disk
Node 3’
Disk

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #2: Recover quickly from node failure
Node 1
Disk
Node 2
Disk
Node 3
Disk
Node 3’
Disk
Replication

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #3: Scale storage as data grows
Node
Storage
Volume

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #3: Scale storage as data grows
Node
Storage
Volume
Node
Storage
Volume

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #3: Scale storage as data grows
Storage
Volume
NodeNode
Storage
Volume
Node
Storage
Volume

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #4: Backup data without affecting performance
Operational
Node

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #4: Backup data without affecting performance
Operational
Node
Snapshot

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #4: Backup data without affecting performance
Backup
Node
Operational
Node
Snapshot

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #4: Backup data without affecting performance
Backup
Node
Operational
Node
Snapshot Snapshot

© 2023, Amazon Web Services, Inc. or its affiliates.
Traditional Database Architecture Challenges
Challenge #5: Data Durability
Node
Storage
Volume
Node
Storage
Volume
Storage
Volume
Node
Replication
Replication

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon
DocumentDB
Purpose-built and
engineered for the
cloud

© 2022, Amazon Web Services, Inc. or its Affiliates.
API
Query processor
Caching
Logging
Storage
Decouple compute and storage
Compute layer
Storage layer
Scale compute
Scale storage

© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon DocumentDB: Cloud Native Architecture
Compute
2-96 cores
4-768 GB RAM
Storage
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
29

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #1: Add Read Capacity on Demand
Instance
(replica)
Instance
(primary)
Reads
Writes
Reads Reads
Distributed storage volume
Instance
(replica)
AZ 1 AZ 2 AZ 3
Compute
Storage
30

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #1: Add Read Capacity on Demand
Instance
(replica)
Instance
(primary)
Reads
Writes
Reads Reads
Distributed storage volume
Instance
(replica)
AZ 1 AZ 2 AZ 3
Compute
Storage
Instance
(replica)
Reads
~8-10 mins
31

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #2: Quickly Recover From Node Failure
Instance
(replica)
Instance
(primary)
Reads
Writes
Reads Reads
Distributed storage volume
Instance
(replica)
AZ 1 AZ 2 AZ 3
Compute
Storage
32

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #2: Quickly Recover From Node Failure
Reads
Distributed storage volume
Instance
(replica)
AZ 1 AZ 2 AZ 3
Instance
(primary)
Reads
Writes
Primary fails
Instance
(replica)
Reads
Compute
Storage
33

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #2: Quickly Recover From Node Failure
Instance
(primary)
Reads
Writes
Reads
Distributed storage volume
Instance
(replica)
Replica promoted to primary
AZ 1 AZ 2 AZ 3
Compute
Storage
34

© 2023, Amazon Web Services, Inc. or its affiliates.
Challenge #2: Quickly Recover From Node Failure
Reads
Distributed storage volume
Instance
(replica)
Instance
(primary)
Reads
Writes
Instance
(replica)
New replica instance created
Automatic return to full strength
AZ 1 AZ 2 AZ 3
Reads
~8-10 mins
Compute
Storage
35

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Challenge #3: Scale Storage as Data Grows
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
36

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Challenge #3: Scale Storage as Data Grows
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
Grows automatically from
10 GiB -64 TiB
AZ 1 AZ 2 AZ 3
37

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Challenge #4: Backup Data Without Affecting Performance
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
38

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Challenge #4: Backup Data Without Affecting Performance
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
Amazon S3
Continuous Backups
(PITR)
39

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Challenge #4: Backup Data Without Affecting Performance
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
Amazon S3
Continuous Backups
(PITR)
Snapshots
(Automated and Manual)
40

© 2023, Amazon Web Services, Inc. or its affiliates.
Instances: 1
Environment: dev/test
Durability:highly durable
Availability goal: 99%
Challenge #5: Data Durability
Instance
(primary)
Reads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
41

© 2023, Amazon Web Services, Inc. or its affiliates.
Instances: 2
Environment: production
Durability:highly durable
Availability goal: 99.9%
Challenge #5: Data Durability
Instance
(replica)
Instance
(primary)
Reads Reads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
42

© 2023, Amazon Web Services, Inc. or its affiliates.
Instances: 3
Environment: production
Durability:highly durable
Availability goal: 99.99%
Challenge #5: Data Durability
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
43

© 2023, Amazon Web Services, Inc. or its affiliates.
Instances: 4
Environment: production
Durability:highly durable
Availability goal: 99.99%
Challenge #5: Data Durability
Instance
(replica)
Instance
(primary)
Instance
(replica)
Reads ReadsReads
Writes
Distributed storage volume
AZ 1 AZ 2 AZ 3
Instance
(replica)
Reads
44

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Service overview

© 2023, Amazon Web Services, Inc. or its affiliates.
“Our engineering teams now spend less time on operations like backup
scripts, scale testing, and managing high availability and instead are able
to focus on developing new capabilities for our customers.”
46
Automatic
patching
Up to date with the
latest patches
Replicas are
automatically promoted
to primary
Automatic failure
recover and
failover
Integrated with AWS
services
CloudWatch, CloudTrail,
CloudFormation, Secrets
Manager, VPC, IAM, CLI
Pay-as-you-go
pricing; enterprise
grade
Per-second instance
billing, no long-term
commitments
Fully Managed

© 2023, Amazon Web Services, Inc. or its affiliates.
MongoDB compatible
47
MongoDB 4.0 Same drivers,
tools
Replica sets
Compatible with MongoDB
Community Edition 4.0
Use the same MongoDB
drivers and tools with
Amazon DocumentDB
Read scaling is easy with
automatic replica set
configurations

“Getting started with DocumentDB was also simple and we
migrated our application in a couple of days without needing to
make any meaningful code changes. Everything just worked.”

© 2023, Amazon Web Services, Inc. or its affiliates.
Scalable
48
Scale out
in minutes
Scale up
in minutes
Autoscaling
storage
Load balancing
Scale to 15 read replicas Scale from
4 to 768 GiBof RAM
Storage automatically
grows from
10 GB to 64 TiB
Scale reads across replicas
With Amazon DocumentDB, our development team can scale, iterate, and upgrade games
quickly, the marketing team can carry out high pertinence promotion activities, and our
customer service team can troubleshoot problems from game players efficiently.

© 2023, Amazon Web Services, Inc. or its affiliates.
Security and compliance
49
Amazon VPC Encryption by
default
Safe defaults Compliance and
support
Strict network isolation with
Amazon Virtual Private Cloud
(VPC)
Encryption at rest with
AWS KMS and customer-
managed AWS keys;
encryption in transit
with TLS
Best practices are the
defaults
PCI DSS,
ISO 9001,27001,27017,
and27018,SOC 1, 2 &
3,HIPAA

“Integration with AWS KMS for data encryption at rest, transparent failover with
read-replicas and the ability to take incremental database snapshots
significantly lowers the operational burden for our team running the platform.”

© 2023, Amazon Web Services, Inc. or its affiliates.
Backup and recovery
50
Automatic backups 35 days of PITR Archive snapshots
Automatic, incremental, and
continuous backups
Backups do not affect
database performance
Point-in-time recovery
(PITR) for up to 35 days
Keep snapshots for as long as
you need
No performance impact
"Adopting Amazon DocumentDB is a game-changer because we offload management, security,
and backup of our MongoDB databases to AWS. With Amazon DocumentDB, we can add or scale
instances in minutes, regardless of data size. Further, we get automatic backups and point-in-
time restore capabilities, which far exceed other managed DB services at less cost.”

© 2023, Amazon Web Services, Inc. or its affiliates.
•MongoDB 4.0
•ACID transactions
•Launch
•Frankfurt
•Secrets
Manager
•Per-second
billing
•Tokyo
•Seoul
•DDL
auditing
•Aggregatio
n operators
•Sydney
•London
•Canada
•Slow query
logger
•Start/stop
cluster
•Deletion
protection
•Change
streams
•Singapore
•Mumbai
•Paris
•Aggregation
operators
•T3 instances
•Cross-region
snapshot copy
RBAC
•Increase
cursor &
connection
limits
•Glue ETL
•Global
clusters
•Graviton2
•AWS Backup
•Milan
•RBAC user-defined
roles
•JDBC driver
•Geospatial
•Free trial
•Aggregation
operators
•Performance
Insights
(Preview)
Innovation in Amazon DocumentDB
•Dynamic
resizing
•Database
cloning
51
•DML Auditing
•Decimal128 data
type support
•Elastic
Clusters
2019 2020 2021 2022

© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon DocumentDBElastic Clusters
NEW!
New type of cluster (Elastic Cluster) for Amazon DocumentDB that
supports workloads with millions of reads/writes per second and
petabytes of storage capacity
Compatible with
MongoDB APIs
for sharding
Millions of reads
and writes
Up to 300,000
connections
Easy and
fast scaling

© 2023, Amazon Web Services, Inc. or its affiliates.
Compute
Storage
Shard nShard 2Shard 1
Elastic Cluster Architecture

© 2023, Amazon Web Services, Inc. or its affiliates.
Shard nShard 2Shard 1
Elastic Cluster
db.foo.find(
{
order_id:1
})
{
"order_id":1,
"name":"Amazon"
}
db.foo.insert(
{
order_id: 2
})
{"inserted_id":2}
Request Router
Elastic Cluster Architecture

© 2023, Amazon Web Services, Inc. or its affiliates.
Pricing (us-east-1)
56
Distributed storage volume
Reads Reads
Writes
Amazon S3
Reads
Compute
Storage
Instances: Size/hr* count (db.t3.medium $0.078/hr)
I/O: Count ($0.20/million)
Storage: GB/mo
Backup: GB/mo
(100% Free! then $0.021/GB)
($0.10/GB)

© 2023, Amazon Web Services, Inc. or its affiliates.
Migration Methods
Sourcesfor both relational and document databases
57
Offline migration using MongoDB utilities:
Get started quickly, great for proof-of-
concepts
Online migration using AWS DMS
Near-zero downtime migration
Hybrid migration leverages both
solutions
https://docs.aws.amazon.com/documentdb/latest/developerguide/docdb-migration.html
All options support MongoDB on-premises and EC2, for both replica sets and shardedclusters

© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon DocumentDB Programs/Investments
58
Program Name Description Duration Cost Outcome
Cost Analysis DocumentDB sizing questionnaire using your workload metrics to generate a cluster sizing estimateSelf-serve None
DocumentDB sizing and pricing
estimate
Compatibility
Assessment
The DocumentDB compatibility tool will examine log files from MongoDB to determine if your
applications use operators that are not supported in DocumentDB. This tool will report use of
unsupported APIs, and output the unsupported log lines into a file for future use.
Self-serve None
MongoDB -> DocumentDB
compatibility report
Immersion Day
DocumentDB Immersion Days provide customers with modular content and hands-on labs to learn about
DocumentDB use cases, architecture, best practices, migrations, security, monitoring, and more.
1-2 days None
Enable customers to build a
DocumentDB POC, or
implement/migrate workload
Well ArchitectedLens
WALfor DocumentDBassesses customer workloads with a focus on optimizing performance, reliability,
security, cost and operational excellence.
Half day None
Well Architected review report
with recommendations to
optimize workload.
Springboard
Customized migration game plan that begins with decision makers (sponsor) and diverse stakeholders.
Includes 1.current state operations & business commitments 2.specific architectural recommendations
on AWS 3. proposed milestones 4. follow up action items
Half day None
Engagementreadout that serves
as execution plan.
Data Labs
DocumentDB Data Labs provide technical resources to help customer build tangible deliverables that
accelerate data modernization initiatives. Customers who've built DocumentDB POCs are given
prescriptive architectural guidance, best practices, and technical roadblock removal by AWS Data Lab
engineers and DocumentDB experts. Customers leave the lab with a well-architected prototype, a path to
production, and greater knowledge of DocumentDB.
4 days None
Well architected DocumentDB
prototype with path to
production
Professional Services
AWS Pro Serve provides hands-on support to review customers' database environments and challenges,
requirements, desired outcomes, and success metrics for migrating workloads to DocumentDB. Suitable
use cases are identified, and customer gets experience implementing a demo of their solution using
sample data. A documented roadmap proposal with next steps to implement migrations to DocumentDB
is provided by end of the engagement.
Varies SOW based
Hands-on support to guide
customer from POC-
>assessment->migration

© 2023, Amazon Web Services, Inc. or its affiliates.© 2023, Amazon Web Services, Inc. or its affiliates.
Thank you!
Tags