Post

AWS - DynamoDB๋ž€?? [AWS ๊ณต๋ถ€]

๐Ÿ“Œ Dynamo DB๋ž€?

  • ์™„์ „ ๊ด€๋ฆฌํ˜• NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์„œ๋น„์Šค
  • ๋›ฐ์–ด๋‚œ ํ™•์žฅ์„ฑ
  • ํ…Œ์ด๋ธ” ๋ฐ์ดํ„ฐ๋ฅผ json ํ˜•์‹์œผ๋กœ ์ €์žฅ
  • SSD ์Šคํ† ๋ฆฌ์ง€ ์‚ฌ์šฉ (์ฝ๊ธฐ/์“ฐ๊ธฐ ๋น ๋ฆ„)

๐Ÿ“Œ Dynamo DB๊ตฌ์„ฑ

  • ํ…Œ์ด๋ธ” (Table)
  • ์•„์ดํ…œ (Items)
  • ํŠน์ง• (Attributes)
  • Key-Value

Primary Keys

  • PK๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ฟผ๋ฆฌ
  • Partition Key์™€ Composite Key

Partition Key

  • ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„๋ฆฌ์‹œํ‚ค๋Š” ํ‚ค
  • ์‹ค์ œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋“ค์–ด๊ฐ€๋Š” ์œ„์น˜๋ฅผ ๊ฒฐ์ •

Composite Key

  • ํŒŒํ‹ฐ์…˜ํ‚ค(Partition Key) + ์ •๋ ฌํ‚ค(Sort Key)

Scaling

  • ์ „์ฒด ๋ฐ์ดํ„ฐ๋ฅผ ๊ณจ๊ณ ๋ฃจ ๋ถ„์‚ฐ์‹œํ‚ค๊ธฐ ์œ„ํ•ด Partition Key ์‚ฌ์šฉ
  • ๋กœ๋“œ๊ฐ€ ์ ์€ DDB์˜ ํ…Œ์ด๋ธ” ์‚ฌ์šฉ์‹œ ํ•œ ์„œ๋ฒ„๋กœ ์ฒ˜๋ฆฌ

๐Ÿ“Œ ๋ฐ์ดํ„ฐ ์ฝ์–ด์˜ค๊ธฐ

Query

  • Primary Key๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ๊ฒ€์ƒ‰
  • Query์‚ฌ์šฉ์‹œ ๋ชจ๋“  ๋ฐ์ดํ„ฐ(์ปฌ๋Ÿผ) ๋ฐ˜ํ™˜

Scan

  • ๋ชจ๋“  ๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ด (primary key ์‚ฌ์šฉ X)
  • ์ˆœ์ฐจ์ ๋ฐฉ๋ฒ• (Sequential)

Query๊ฐ€ Scan๋ณด๋‹ค ํ›จ์”ฌ ํšจ์œจ์ 

This post is licensed under CC BY 4.0 by the author.