KEMBAR78
Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인 | PDF
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
AWS Databases Modernization Day
Sr. Database Specialist SA
DynamoDB 활용하기
강민석
© 2020, Amazon Web Services, Inc. or its Affiliates.
강연 중 질문하는 방법
Go to Webinar “Chat/채팅” 창에 자신이 질문한
내역이 표시됩니다. 기본적으로 모든 질문은
공개로 답변 됩니다만 본인만 답변을 받고 싶으면
(비공개)라고 하고 질문해 주시면 됩니다.
본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS
사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트
상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다.
AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한 종류의 손해에
대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다.
고지 사항(Disclaimer)
© 2020, Amazon Web Services, Inc. or its Affiliates.
Table of contents
• DynamoDB 이해하기
• DynamoDB 실습
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
DynamoDB 이해하기
© 2020, Amazon Web Services, Inc. or its Affiliates.
Data Platform portfolio
Redshift
Data
warehousing
EMR
Hadoop +
Spark
Athena
Interactive
analytics
Kinesis Data
Analytics Real
time
Elasticsearch
Service
Operational
Analytics
RDS
MySQL, PostgreSQL,
MariaDB, Oracle, SQL
Server
Aurora
MySQL,
PostgreSQL
QuickSight SageMaker
DynamoDB
Key value
ElastiCache
Redis, Memcached
Neptune
Graph
Timestream
Time Series
QLDB
Ledger
Database
S3/Glacier
Glue
ETL & Data
Catalog
Lake Formation
Data Lakes
Database Migration Service | Snowball | Snowmobile | Kinesis Data Firehose | Kinesis Data Streams
Data Movement
Analytics Databases
Database, Business Intelligence & Machine Learning
Data Lake
Managed
Blockchain
Blockchain
Templates
Blockchain
RDS on VMware
DocumentDB
Document
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amazon에서의 NoSQL 역사
Dec 2004:
Database
scalability
challenges
Oct 2007:
Dynamo paper
published
Jan 2012:
DynamoDB
general
availability
Q3 2016:
DynamoDB leader
in Gartner MQ,
Forrester Wave
Today:
Tier 0 service
powering most of
Amazon
© 2020, Amazon Web Services, Inc. or its Affiliates.
DynamoDB란 무엇인가?
• 2007년에 Amazon에서 “Dynamo Model”
으로 처음 출시
• 2012년도에 DynamoDB로 서비스 됨
• Key-Value기반의 NoSQL Database
• 성능: Low latency
• 용량: Almost infinite capacity
• 관리: No need to worry, Easy
• 확장: 완벽한(Seamless) scalability
• 고가용성: High Durability & Availability
• 쉬운 Planning: (via throughput
parameters)
Service-oriented architecture of
Amazon’s platform
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amazon DynamoDB
Highly available
and durable
Consistently fast at any scale Fully managed
Secure
Integrates with AWS Lambda,
Amazon Redshift, and more
Cost-effective
3개의 AZ에 3 copy
복제
한자리 milli-second
latency
Serverless로 관리
비용 절감
IAM 보안 사용 AWS 서비스와 통합
사용한 만큼 비용
© 2020, Amazon Web Services, Inc. or its Affiliates.
How DynamoDB works?
© 2020, Amazon Web Services, Inc. or its Affiliates.
Data modeling: SQL vs. NoSQL
SQL
© 2020, Amazon Web Services, Inc. or its Affiliates.
Data modeling: SQL vs. NoSQL
NoSQLSQL
© 2020, Amazon Web Services, Inc. or its Affiliates.
Partition Key
Mandatory
Key-value access pattern
Determines data distribution
Optional
Model 1:N relationships
Enables rich query capabilities
A1
(partition key)
A2
(sort key)
A3 A4 A7
A1
(partition key)
A2
(sort key)
A6 A4 A5
A1
(partition key)
A2
(sort key)
A1
(partition key)
A2
(sort key)
A3 A4 A5
SortKey
Table
Items
DynamoDB 테이블
Attributes
All items for a partition key
==, <, >, >=, <=
“begins with”
“between”
sorted results
counts
top/bottom N values
paged responses
© 2020, Amazon Web Services, Inc. or its Affiliates.
Partitioning
00
55
AA
FF
Hash(1) = 7B
Orders
Partition A
33.33 % Keyspace
33.33 % Provisioned Capacity
Partition B
33.33 % Keyspace
33.33 % Provisioned Capacity
Partition C
33.33 % Keyspace
33.33 % Provisioned Capacity
Hash.MIN = 0
Hash.MAX = FF
Keyspace
Hash(2) = 48
Hash(3) = CD
DynamoDB table
OrderId: 1
CustomerId: 1
ASIN: [B00X4WHP5E]
OrderId: 2
CustomerId: 4
ASIN: [B00OQVZDJM]
OrderId: 3
CustomerId: 3
ASIN: [B00U3FPN4U]
• 1 Partition = 10G, 1 Item = Max 400 KB, 1 Partition 에는 25,000 개의 Item이 들어감
• 1 Partition 의 최고 RCU는 3,000. 최고 WCU는 1,000 입니다.
© 2020, Amazon Web Services, Inc. or its Affiliates.
Partition: Sort Key 예
Partition 300:0 FF:∞
Hash (2) = 48
Customer# = 2
Order# = 10
Item = Pen
Customer# = 2
Order# = 11
Item = Shoes
Customer# = 1
Order# = 10
Item = Toy
Customer# = 1
Order# = 11
Item = Boots
Hash (1) = 7B
Customer# = 3
Order# = 10
Item = Book
Customer# = 3
Order# = 11
Item = Paper
Hash (3) = CD
55 A9:∞54:∞ AAPartition 1 Partition 2
© 2020, Amazon Web Services, Inc. or its Affiliates.
Local secondary index(LSI)
A1
(partition)
A3
(sort)
A2
(item key)
A1
(partition)
A2
(sort)
A3 A4 A5
LSIs A1
(partition)
A4
(sort)
A2
(item key)
A3
(projected)
Table
KEYS_ONLY
INCLUDE A3
A1
(partition)
A5
(sort)
A2
(item key)
A3
(projected)
A4
(projected)
ALL
• 10 GB max per partition key, i.e. LSIs limit the # of
range keys!
• Table당 5개
LSI
• Alternate sort key attribute
• Index is local to a partition key
© 2020, Amazon Web Services, Inc. or its Affiliates.
RCUs/WCUs provisioned separately
for GSIs
• Alternate partition (+sort) key
• Use composite sort keys for compound indexes
• Can be added or removed anytime
GSI: 테이블당 20개 제약
Global secondary index(GSI)
A1
(partition)
A2 A3 A4 A5Table
A5
(partition)
A4
(sort)
A1
(item key)
A3
(projected)
INCLUDE A3
A4
(partition)
A5
(sort)
A1
(item key)
A2
(projected)
A3
(projected)
ALL
A2
(partition)
A1
(itemkey)
KEYS_ONLY
GSIs
Online indexing
© 2020, Amazon Web Services, Inc. or its Affiliates.
Data types
Type DynamoDB Type
String String
Integer, Float Number
Timestamp Number or String
Blob Binary
Boolean Bool
Null Null
List List
Set
Set of String, Number, or
Binary
Map Map
© 2020, Amazon Web Services, Inc. or its Affiliates.
테이블 속성
읽기/쓰기 용량 모드
Provisioned ModeOn-Demand Mode
• 애플리케이션에서 수행할 것으로 예상되는 읽기
및 쓰기 처리량을 지정할 필요가 없음
• 테이블에 대해 수행하는 읽기 및 쓰기에 대해
요금이 부과
• 워크노드에 따라 읽기/쓰기 용량이 변경됨
• 사용예
• 알 수 없는 워크로드를 포함하는 테이블을
새로 만들 경우
• 애플리케이션 트래픽이 예측 불가능한
경우
• 사용한 만큼에 대해서만 지불하는
요금제를 사용하려는 경우
• 테이블의 읽기 용량 단위(RCU) 및 쓰기 용량
단위(WCU)의 처리량을 지정
• DynamoDB는 이 정보를 사용하여 처리량 요구
사항에 맞는 충분한 시스템 리소스 확보
• DynamoDB Auto Scaling에서 테이블의 처리
용량을 관리하도록 허용할 수도 있음
© 2020, Amazon Web Services, Inc. or its Affiliates.
DynamoDB Auto Scaling
• 목표 사용률 — 테이블의 목표 사용률을 입력합니다.
• 최소 프로비저닝 용량 — Auto Scaling 범위의 하한을 입력합니다.
• 최대 프로비저닝 용량 — Auto Scaling 범위의 상한을 입력합니다.
• 글로벌 보조 인덱스에 동일한 설정 적용 — 이 옵션을 기본 설정(활성화)으로 유지합니다.
Throughput automatically adapts to your actual traffic
With Auto ScalingWithout Auto Scaling
© 2020, Amazon Web Services, Inc. or its Affiliates.
Burst capacity is built in
0
400
800
1200
1600
CapacityUnits
Time
Provisioned Consumed
“Save up” unused capacity
Consume saved up capacity
Burst: 300 seconds
(1200 × 300 = 360k CU)
DynamoDB “saves” 300 seconds of
unused capacity per partition
© 2020, Amazon Web Services, Inc. or its Affiliates.
효과적으로 파티션 키를 설계
• 효과적인 버스트 용량 사용
• 5분(300초)에 해당하는 미사용 읽기 및 쓰기 용량을 비축
• 높은 트래픽 파티션에 대한 처리량 향상
• 특정 파티션 키에 대한 트래픽이 3,000RCU, 1,000WCU를 초과하지 않도록 유지
• 핫 파티션의 Item 분산
https://docs.aws.amazon.com/ko_kr/amazondynamodb/latest/developerguide/best-practices.html
© 2020, Amazon Web Services, Inc. or its Affiliates.
Throttling
• Occurs if sustained throughput goes beyond
provisioned throughput per partition
• Possible causes
• Non-uniform workloads
• Hot keys/hot partitions
• Very large items
• Mixing hot data with cold data
• Remedy: Use TTL or a table per time
period
• Disable retries, write your own retry
code, and log all throttled or returned
keys
© 2020, Amazon Web Services, Inc. or its Affiliates.
Data modeling: Hierarchical data structures as items
• Use composite sort key to define a hierarchy
• Highly selective result sets with sort queries
• Index anything, scales to any size
Primary Key
Attributes
ProductID type
Items
1 bookID
title author genre publisher datePublished ISBN
Some Book John Smith Science Fiction Ballantine Oct-70 0-345-02046-4
2 albumID
title artist genre label studio released producer
Some Album Some Band Progressive Rock Harvest Abbey Road 3/1/73 Somebody
2 albumID:trackID
title length music vocals
Track 1 1:30 Mason Instrumental
2 albumID:trackID
title length music vocals
Track 2 2:43 Mason Mason
2 albumID:trackID
title length music vocals
Track 3 3:30 Smith Johnson
3 movieID
title genre writer producer
Some Movie Scifi Comedy Joe Smith 20th Century Fox
3 movieID:actorID
name character image
Some Actor Joe img2.jpg
3 movieID:actorID
name character image
Some Actress Rita img3.jpg
3 movieID:actorID
name character image
Some Actor Frito img1.jpg
© 2020, Amazon Web Services, Inc. or its Affiliates.
… or as documents (JSON)
• JSON data types (M, L, BOOL, NULL)
• Document SDKs available
• 400 KB maximum item size (limits hierarchical data structure)
Primary Key
Attributes
ProductID
Items
1
id title author genre publisher datePublished ISBN
bookID Some Book Some Guy Science Fiction Ballantine Oct-70 0-345-02046-4
2
id title artist genre Attributes
albumID Some Album Some Band Progressive Rock
{ label:"Harvest", studio: "Abbey Road", published: "3/1/73", producer: "Pink
Floyd", tracks: [{title: "Speak to Me", length: "1:30", music: "Mason", vocals:
"Instrumental"},{title: ”Breathe", length: ”2:43", music: ”Waters, Gilmour,
Wright", vocals: ”Gilmour"},{title: ”On the Run", length: “3:30", music: ”Gilmour,
Waters", vocals: "Instrumental"}]}
3
id title genre writer Attributes
movieID Some Movie Scifi Comedy Joe Smith
{ producer: "20th Century Fox", actors: [{ name: "Luke Wilson", dob: "9/21/71",
character: "Joe Bowers", image: "img2.jpg"},{ name: "Maya Rudolph", dob:
"7/27/72", character: "Rita", image: "img1.jpg"},{ name: "Dax Shepard", dob:
"1/2/75", character: "Frito Pendejo", image: "img3.jpg"}]
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
DynamoDB 활용 - Demo
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
Lab1 – 실습환경 구성
© 2020, Amazon Web Services, Inc. or its Affiliates.
Lab2 – DynamoDB 테이블 생성 및 활용
© 2020, Amazon Web Services, Inc. or its Affiliates.
Lab3 – 성능 테스트(WCU/RCU – On-Demand)
© 2020, Amazon Web Services, Inc. or its Affiliates.
AWS Database Modernization Day에
참석해주셔서 대단히 감사합니다.
aws-korea-marketing@amazon.com
twitter.com/AWSKorea
facebook.com/amazonwebservices.ko
youtube.com/user/AWSKorea
slideshare.net/awskorea
twitch.tv/aws
저희가 준비한 내용, 어떻게 보셨나요?
더 나은 세미나를 위하여 설문을 꼭 작성해 주시기 바랍니다.
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
Thank you!

Amazon Dynamo DB 활용하기 - 강민석 :: AWS Database Modernization Day 온라인

  • 1.
    © 2020, AmazonWeb Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. AWS Databases Modernization Day Sr. Database Specialist SA DynamoDB 활용하기 강민석
  • 2.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. 강연 중 질문하는 방법 Go to Webinar “Chat/채팅” 창에 자신이 질문한 내역이 표시됩니다. 기본적으로 모든 질문은 공개로 답변 됩니다만 본인만 답변을 받고 싶으면 (비공개)라고 하고 질문해 주시면 됩니다. 본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS 사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트 상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다. AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한 종류의 손해에 대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다. 고지 사항(Disclaimer)
  • 3.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Table of contents • DynamoDB 이해하기 • DynamoDB 실습
  • 4.
    © 2020, AmazonWeb Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. DynamoDB 이해하기
  • 5.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Data Platform portfolio Redshift Data warehousing EMR Hadoop + Spark Athena Interactive analytics Kinesis Data Analytics Real time Elasticsearch Service Operational Analytics RDS MySQL, PostgreSQL, MariaDB, Oracle, SQL Server Aurora MySQL, PostgreSQL QuickSight SageMaker DynamoDB Key value ElastiCache Redis, Memcached Neptune Graph Timestream Time Series QLDB Ledger Database S3/Glacier Glue ETL & Data Catalog Lake Formation Data Lakes Database Migration Service | Snowball | Snowmobile | Kinesis Data Firehose | Kinesis Data Streams Data Movement Analytics Databases Database, Business Intelligence & Machine Learning Data Lake Managed Blockchain Blockchain Templates Blockchain RDS on VMware DocumentDB Document
  • 6.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Amazon에서의 NoSQL 역사 Dec 2004: Database scalability challenges Oct 2007: Dynamo paper published Jan 2012: DynamoDB general availability Q3 2016: DynamoDB leader in Gartner MQ, Forrester Wave Today: Tier 0 service powering most of Amazon
  • 7.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. DynamoDB란 무엇인가? • 2007년에 Amazon에서 “Dynamo Model” 으로 처음 출시 • 2012년도에 DynamoDB로 서비스 됨 • Key-Value기반의 NoSQL Database • 성능: Low latency • 용량: Almost infinite capacity • 관리: No need to worry, Easy • 확장: 완벽한(Seamless) scalability • 고가용성: High Durability & Availability • 쉬운 Planning: (via throughput parameters) Service-oriented architecture of Amazon’s platform
  • 8.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Amazon DynamoDB Highly available and durable Consistently fast at any scale Fully managed Secure Integrates with AWS Lambda, Amazon Redshift, and more Cost-effective 3개의 AZ에 3 copy 복제 한자리 milli-second latency Serverless로 관리 비용 절감 IAM 보안 사용 AWS 서비스와 통합 사용한 만큼 비용
  • 9.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. How DynamoDB works?
  • 10.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Data modeling: SQL vs. NoSQL SQL
  • 11.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Data modeling: SQL vs. NoSQL NoSQLSQL
  • 12.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Partition Key Mandatory Key-value access pattern Determines data distribution Optional Model 1:N relationships Enables rich query capabilities A1 (partition key) A2 (sort key) A3 A4 A7 A1 (partition key) A2 (sort key) A6 A4 A5 A1 (partition key) A2 (sort key) A1 (partition key) A2 (sort key) A3 A4 A5 SortKey Table Items DynamoDB 테이블 Attributes All items for a partition key ==, <, >, >=, <= “begins with” “between” sorted results counts top/bottom N values paged responses
  • 13.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Partitioning 00 55 AA FF Hash(1) = 7B Orders Partition A 33.33 % Keyspace 33.33 % Provisioned Capacity Partition B 33.33 % Keyspace 33.33 % Provisioned Capacity Partition C 33.33 % Keyspace 33.33 % Provisioned Capacity Hash.MIN = 0 Hash.MAX = FF Keyspace Hash(2) = 48 Hash(3) = CD DynamoDB table OrderId: 1 CustomerId: 1 ASIN: [B00X4WHP5E] OrderId: 2 CustomerId: 4 ASIN: [B00OQVZDJM] OrderId: 3 CustomerId: 3 ASIN: [B00U3FPN4U] • 1 Partition = 10G, 1 Item = Max 400 KB, 1 Partition 에는 25,000 개의 Item이 들어감 • 1 Partition 의 최고 RCU는 3,000. 최고 WCU는 1,000 입니다.
  • 14.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Partition: Sort Key 예 Partition 300:0 FF:∞ Hash (2) = 48 Customer# = 2 Order# = 10 Item = Pen Customer# = 2 Order# = 11 Item = Shoes Customer# = 1 Order# = 10 Item = Toy Customer# = 1 Order# = 11 Item = Boots Hash (1) = 7B Customer# = 3 Order# = 10 Item = Book Customer# = 3 Order# = 11 Item = Paper Hash (3) = CD 55 A9:∞54:∞ AAPartition 1 Partition 2
  • 15.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Local secondary index(LSI) A1 (partition) A3 (sort) A2 (item key) A1 (partition) A2 (sort) A3 A4 A5 LSIs A1 (partition) A4 (sort) A2 (item key) A3 (projected) Table KEYS_ONLY INCLUDE A3 A1 (partition) A5 (sort) A2 (item key) A3 (projected) A4 (projected) ALL • 10 GB max per partition key, i.e. LSIs limit the # of range keys! • Table당 5개 LSI • Alternate sort key attribute • Index is local to a partition key
  • 16.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. RCUs/WCUs provisioned separately for GSIs • Alternate partition (+sort) key • Use composite sort keys for compound indexes • Can be added or removed anytime GSI: 테이블당 20개 제약 Global secondary index(GSI) A1 (partition) A2 A3 A4 A5Table A5 (partition) A4 (sort) A1 (item key) A3 (projected) INCLUDE A3 A4 (partition) A5 (sort) A1 (item key) A2 (projected) A3 (projected) ALL A2 (partition) A1 (itemkey) KEYS_ONLY GSIs Online indexing
  • 17.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Data types Type DynamoDB Type String String Integer, Float Number Timestamp Number or String Blob Binary Boolean Bool Null Null List List Set Set of String, Number, or Binary Map Map
  • 18.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. 테이블 속성 읽기/쓰기 용량 모드 Provisioned ModeOn-Demand Mode • 애플리케이션에서 수행할 것으로 예상되는 읽기 및 쓰기 처리량을 지정할 필요가 없음 • 테이블에 대해 수행하는 읽기 및 쓰기에 대해 요금이 부과 • 워크노드에 따라 읽기/쓰기 용량이 변경됨 • 사용예 • 알 수 없는 워크로드를 포함하는 테이블을 새로 만들 경우 • 애플리케이션 트래픽이 예측 불가능한 경우 • 사용한 만큼에 대해서만 지불하는 요금제를 사용하려는 경우 • 테이블의 읽기 용량 단위(RCU) 및 쓰기 용량 단위(WCU)의 처리량을 지정 • DynamoDB는 이 정보를 사용하여 처리량 요구 사항에 맞는 충분한 시스템 리소스 확보 • DynamoDB Auto Scaling에서 테이블의 처리 용량을 관리하도록 허용할 수도 있음
  • 19.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. DynamoDB Auto Scaling • 목표 사용률 — 테이블의 목표 사용률을 입력합니다. • 최소 프로비저닝 용량 — Auto Scaling 범위의 하한을 입력합니다. • 최대 프로비저닝 용량 — Auto Scaling 범위의 상한을 입력합니다. • 글로벌 보조 인덱스에 동일한 설정 적용 — 이 옵션을 기본 설정(활성화)으로 유지합니다. Throughput automatically adapts to your actual traffic With Auto ScalingWithout Auto Scaling
  • 20.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Burst capacity is built in 0 400 800 1200 1600 CapacityUnits Time Provisioned Consumed “Save up” unused capacity Consume saved up capacity Burst: 300 seconds (1200 × 300 = 360k CU) DynamoDB “saves” 300 seconds of unused capacity per partition
  • 21.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. 효과적으로 파티션 키를 설계 • 효과적인 버스트 용량 사용 • 5분(300초)에 해당하는 미사용 읽기 및 쓰기 용량을 비축 • 높은 트래픽 파티션에 대한 처리량 향상 • 특정 파티션 키에 대한 트래픽이 3,000RCU, 1,000WCU를 초과하지 않도록 유지 • 핫 파티션의 Item 분산 https://docs.aws.amazon.com/ko_kr/amazondynamodb/latest/developerguide/best-practices.html
  • 22.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Throttling • Occurs if sustained throughput goes beyond provisioned throughput per partition • Possible causes • Non-uniform workloads • Hot keys/hot partitions • Very large items • Mixing hot data with cold data • Remedy: Use TTL or a table per time period • Disable retries, write your own retry code, and log all throttled or returned keys
  • 23.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Data modeling: Hierarchical data structures as items • Use composite sort key to define a hierarchy • Highly selective result sets with sort queries • Index anything, scales to any size Primary Key Attributes ProductID type Items 1 bookID title author genre publisher datePublished ISBN Some Book John Smith Science Fiction Ballantine Oct-70 0-345-02046-4 2 albumID title artist genre label studio released producer Some Album Some Band Progressive Rock Harvest Abbey Road 3/1/73 Somebody 2 albumID:trackID title length music vocals Track 1 1:30 Mason Instrumental 2 albumID:trackID title length music vocals Track 2 2:43 Mason Mason 2 albumID:trackID title length music vocals Track 3 3:30 Smith Johnson 3 movieID title genre writer producer Some Movie Scifi Comedy Joe Smith 20th Century Fox 3 movieID:actorID name character image Some Actor Joe img2.jpg 3 movieID:actorID name character image Some Actress Rita img3.jpg 3 movieID:actorID name character image Some Actor Frito img1.jpg
  • 24.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. … or as documents (JSON) • JSON data types (M, L, BOOL, NULL) • Document SDKs available • 400 KB maximum item size (limits hierarchical data structure) Primary Key Attributes ProductID Items 1 id title author genre publisher datePublished ISBN bookID Some Book Some Guy Science Fiction Ballantine Oct-70 0-345-02046-4 2 id title artist genre Attributes albumID Some Album Some Band Progressive Rock { label:"Harvest", studio: "Abbey Road", published: "3/1/73", producer: "Pink Floyd", tracks: [{title: "Speak to Me", length: "1:30", music: "Mason", vocals: "Instrumental"},{title: ”Breathe", length: ”2:43", music: ”Waters, Gilmour, Wright", vocals: ”Gilmour"},{title: ”On the Run", length: “3:30", music: ”Gilmour, Waters", vocals: "Instrumental"}]} 3 id title genre writer Attributes movieID Some Movie Scifi Comedy Joe Smith { producer: "20th Century Fox", actors: [{ name: "Luke Wilson", dob: "9/21/71", character: "Joe Bowers", image: "img2.jpg"},{ name: "Maya Rudolph", dob: "7/27/72", character: "Rita", image: "img1.jpg"},{ name: "Dax Shepard", dob: "1/2/75", character: "Frito Pendejo", image: "img3.jpg"}]
  • 25.
    © 2020, AmazonWeb Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. DynamoDB 활용 - Demo
  • 26.
    © 2020, AmazonWeb Services, Inc. or its Affiliates.
  • 27.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Lab1 – 실습환경 구성
  • 28.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Lab2 – DynamoDB 테이블 생성 및 활용
  • 29.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. Lab3 – 성능 테스트(WCU/RCU – On-Demand)
  • 30.
    © 2020, AmazonWeb Services, Inc. or its Affiliates. AWS Database Modernization Day에 참석해주셔서 대단히 감사합니다. aws-korea-marketing@amazon.com twitter.com/AWSKorea facebook.com/amazonwebservices.ko youtube.com/user/AWSKorea slideshare.net/awskorea twitch.tv/aws 저희가 준비한 내용, 어떻게 보셨나요? 더 나은 세미나를 위하여 설문을 꼭 작성해 주시기 바랍니다.
  • 31.
    © 2020, AmazonWeb Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. Thank you!