[ DynamoDB ]

- Fully Managed, Highly available with replication across 3 AZ

- NoSQL database - not a relational database

- Scales to massive workloads, distributed database

- Milions of requests per seconds, trillions of row, 100s of TB of storage

- Fast and consistent in performance (low latency on retrieval)

- Integrated with IAM for security, authorization and administration

- Enables event driven programming with DynamoDB Streams

- Low cost and auto scaling capabilities

 

[ DynamoDB Basic ]

DynamoDB is made of tables

- Each table has a PK (must be decided at creation time)

- Each table can have an infinite number of items

- Each item has attributes (can be added over time , can be null)

- Maximum size of a item is 400KB

- Supported data types 

  1) Scalar Types : String, Number, Binary, Boolean, Null

  2) Document Types : List, Map

  3) Set Types : String Set, Number Set, Binary Set

 

[ DynamoDB - Provisioned Throughput *** ]

- Table must have provisioned read and write capacity units

- RCU (Read Capacity Units) : throughput for reads ($0.00013 per RCU)

   1 RCU = 1 strongly consistent read of 4KB per second

   1 RCU = 2 eventually consistent read of 4 KB per second

- WCU (Write Capacity Unit) : throughput for writes ($0.00065 per WCU)

   1 WCU = 1 write of 1 KB per second

- Option to setup auto-scaling of throughput to meet demand

- Throughput can be exceeded temporarily using "burst credit"

- If burst credit are empty, you'll get a "ProvisionedThroughputException"

※ To prevent "ProvisionedThroughputException", use DAX

- It's then advised to do an exponential(기하급수적인) back-off retry

 

[ DynamoDB Advanced Features ]

[ DynamoDB - DAX ]

- DAX = DynamoDB Accelerator

- Seamless cache for DynamoDB, no application re-write

- Writes go through DAX to DynamoDB

- Micro second latency for cached reads & queries

- Solves the Hot Key problem (too many reads)

- 5 minutes TTL for caches by default

- Up to 10 nodes in the cluster

- Multi AZ (3 nodes minium recommended for production)

- Secure (encryption at rest with KMS, VPC, IAM, CloudTrail)

 

[ DynamoDB Streams ]

- Changes in DynamoDB (CUD) can end up in a DynamoDB Stream

- This stream can be read by AWS Lambda, and we can then do :

  1) React to changes in real time (eg. welcome email to new users)

  2) Analytics

  3) Create derivative(파생되는) tables / views

  4) Insert into Elastic Search

- Could implement cross region replication using Streams

- Stream has 24 hours of data retention

※ Before create a DynamoDB Global Table, DynamoDB Streams must be enabled first

: DynamoDB 를 글로벌로 사용하기 전에 DynamoDB Stream 을 활성화 시켜야 한다

 

[ DynamoDB - New Features ** ]

Transactions (new from Nov 2018)

- All or nothing type of operations

- Coordinated Insert, Update & Delete across multiple tables

- Include up to 10 unique items or up to 4 MB of data

On Demand (new from Nov 2018)

- No capacity planning needed (WCU/RCU) - scales automatically

- x2.5 more expensive than provisioned capacity (use with care)

- Helpful when spikes are un-predictable or the application is very low throughput

 

[ DynamoDB - Security & Other Features ]

- Security :

  1) VPC Endpoints available to access DynamoDB without internet

  2) Access fully controlled by IAM

  3) Encryption at rest using KMS

  4) Encryption in transit using SSL/TLS

- Backup and Restore feature available

  1) Point in time restore like RDS

  2) No performance impact

- Global Tables

  Multi region, fully replicated, high performance

- Amazon DMS can be used to migrate to DynamoDB (from Mongo, Oracle, MySQL, S3, etc..)

- You can launch a local DynamoDB on your computer for development purposes

- Global Tables (cross region replication)

  Active Active replication, many regions

  Must enable DynamoDB Streams

  Useful for low latency, DR purposes

- Capacity planning

  1) Planned capacity : provision WCU&RCU, can enable auto scaling

  2) On-demand capacity : get unlimited WCU & RCU, no throttle, more expensive

 

 

반응형

'infra & cloud > AWS' 카테고리의 다른 글

[AWS] 16-1. AWS Cognito  (0) 2021.09.12
[AWS] 16. API Gateway : Securty  (0) 2021.09.06
[AWS] 14-2. Lambda@Edge  (0) 2021.09.02
[AWS] 14. Serverless : Lambda  (0) 2021.09.01
[AWS] 13. Docker, ECS/Fargate/EKS  (0) 2021.04.25

+ Recent posts