Skip to content

DynamoDB Deep Dive Advence Design

from 2004 amazon.com outage

實際使用案例

  • amazon.com
  • disney+
  • netflix
  • dropbox
  • pokemon company

Under the hood

  • partition 10GB做一次切割

data model

  • different concept from Relational DB
  • NoSQL Workbench

features

  • Dynamodb stream(item-level change log) for events
  • TTL
  • transcation
  • Point-in-time recovery (PITR)

Detail Description

  • partion key best practice
  • Secondary Index
  • 事前就想到 => LSI
  • 事後才想加Index => GSI
  • Fine-Grain Access Control
  • IAM
  • horizontal
  • vertical
  • Memory Cache
  • DAX

Scenario

  • building and maintaing an S3 metadata
  • users buy products in online retail shops
  • aggration for raw records

Amazon Dynamo DB NoSQL Designs and Best Praction

  • 針對Analytics(OLAP)場景較弱
  • 客戶體驗(OLTP) vs 後端統計(OLAP)(ex. 過去一年/一季/一個月的訂單量)
  • SQL is good for OLAP; NoSQL for OLTP for scale
  • 可以用DynomaDB Stream強化OLAP應用
  • Archive
  • TTL + DynomaDB Stream

SQL vs NoSQL

  • Data Modeling
  • Data Access Pattern
  • Data Query

partion key

operation

建議Batch Write Operation for cost saving

QA

  • prefix use #? => 不成文規定
  • PROFILE#alexdebrie vs ORDER#abcsdf => #PROFILE ORDER 沒有特別意思

  • update ok status 代表 已經同步至3個AZ完成,包含GSI?
  • partition有可能只有一個item的情況嗎? => 有可能,看AWS後面hash function的設計
  • partition key是具有唯一性的資料, ex. uuid, 代表一定會在不同partition嗎? => 不一定,看AWS後面hash function的設計或是該item是否是非常熱門
  • primary key(partion key+sort key)一定具有唯一性?