1. Introduction

My Story with dynamoDB#

Issue#

No Nosql expert

R/W Locks#

  • upgrade HW
  • Replication
  • Slow
  • loose user

NoSql#

  • mongoDB
  • Cassandra
  • DynamoDB

requires#

  • server infrastructure
  • steep learning curve

takes a time#

loosing user#

DynamoDB#

  • two weeks migration
  • mysql -> RDS (Serverless DynamoDB)
  • No learning curve
  • no infrastructure overhead
  • server less

3. What is Dynamo DB?#

Advent of BigData.. Demends

  • high speed, scale, performance

Amazon DynamoDB#

  • nosql
  • scale on demand
  • virtually unlimited concurrent R/W
  • response time in single digit
    • (ms)
      • DAX (cache)
      • Dynamodb Accelerator
  • Integration AWS services

4. Demo Environment Setup#

image

image

  • Programmatic access
    • API credentials (access key, secret key) 를 생성한다.

image

  • 일단은, 간단하게 DynamoDB 에 대한 full access 를 부여할 것입니다.

image

Access key ID

  • Amazon DynamoDB 에 access 하기 위해 필요한 credentials 입니다.
  • 로컬 컴퓨터에 Copy 혹은 Download 하여, 안전한곳에 보관하세요.
    • 환경 변수에 추가하기

로컬 환경 변수에 추가하기 (Windows)#

  • 관리자 권한으로,
Environment Variables
Environment Variables
image
AWS_ACCESS_KEY_ID
image
AWS_SECRET_ACCESS_KEY
image
AWS_DEFAULT_REGION is on top-right corner of your AWS Management Console

리눅스 환경에 추가하기#

vi ~/.bash_profile
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=...

bash_profile 설정 대신 aws configure 설정을 해주어야 하는 것 같다.

5. Test the Setup#

const AWS = require('aws-sdk');
AWS.config.update({
region: 'ap-northeast-2',
credentials: {
accessKeyId: '...',
secretAccessKey: '...'
},
});
const dynamodb = new AWS.DynamoDB();
dynamodb.listTables((err, data) => {
if (err) {
console.log(err);
} else {
console.log(data);
}
});
$ node list-tables.js
{
TableNames: [
'dynamo-table', 'music',
'music_renew', 'order',
'personal', 'personal-api',
'post', 'push',
'test', 'user-push'
]
}
Last updated on