Search

MSA

MSA

MSA (Microservice Architecture)

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ž‘๊ณ  ๋…๋ฆฝ์ ์ธ ์„œ๋น„์Šค๋“ค์˜ ๋ชจ์Œ์œผ๋กœ ๊ตฌ์„ฑํ•˜๋Š” ์•„ํ‚คํ…์ฒ˜
โ€ข
MSA ๊ตฌ์กฐ
โ€ข
์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ ์˜ˆ์‹œ
โ€ข
MSA ๊ตฌ์„ฑ์š”์†Œ

MSA ๊ตฌ์กฐ

graph TD
    A[Client] --> B[API Gateway]
    B --> C[Service A]
    B --> D[Service B]
    B --> E[Service C]
    C --> F[Database A]
    D --> G[Database B]
    E --> H[Database C]
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#dfd,stroke:#333,stroke-width:2px
    style D fill:#dfd,stroke:#333,stroke-width:2px
    style E fill:#dfd,stroke:#333,stroke-width:2px
    style F fill:#fdd,stroke:#333,stroke-width:2px
    style G fill:#fdd,stroke:#333,stroke-width:2px
    style H fill:#fdd,stroke:#333,stroke-width:2px
Mermaid
๋ณต์‚ฌ
์œ„ ๋‹ค์ด์–ด๊ทธ๋žจ์€ MSA์˜ ๊ธฐ๋ณธ์ ์ธ ๊ตฌ์กฐ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค:
โ€ข
ํด๋ผ์ด์–ธํŠธ: ์‚ฌ์šฉ์ž ๋˜๋Š” ๋‹ค๋ฅธ ์‹œ์Šคํ…œ์—์„œ ์š”์ฒญ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค.
โ€ข
API Gateway: ๋ชจ๋“  ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ์˜ ๋‹จ์ผ ์ง„์ž…์  ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
โ€ข
๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค (Service A, B, C): ๊ฐ๊ฐ ๋…๋ฆฝ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋Š” ์ž‘์€ ์„œ๋น„์Šค๋“ค์ž…๋‹ˆ๋‹ค.
โ€ข
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค: ๊ฐ ์„œ๋น„์Šค๋Š” ์ž์ฒด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ ์˜ˆ์‹œ

์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ๋ฅผ ์˜ˆ์‹œ๋กœ ํ•œ MSA ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
graph TD
    A[๊ณ ๊ฐ] --> B[API Gateway]
    B --> C[์ƒํ’ˆ ์„œ๋น„์Šค]
    B --> D[์ฃผ๋ฌธ ์„œ๋น„์Šค]
    B --> E[๊ฒฐ์ œ ์„œ๋น„์Šค]
    B --> F[๋ฐฐ์†ก ์„œ๋น„์Šค]
    B --> G[๋ฆฌ๋ทฐ ์„œ๋น„์Šค]
    C --> H[์ƒํ’ˆ DB]
    D --> I[์ฃผ๋ฌธ DB]
    E --> J[๊ฒฐ์ œ DB]
    F --> K[๋ฐฐ์†ก DB]
    G --> L[๋ฆฌ๋ทฐ DB]
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C,D,E,F,G fill:#dfd,stroke:#333,stroke-width:2px
    style H,I,J,K,L fill:#fdd,stroke:#333,stroke-width:2px
Mermaid
๋ณต์‚ฌ
์ด ๋‹ค์ด์–ด๊ทธ๋žจ์€ ์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ์˜ MSA ๊ตฌ์กฐ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค:
โ€ข
๊ณ ๊ฐ: ์‡ผํ•‘๋ชฐ์„ ์ด์šฉํ•˜๋Š” ์‚ฌ์šฉ์ž์ž…๋‹ˆ๋‹ค.
โ€ข
API Gateway: ๋ชจ๋“  ๊ณ ๊ฐ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ ์ ˆํ•œ ์„œ๋น„์Šค๋กœ ๋ผ์šฐํŒ…ํ•ฉ๋‹ˆ๋‹ค.
โ€ข
๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค:
โ—ฆ
์ƒํ’ˆ ์„œ๋น„์Šค: ์ƒํ’ˆ ์ •๋ณด๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
โ—ฆ
์ฃผ๋ฌธ ์„œ๋น„์Šค: ์ฃผ๋ฌธ ์ฒ˜๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค.
โ—ฆ
๊ฒฐ์ œ ์„œ๋น„์Šค: ๊ฒฐ์ œ ์ฒ˜๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค.
โ—ฆ
๋ฐฐ์†ก ์„œ๋น„์Šค: ๋ฐฐ์†ก ๊ด€๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค.
โ—ฆ
๋ฆฌ๋ทฐ ์„œ๋น„์Šค: ๊ณ ๊ฐ ๋ฆฌ๋ทฐ๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
โ€ข
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค: ๊ฐ ์„œ๋น„์Šค๋Š” ๋…๋ฆฝ์ ์ธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ฐ€์ง‘๋‹ˆ๋‹ค.
์ด๋Ÿฌํ•œ ๊ตฌ์กฐ๋ฅผ ํ†ตํ•ด ๊ฐ ์„œ๋น„์Šค๋Š” ๋…๋ฆฝ์ ์œผ๋กœ ๊ฐœ๋ฐœ, ๋ฐฐํฌ, ํ™•์žฅ๋  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ „์ฒด ์‹œ์Šคํ…œ์˜ ์œ ์—ฐ์„ฑ๊ณผ ํ™•์žฅ์„ฑ์ด ํ–ฅ์ƒ๋ฉ๋‹ˆ๋‹ค.

MSA ๊ตฌ์„ฑ์š”์†Œ

MSA์˜ ์ฃผ์š” ๊ตฌ์„ฑ์š”์†Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
โ€ข
๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค
โ€ข
API Gateway
โ€ข
์„œ๋น„์Šค ๋””์Šค์ปค๋ฒ„๋ฆฌ
โ€ข
๋กœ๋“œ ๋ฐธ๋Ÿฐ์„œ
โ€ข
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค
โ€ข
๋ฉ”์‹œ์ง€ ํ
โ€ข
์ปจํ…Œ์ด๋„ˆ
โ€ข
์„œ๋น„์Šค ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜
โ€ข
๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋กœ๊น…
โ€ข
CI/CD ํŒŒ์ดํ”„๋ผ์ธ
๊ฐ ๊ตฌ์„ฑ์š”์†Œ๋Š” MSA ์‹œ์Šคํ…œ์˜ ํšจ์œจ์ ์ธ ์šด์˜๊ณผ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•ด ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์Œ์€ ์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ๋ฅผ ์˜ˆ์‹œ๋กœ ํ•œ MSA์˜ ๋ชจ๋“  ์ฃผ์š” ๊ตฌ์„ฑ์š”์†Œ๋ฅผ ํฌํ•จํ•˜๋Š” ๊ตฌ์กฐ๋„์ž…๋‹ˆ๋‹ค:
๊ตฌ์กฐ๋„ ๋‹ค์‹œ ๊ทธ๋ฆฌ๊ธฐ
graph TD
    A[๊ณ ๊ฐ] --> B[API Gateway]
    B --> C[์ƒํ’ˆ ์„œ๋น„์Šค]
    B --> D[์ฃผ๋ฌธ ์„œ๋น„์Šค]
    B --> E[๊ฒฐ์ œ ์„œ๋น„์Šค]
    B --> F[๋ฐฐ์†ก ์„œ๋น„์Šค]
    B --> G[๋ฆฌ๋ทฐ ์„œ๋น„์Šค]
    H[์„œ๋น„์Šค ๋””์Šค์ปค๋ฒ„๋ฆฌ] --> B
    H --> C
    H --> D
    H --> E
    H --> F
    H --> G
    I[๋กœ๋“œ ๋ฐธ๋Ÿฐ์„œ] --> B
    C --> J[์ƒํ’ˆ DB]
    D --> K[์ฃผ๋ฌธ DB]
    E --> L[๊ฒฐ์ œ DB]
    F --> M[๋ฐฐ์†ก DB]
    G --> N[๋ฆฌ๋ทฐ DB]
    O[๋ฉ”์‹œ์ง€ ํ] --> C
    O --> D
    O --> E
    O --> F
    P[์ปจํ…Œ์ด๋„ˆ ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜] --> C
    P --> D
    P --> E
    P --> F
    P --> G
    Q[๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋กœ๊น…] --> B
    Q --> C
    Q --> D
    Q --> E
    Q --> F
    Q --> G
    R[CI/CD ํŒŒ์ดํ”„๋ผ์ธ] --> C
    R --> D
    R --> E
    R --> F
    R --> G
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C,D,E,F,G fill:#dfd,stroke:#333,stroke-width:2px
    style H,I,O,P,Q,R fill:#ffa,stroke:#333,stroke-width:2px
    style J,K,L,M,N fill:#fdd,stroke:#333,stroke-width:2px
Mermaid
๋ณต์‚ฌ
์ด ๋‹ค์ด์–ด๊ทธ๋žจ์€ MSA์˜ ์ฃผ์š” ๊ตฌ์„ฑ์š”์†Œ๋ฅผ ๋ชจ๋‘ ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค:
โ€ข
๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค: ์ƒํ’ˆ, ์ฃผ๋ฌธ, ๊ฒฐ์ œ, ๋ฐฐ์†ก, ๋ฆฌ๋ทฐ ์„œ๋น„์Šค
โ€ข
API Gateway: ๋ชจ๋“  ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ์˜ ๋‹จ์ผ ์ง„์ž…์ 
โ€ข
์„œ๋น„์Šค ๋””์Šค์ปค๋ฒ„๋ฆฌ: ๊ฐ ์„œ๋น„์Šค์˜ ์œ„์น˜๋ฅผ ๋™์ ์œผ๋กœ ํŒŒ์•…
โ€ข
๋กœ๋“œ ๋ฐธ๋Ÿฐ์„œ: ํŠธ๋ž˜ํ”ฝ์„ ์—ฌ๋Ÿฌ ์„œ๋น„์Šค ์ธ์Šคํ„ด์Šค์— ๋ถ„์‚ฐ
โ€ข
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค: ๊ฐ ์„œ๋น„์Šค๋ณ„ ๋…๋ฆฝ์ ์ธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค
โ€ข
๋ฉ”์‹œ์ง€ ํ: ์„œ๋น„์Šค ๊ฐ„ ๋น„๋™๊ธฐ ํ†ต์‹ ์„ ์œ„ํ•œ ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค
โ€ข
์ปจํ…Œ์ด๋„ˆ ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜: ์ปจํ…Œ์ด๋„ˆํ™”๋œ ์„œ๋น„์Šค์˜ ๋ฐฐํฌ์™€ ๊ด€๋ฆฌ
โ€ข
๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋กœ๊น…: ์‹œ์Šคํ…œ ์ƒํƒœ์™€ ์„ฑ๋Šฅ ๋ชจ๋‹ˆํ„ฐ๋ง
โ€ข
CI/CD ํŒŒ์ดํ”„๋ผ์ธ: ์ง€์†์ ์ธ ํ†ตํ•ฉ๊ณผ ๋ฐฐํฌ ์ž๋™ํ™”
์ด ๊ตฌ์กฐ๋ฅผ ํ†ตํ•ด ์‡ผํ•‘๋ชฐ ์‚ฌ์ดํŠธ๋Š” ํ™•์žฅ์„ฑ, ์œ ์—ฐ์„ฑ, ๊ทธ๋ฆฌ๊ณ  ์žฅ์•  ๊ฒฉ๋ฆฌ ๋“ฑ MSA์˜ ์ด์ ์„ ๋ชจ๋‘ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.