[ DynamoDB ]

AWS 소유 기술의 NoSQL DB로 key/value 쌍으로 데이터 저장

멀티AZ, 읽기와 쓰기의 분리, read cache 로 DAX 사용

IAM 을 사용하여 보안

DynamoDB Stream 을 사용하여 AWS Lambda와 통합 (DynamoDB Stream이 데이터 변화 감지하여 AWS Lambda 호출)

백업과 복구 가능, 글로벌 테이블 사용

cloudwatch를 통한 모니터링

SQL 쿼리 불가. 오직 key 및 인덱스 기준 조회만 가능

트랜잭션 지원 (2018. 11월)

- AWS proprietary technology, managed NoSQL database

- Serverless, provisioned capacity, auto scaling, on demand capacity (Nov 2018)

- Can replace ElastiCache as a key/value store (storing session data for example)

- Highly Available, Multi AZ by default, Read and Writes are decoupled, DAX for read cache

- Reads can be eventually consistent or strongly consistent

- Security, authentication and authorization is done through IAM

- DynamoDB Streams to integrate with AWS Lambda

- Backup / Restore feature, Global Table feature

- Monitoring through CloudWatch

- Can only query on primary key, sort key, or indexes

※ Use Case : Serverless applications development (small documents 100s KB), distributed serverless cache, doesn't - have SQL query language available, has transactions capability from Nov 2018

 

[ DynamoDB for Solutions Architect ]

Operations : no operations needed, auto scaling capability, serverless

Security : full security through IAM policies, KMS encryption, SSL in flight

Reliability : Multi AZ, Backups

Performance : single digit millisecond performance, DAX for caching reads, performance doesn't degrade if your application scales

Cost : Pay per provisioned capacity and storage usage (no need to guess in advance any capacity - can use auto scaling)

 

반응형

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

[AWS] 18-6. Databases in AWS : Athena  (0) 2021.09.25
[AWS] Databases in AWS : S3  (0) 2021.09.25
[AWS] 18-4. Databases in AWS : ElastiCache  (0) 2021.09.23
[AWS] 18-3. Databases in AWS : Aurora  (0) 2021.09.23
[AWS] 18-2. Databases in AWS : RDS  (0) 2021.09.23

[ 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