Home [AWS] Cloudfront
Post
Cancel

[AWS] Cloudfront

Cloudfront

  • Edge Location์„ ํ™œ์šฉํ•ด์„œย ์ •์ /๋™์  ์ฝ˜ํ…์ธ ๋ฅผ ์œ ์ €๋“ค์—๊ฒŒ ๋ณด๋‹ค ๋น ๋ฅด๊ฒŒ ์ „๋‹ฌํ•ด์ฃผ๋Š” ์„œ๋น„์Šค
    • Edge Location : ์ฝ˜ํ…์ธ ๊ฐ€ ์บ์‹œ(Cache)๋˜๊ณ  ์œ ์ €์—๊ฒŒ ์ œ๊ณตํ•˜๋Š” ๊ณณ
    • ์›๋ฆฌ : Cloudfront๋Š” ์—ฌ๋Ÿฌ ๋‚˜๋ผ์˜ Edge๋ฅผ ๋ณด์œ ํ•˜๊ณ ์žˆ์Œย ยป
      • ๋งŒ์•ฝ ์š”์ฒญ ๋ฐ›์€ ์ปจํ…์ธ ๊ฐ€ Edge Location์— ์žˆ๋‹ค๋ฉดย ยป ๋ฐ”๋กœ ์œ ์ €๋“ค์—๊ฒŒ ์ฝ˜ํ…์ธ ๋ฅผ ์ œ๊ณต
      • ๋งŒ์•ฝ ์š”์ฒญ ๋ฐ›์€ ์ปจํ…์ธ ๊ฐ€ Edge Location์— ์—†๋‹ค๋ฉดย ยป ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด Edge์— ์ ‘๊ทผํ•˜์—ฌ, origin์—์„œ ์ •๋ณด๋ฅผ ์ œ๊ณต๋ฐ›๊ณ , TTL(Time to Live)๋งŒํผ Edge Location์— ์บ์‹ฑย ยป ์œ ์ €๋“ค์—๊ฒŒ ์ฝ˜ํ…์ธ ๋ฅผ ์ œ๊ณต
        • Edge์™€ Origin ์‚ฌ์ด์˜ ๋ฐ์ดํ„ฐ ์ „์†ก์˜ ์ง€์†์ ์ธ ์—ฐ๊ฒฐ์„ ์œ ์ง€ํ•˜๊ธฐ์— ์ฝ˜ํ…์ธ  ์ „์†ก ์†๋„์˜ ํ–ฅ์ƒ์ด ์ฆ๊ฐ€๋ฉ๋‹ˆ๋‹ค.
    • origin (ex. AWS service(EC2 Instance, S3 Bucket), On-Premise etcโ€ฆ)
      • static contents : S3 (์บ์‹ฑ์œผ๋กœ ์ ‘๊ทผ ์†๋„ ์ตœ์ ํ™”)
      • dynamic contents : ๋„คํŠธ์›Œํฌ ์ตœ์ ํ™”, ์—ฐ๊ฒฐ ์œ ์ง€, Gzip ์••์ถ• ๋“ฑ์„ ์‚ฌ์šฉ

Content Delivery Network(CDN)

  • ๋งŒ์•ฝ ํŠน์ • ์›น ํŽ˜์ด์ง€๋ฅผ ์„œ๋ฒ„์— ์š”์ฒญํ•  ๋•Œ ํ˜„์žฌ ์–ด๋””์—์„œ ๋ถˆ๋ ค์ง€๋Š”์ง€, ์›น ํŽ˜์ด์ง€๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋ ค๊ณ  ํ•˜๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์–ด๋””์— ๊ฑฐ์ฃผํ•˜๋Š”์ง€์— ๊ทผ๊ฑฐํ•˜์—ฌ ์ฝ˜ํ…์ธ  ์›น ํŽ˜์ด์ง€์— ์ „๋‹ฌํ•ด์ฃผ๋Š” ๋ถ„์‚ฐ ๋„คํŠธ์›Œํฌ
  • ๋Œ€๋ถ€๋ถ„ CDN์€ ๋ณดํ†ต ์ •์ /๋™์  ์ปจํ…์ธ ๋ฅผ ๋ถ„๋ฆฌํ•ด์„œ ์‚ฌ์šฉ
    • ๋™์  ์ปจํ…์ธ ๋Š” App Server์—์„œ ๊ตฌ๋™๋˜๊ณ , ๊ทธ ์•ˆ์— ์ •์  ์ปจํ…์ธ ๋Š” CDN Server๋ฅผ ํ†ตํ•ด End-Point๋ฅผ ๊ตฌ๋ถ„์ง€์–ด ์ปจํ…์ธ ๋ฅผ ์ „๋‹ฌ
  • ์ •์  ์ปจํ…์ธ  ํŒŒ์ผ
    • html, css, js, image, etcโ€ฆ (์„œ๋ฒ„(EC2)๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์€, ์ž์ฃผ ๋ฐ”๋€Œ์ง€ ์•Š๋Š” ์ •์  ํŒŒ์ผ๋“ค)
    • ์—ฌ๋Ÿฌ CDN Server์— ์˜ฌ๋ ค ์‚ฌ์šฉ์ž๊ฐ€ ์ข€ ๋” ๋น ๋ฅด๊ฒŒ ์ฝ˜ํ…์ธ ๋ฅผ ์ „๋‹ฌ๋ฐ›์„ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค€๋‹ค.
    • origin : S3
      • S3์— ๋„ฃ์–ด ํ˜ธ์ŠคํŒ…ํ•˜๋Š”๊ฒƒ์ด ํ›จ์”ฌย ์ €๋ ดํ•˜๊ฒŒ ๋จนํžŒ๋‹ค.
      • ์ˆ˜์ฒœ, ์ˆ˜๋งŒ๋ช… ์‚ฌ๋žŒ๋“ค์—๊ฒŒ ํ•œ๊บผ๋ฒˆ์— ์„œ๋น„์Šค ๋˜์–ด๋„ ์ƒ๊ด€ ์—†์„ ์ •๋„๋กœ ๊ฒฌ๊ณ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋”ฐ๋กœ ์˜คํ† ์Šค์ผ€์ผ๋ง์ด๋‚˜ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ž‘์—…์ด ํ•„์š”์—†๋‹ค.
  • ๋™์  ์ปจํ…์ธ 
    • ์„œ๋ฒ„๊ฐ€ ํ•„์š”ํ•œ ์ฝ˜ํ…์ธ  (Node.js ์›น์„œ๋ฒ„, PHP, Go, Python ๋“ฑ ์„œ๋ฒ„์—์„œ ๋งค๋ฒˆ ๋ฐ”๋€Œ๋Š” ์ปจํ…์ธ , DB์กฐํšŒ ๋“ฑ ex. ๋กœ๊ทธ์ธ, ๊ฒŒ์‹œํŒ)
    • ์ž์ฃผ ๋ณ€๊ฒฝ๋˜๋Š” ์ •๋ณด, ์‚ฌ์šฉ์ž๊ฐ€ ๋ณด๋‚ธ ์š”์ฒญ์— ํฌํ•จ๋œ ์š”์ธ์— ๋”ฐ๋ผ ๊ทธ ๋‚ด์šฉ์ด ๋ณ€๊ฒฝ๋˜๋Š” ์ปจํ…์ธ 
    • ์ •์  ์บ์‹ฑํ•œ๋‹ค๋ฉด TTL ์‹œ๊ฐ„ ๋™์•ˆ ์‚ฌ์šฉ์ž๋Š” ์ƒˆ๋กญ๊ฒŒ ์ถ”๊ฐ€/์ˆ˜์ •๋œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณผ ์ˆ˜ ์—†๊ฒŒ ๋œ๋‹ค.

Example

Screen Shot 2023-04-25 at 10 55 02 AM ์„œ๋ฒ„(EC2)์˜ ์—ฐ์‚ฐ์ด ํ•„์š”ํ•œ ๋™์  ์ฝ˜ํ…์ธ ์˜ ์š”์ฒญ์„ EC2๋กœ ํ–ฅํ•˜๊ฒŒ Distribution ์ฒ˜๋ฆฌํ•˜๊ณ  ์„œ๋ฒ„๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์€ ์ •์  ์ฝ˜ํ…์ธ ๋Š” S3 ๋ฒ„ํ‚ท ๋“ฑ์œผ๋กœ Distribution ์ฒ˜๋ฆฌํ•˜๋Š” ๊ตฌ์„ฑ์„ ๊ณ ๋ คํ•ด๋ณผ ์ˆ˜ ์žˆ๋‹ค.

Recommend

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

[Development] Redis

-

Comments powered by Disqus.