๐Ÿงฉ3. AWS - RDS

yoonseulesยท2021๋…„ 5์›” 4์ผ
0

CloudClub์†Œํ•™ํšŒ_AWS

๋ชฉ๋ก ๋ณด๊ธฐ
8/14
post-thumbnail

RDS (Relational DB Service)

: ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค

Relational DB ์ข…๋ฅ˜

  • Microsoft SQL
  • Oracle
  • MySQL
  • Postgre
  • Aurora: AWS์—์„œ ์ง์ ‘ ์šด์˜ํ•˜๋Š” DB. ์œ ๋ฃŒ์ž„
  • Maria DB

Data Warehousing

  • Business Intelligence
  • ๋ฆฌํฌํŠธ ์ž‘์„ฑ, ๋ฐ์ดํ„ฐ๋ถ„์„์‹œ ์‚ฌ์šฉ (Production Database -> Data Warehousing)
  • ๋งค์šฐ ๋ฐฉ๋Œ€ํ•œ ๋ถ„๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ ๋กœ๋“œ์‹œ ์‚ฌ์šฉ

OLTP VS OLAP

  1. OLTP : INSERT์™€ ๊ฐ™์ด ์ข…์ข… ์‚ฌ์šฉ๋˜์–ด์ง€๋Š”, ํ˜น์€ ๊ทœ๋ชจ๊ฐ€ ์ž‘์€ ๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ๋•Œ ์‚ฌ์šฉ๋˜๋Š” SQL์ฟผ๋ฆฌ๊ฐ€ ํ•„์š”ํ• ๋•Œ ์œ ์šฉ
    ex) Order # 210์—๋งŒ ํ•ด๋‹น๋˜๋Š” customer ์ด๋ฆ„, ์ฃผ์†Œ, ์‹œ๊ฐ„ ์ •๋ณด INSERT
  2. OLAP : ๋งค์šฐ ํฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ๋•Œ ์‚ฌ์šฉ. ์ฃผ๋กœ ๋ฉ์น˜๊ฐ€ ํฐ SELECT ์ฟผ๋ฆฌ๊ฐ€ ์‚ฌ์šฉ๋จ
    ex) ํŠน์ • ํšŒ์‚ฌ ๋ถ€์„œ์˜ Net Profit, Products

Database Backups
1. Automated Backups (์ž๋™ ๋ฐฑ์—…)
2. DB Snapshots (๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์Šค๋ƒ…์ƒท)

  1. Automated Backups(AB) - ์ž๋™ ๋ฐฑ์—…
  • Retention Period(1-35์ผ) ์•ˆ์˜ ์–ด๋–ค ์‹œ๊ฐ„์œผ๋กœ ๋Œ์•„๊ฐ€๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Œ
  • AB๋Š” ๊ทธ๋‚  ์ƒ์„ฑ๋œ ์Šค๋ƒ…์ƒท๊ณผ Transaction logs(TL)์„ ์ฐธ๊ณ ํ•จ
  • ๋””ํดํŠธ๋กœ AB๊ธฐ๋Šฅ์ด ์„ค์ •๋˜์–ด ์žˆ์œผ๋ฉฐ ๋ฐฑ์—… ์ •๋ณด๋Š” S3์— ์ €์žฅ
  • AB๋™์•ˆ ์•ฝ๊ฐ„์˜ I/O suspension์ด ์กด์žฌํ•  ์ˆ˜ ์žˆ์Œ
    -> Latency
  1. DB Snapshots (๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์Šค๋ƒ…์ƒท)
  • ์ฃผ๋กœ ์‚ฌ์šฉ์ž์— ์˜ํ•ด ์‹คํ–‰๋จ
  • ์›๋ณธ RDS Instance๋ฅผ ์‚ญ์ œํ•ด๋„ ์Šค๋ƒ…์ƒท์€ ์กด์žฌํ•จ (vs AB)

Multi AZ, Read Replicas

Multi AZ

: ์›๋ž˜ ์กด์žฌํ•˜๋Š” RDS DB์— ๋ฌด์–ธ๊ฐ€ ๋ณ€ํ™”(e.x : Write) ๊ฐ€ ์ƒ๊ธธ๋•Œ ๋‹ค๋ฅธ Availability Zone์— ๋˜‘๊ฐ™์€ ๋ณต์ œ๋ณธ์ด ๋งŒ๋“ค์–ด์ง
= Synchronize

  • AWS์— ์˜ํ•ด์„œ ์ž๋™์œผ๋กœ ๊ด€๋ฆฌ๊ฐ€ ์ด๋ฃจ์–ด์ง (No admin intervention)
  • ์›๋ณธ RDS DB์— ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธธ ์‹œ ์ž๋™์œผ๋กœ ๋‹ค๋ฅธ AZ์˜ ๋ณต์ œ๋ณธ์ด ์‚ฌ์šฉ๋จ
  • Disaster Recovery Only!

Read Replicas

: Production DB์˜ ์ฝ๊ธฐ ์ „์šฉ ๋ณต์ œ๋ณธ์ด ์ƒ์„ฑ๋จ

  • ์ฃผ๋กœ Read-Heavy DB์ž‘์—…์‹œ ํšจ์œจ์„ฑ์˜ ๊ทน๋Œ€ํ™”๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉ๋จ (Scaling)
  • Disaster Recovery์šฉ๋„๊ฐ€ ์•„๋‹˜!
  • ์ตœ๋Œ€ 5๊ฐœ Read Replica DB ํ—ˆ์šฉ
  • Read Replica์˜ Read Replica ์ƒ์„ฑ ๊ฐ€๋Šฅ (Latency ๋ฐœ์ƒ)
  • ๊ฐ๊ฐ์˜ Read Replica๋Š” ์ž๊ธฐ๋งŒ์˜ ๊ณ ์œ  Endpoint ์กด์žฌ

ElastiCache (์ถ”๊ฐ€ ์ž‘์—…)

  • ํด๋ผ์šฐ๋“œ ๋‚ด์—์„œ In-memory ์บ์‹œ๋ฅผ ๋งŒ๋“ค์–ด์คŒ
  • ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜ค๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์บ์‹œ์—์„œ ๋น ๋ฅธ ์†๋„๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜ด
  • Read-Heavy ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์ƒ๋‹นํ•œ Latency ๊ฐ์†Œ ํšจ๊ณผ ๋ˆ„๋ฆผ

Memcached

: Object ์บ์‹œ ์‹œ์Šคํ…œ์œผ๋กœ ์ž˜ ์•Œ๋ ค์ ธ ์žˆ์Œ

  • ElastiCache๋Š” Memcached์˜ ํ”„๋กœํ† ์ฝœ์„ ๋””ํดํŠธ๋กœ ๋”ฐ๋ฆ„
  • EC2 Auto Scaling์ฒ˜๋Ÿผ ํฌ๊ธฐ๊ฐ€ ์ปค์กŒ๋‹ค ์ž‘์•„์กŒ๋‹ค ๊ฐ€๋Šฅํ•จ
  • ์˜คํ”ˆ์†Œ์Šค
  • ๋‹จ์ˆœ, Object caching ์ด ์ฃผ๋ชฉ์ ์ผ๋•Œ, ์บ์‹œ ํฌ๊ธฐ๋ฅผ ๋งˆ์Œ๋Œ€๋กœ ์กฐ์ ˆํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์‚ฌ์šฉ

Redis

: Key-Value, Set, List์™€ ๊ฐ™์€ ํ˜•ํƒœ์˜ ๋ฐ์ดํ„ฐ๋ฅผ In-Memory์— ์ €์žฅ ๊ฐ€๋Šฅํ•จ

  • ์˜คํ”ˆ์†Œ์Šค, Multi-AZ์ง€์›
  • List, Set๊ณผ ๊ฐ™์€ ๋ฐ์ดํ„ฐ ์…‹์„ ์‚ฌ์šฉํ•  ๋•Œ, ๋ฆฌ๋”๋ณด๋“œ ์ฒ˜๋Ÿผ ๋ฐ์ดํ„ฐ์…‹์˜ ๋žญํ‚น์„ ์ •๋ ฌํ•˜๋Š” ์šฉ๋„๋กœ, MultiAZ ๊ธฐ๋Šฅ์ด ์‚ฌ์šฉ๋˜์–ด์งˆ ๋•Œ ์‚ฌ์šฉ

๊ฐœ๋…๊ฐ•์˜๋ฅผ ๋งˆ์น˜๋ฉฐ

๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๊ธฐ์ดˆ๋˜๋Š” ๋‚ด์šฉ๋“ค์„ ์•Œ ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„์ด์—ˆ๊ณ , AWS์—์„œ ํ™œ์šฉ๋˜๋Š” ๊ธฐ๋Šฅ/๊ตฌ์„ฑ ๋“ค์„ ์ •๋ฆฌํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค๐Ÿ˜Š

profile
๊ณต๋Œ€์ƒ ๊ฐœ๋… ์ •๋ฆฌ์šฉ

0๊ฐœ์˜ ๋Œ“๊ธ€