[Programming] Reactive (๋ฆฌ์•กํ‹ฐ๋ธŒ)

๋ฐ˜์‘ํ˜•

์›น ์„œ๋น„์Šค์—์„œ ํ”ํžˆ ๋ฐœ์ƒํ•˜๋Š” ์ผ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ API ๊ฒฐ๊ณผ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ n๊ฐœ์˜ API ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›์•„๋ณด๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ํ”ํžˆ ์šฐ๋ฆฌ๊ฐ€ SPA๋ฅผ ๊ฐ€์ง€๊ณ  ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“ค๋‹ค๋ณด๋ฉด ์—ฌ๋Ÿฌ API๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ์ผ์ด ์žˆ๋Š”๋ฐ, ์ด์™€ ๋น„์Šทํ•œ ์ด์•ผ๊ธฐ์ž…๋‹ˆ๋‹ค.

 

Reactive Programming์ด ๋‚˜์˜ค๊ธฐ ์ด์ „, ์šฐ๋ฆฌ๊ฐ€ ์ƒ๊ฐํ•˜๋Š” ๋Œ€๊ทœ๋ชจ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ ๊ทธ๋ƒฅ ์ˆ˜์‹ญ๋Œ€ ์„œ๋ฒ„๋ฅผ ๊ฐ€์ง€๊ณ  GB ์ •๋„์˜ ๋ฐ์ดํ„ฐ, ๋ช‡ ์ดˆ ๊ฑธ๋ฆฌ๋Š” ์‘๋‹ต ์‹œ๊ฐ„, ์œ ์ง€๋ณด์ˆ˜๋Š” ๋ช‡ ์‹œ๊ฐ„ ๊ฑธ๋ฆฌ๋Š” ์ •๋„๊ฐ€ ๋‹น์—ฐํ•˜๋‹ค. ๋ผ๊ณ  ๋ณด๊ณ  ์šด์˜์„ ํ•ด์™”์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ง€๊ธˆ์€ ์–ด๋–จ๊นŒ์š”? ๋‹ค์–‘ํ•œ ์„œ๋น„์Šค๊ฐ€ ์žˆ๊ณ , ํŠนํžˆ ํ•œ๊ตญ์—์„œ๋Š” ์ธํ„ฐ๋„ท ์†๋„๊ฐ€ ๊ต‰์žฅํžˆ ๋น ๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ํŽ˜์ด์ง€ ๋กœ๋”ฉ ์‹œ๊ฐ„์ด ์ˆ˜ ์ดˆ๋ผ๋„ ๊ฑธ๋ฆฌ๋ฉด ๊ทธ๋ƒฅ ๋‹ซ์•„๋ฒ„๋ฆฌ๋Š” ๊ฒŒ ๊ด€์Šต์ด ๋˜์–ด๋ฒ„๋ ธ์ฃ .

 

์ด๋ ‡๊ฒŒ ๋ณ€ํ™”๊ฐ€ ๋œ ์ด์œ ๋Š” ๋ฌด์—‡์ผ๊นŒ์š”?

 

  • ๋Š˜์–ด๋‚œ ๋ฐ์ดํ„ฐ

    ์‹œ๊ฐ„์ด ๊ฐˆ์ˆ˜๋ก ๋ฐ์ดํ„ฐ๋Ÿ‰์€ ๋Š˜์–ด๋‚˜๋Š”๋ฐ, ๊ทธ์— ๋”ฐ๋ผ ์„ฑ๋Šฅ์ด ๋”ฐ๋ผ๊ฐ€์ง€ ๋ชปํ•จ.

  • ์‚ฌ์šฉ ํŒจํ„ด์˜ ๋ณ€ํ™”

    ์‚ฌ์šฉ์ž๋Š” 1๋…„ ๋‚ด๋‚ด ์–ธ์ œ ์–ด๋””์„œ๋“  ms ๋‹จ์œ„์˜ ์‘๋‹ต ์‹œ๊ฐ„์„ ์š”๊ตฌํ•จ.

 

์š”๊ตฌ ์‚ฌํ•ญ์ด ๋Š˜์–ด๋‚˜๊ณ  ์‚ฌ์šฉ์ž๊ฐ€ ๋Š˜์–ด๋‚˜๋ฉด ๊ทธ๋งŒํผ ๋ฐ์ดํ„ฐ๋Š” ๋Š˜์–ด๋‚˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ๊ทธ์— ๋”ฐ๋ผ์„œ ์„ฑ๋Šฅ๋„ ๋ณ€ํ™”๊ฐ€ ์ƒ๊ธฐ๋Š”๋ฐ, ์‚ฌ์šฉ์ž๋Š” ๊ทธ๋กœ ์ธํ•œ ์„ฑ๋Šฅ ๋ณ€ํ™”์— ๋˜๊ฒŒ ๋ฏผ๊ฐํ•˜๋‹ค๋Š” ๊ฒƒ์ด์ฃ . ๋”ฐ๋ผ์„œ Reactive Programming์€ ์ด๋Ÿฌํ•œ ์„ฑ๋Šฅ ๋ณ€ํ™”์— ๋Œ€์ฒ˜ํ•˜๊ธฐ ์œ„ํ•œ ๊ธฐ์ˆ ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

Reactive

์ด๋Ÿฐ ์˜๋ฌธ์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ ๋„๋Œ€์ฒด Reactive๊ฐ€ ๋ญ์•ผ? ์ œ๊ฐ€ ์ƒ๊ฐํ•˜๋Š” Reactive ๋ž€, ๋งˆ์šฐ์Šค ์ด๋ฒคํŠธ๋‚˜ Network I/O ๋“ฑ์˜ ์ž…๋ ฅ ์ด๋ฒคํŠธ๋ฅผ ๋ฐœ์ƒ์‹œ์ผฐ์„ ๋•Œ ์ฆ‰๊ฐ ๋ฐ˜์‘ํ•˜์—ฌ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ์„ Reactive๋ผ ํ•ฉ๋‹ˆ๋‹ค.

 

์Œ ์ด๊ฒƒ๋งŒ ๊ฐ€์ง€๊ณ ๋Š” ์„ค๋ช…์ด ๋ถ€์กฑํ•œ๋ฐ? ๊ทธ๋Ÿฌ๋ฉด ์ด๋Ÿฐ ๊ฑด ์–ด๋–จ๊นŒ์š”. ์šฐ๋ฆฌ๊ฐ€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์›ํ•˜๋Š” ์ •๋ณด๋ฅผ ๊ฒ€์ƒ‰ํ•˜๊ณ ์ž ํ•  ๋•Œ ๊ทธ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ๋ณด๋ ค๋ฉด Enter๋ฅผ ๋ˆŒ๋Ÿฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ Reactive๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ”๋กœ ์ฝ์–ด์„œ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด์ฃ . ์ด๊ฒƒ์„ ์šฐ๋ฆฌ๋Š” Reactive๋ผ ํ•ฉ๋‹ˆ๋‹ค.

 

 

 

Reactive Manifesto

Reactive Manifesto๋Š” "Reactive"๋ผ๋Š” ์šฉ์–ด๋ฅผ ์ •์˜ํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ ์„ ์–ธ๋ฌธ์œผ๋กœ ์ด ์„ ์–ธ๋ฌธ์—๋Š” Reactive์˜ 4๊ฐ€์ง€ ์†์„ฑ์„ ์ด์•ผ๊ธฐ ํ•ฉ๋‹ˆ๋‹ค.

 

 

The Reactive Manifesto

Responsive: The system responds in a timely manner if at all possible. Responsiveness is the cornerstone of usability and utility, but more than that, responsiveness means that problems may be detected quickly and dealt with effectively. Responsive systems

www.reactivemanifesto.org

 

  • ๋ฐ˜์‘์„ฑ (Responsive)

    Reactive ์‹œ์Šคํ…œ์€ ์ผ์ •ํ•˜๊ณ  ์˜ˆ์ƒ ๊ฐ€๋Šฅํ•œ ๋ฐ˜์‘ ์‹œ๊ฐ„์„ ์ œ๊ณตํ•ด์•ผ ํ•จ.

  • ํšŒ๋ณต์„ฑ (Resilient)

    ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•ด๋„ ์‹œ์Šคํ…œ์˜ ์šด์˜์€ ์ง€์†๋˜์–ด์•ผ ํ•จ. 

  • ํƒ„๋ ฅ์„ฑ (Elastic)

    ๋Œ€์šฉ๋Ÿ‰ ํŠธ๋ž˜ํ”ฝ๊ณผ ๊ฐ™์€ ๊ฑฐ๋Œ€ํ•œ ๋ถ€ํ•˜ ๋‚ด์—์„œ๋„ ๋ฒ„ํ‹ธ ์ˆ˜ ์žˆ๋„๋ก ์ปดํฌ๋„ŒํŠธ ์ž์› ์ˆ˜๋ฅผ ๋™์ ์œผ๋กœ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•จ.

  • ๋ฉ”์‹œ์ง€ ์ฃผ๋„ (message-driven)

    ํšŒ๋ณต์„ฑ๊ณผ ํƒ„๋ ฅ์„ฑ ์›์น™์„ ์ง€ํ‚ค๊ธฐ ์œ„ํ•ด์„  ๋Š์Šจํ•œ ๊ฒฐํ•ฉ, ๊ณ ๋ฆฝ, ์œ„์น˜ ํˆฌ๋ช…์„ฑ ๋“ฑ์„ ์ง€์›ํ•˜๋„๋ก ์ปดํฌ๋„ŒํŠธ ๊ฐ„ ๊ฒฝ๊ณ„๊ฐ€ ๋ช…ํ™•ํ•ด์•ผ ํ•จ.
    (๋น„๋™๊ธฐ ํ”„๋กœํ† ์ฝœ์„ ์ด์šฉํ•œ ๋ฉ”์‹œ์ง€ ๊ธฐ๋ฐ˜์˜ ํ†ต์‹ ์œผ๋กœ ๋Š์Šจํ•œ ๊ฒฐํ•ฉ์˜ ์‹œ์Šคํ…œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๊ถŒ์žฅ)

์ž์„ธํžˆ ๋ณด๋ฉด ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ์•„ํ‚คํ…์ฒ˜๊ฐ€ ๊ฐ–์ถฐ์•ผ ํ•  ์›์น™์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๊ฐ€ ์‹œ์Šคํ…œ์„ ์ข€ ๋” ๋ฆฌ์•กํ‹ฐ๋ธŒํ•˜๊ฒŒ ๊ฐœ๋ฐœํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ๊ฐ„ ๊ฒฐํ•ฉ์ด ๋Š์Šจํ•ด์•ผ ํ•œ๋‹ค๋Š” ๊ฒƒ์ธ๋ฐ, ๊ทธ๋ž˜์•ผ๋งŒ ํ•œ ์ปดํฌ๋„ŒํŠธ์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ด๋„ ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ๊นŒ์ง€ ์ „ํŒŒ๊ฐ€ ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

 

๊ทธ๋ ‡๋‹ค๋ฉด ์ด๋Ÿฌํ•œ ์‹œ์Šคํ…œ์€ ์–ด๋””์—์„œ ์ฃผ๋กœ ๋งŽ์ด ์‚ฌ์šฉ๋ ๊นŒ์š”?

 

  • ํด๋ผ์šฐ๋“œ, ์ปจํ…Œ์ด๋„ˆ
  • IoT

ํด๋ผ์šฐ๋“œ์™€ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ํ†ตํ•ด ๊ฒฝ๋Ÿ‰ํ™” ๋œ ์‹œ์Šคํ…œ์„ ๋ฐฐํฌํ•˜๋Š” ๋ฐ ์šฉ์ดํ•œ๋ฐ, ์ด๋ ‡๊ฒŒ ๊ฒฝ๋Ÿ‰ํ™”ํ•˜๊ณ  ๋ถ„์‚ฐ๋œ ์‹œ์Šคํ…œ์„ ํ•˜๋‚˜์˜ ์„œ๋น„์Šค๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•˜์—ฌ Reactive๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

IoT์˜ ๊ฒฝ์šฐ, ์„œ๋ฒ„๊ฐ€ ์—ฌ๋Ÿฌ ์„ผ์„œ, ํ•˜๋“œ์›จ์–ด ๋“ฑ์„ ์—ฐ๊ฒฐํ•œ ์ƒํƒœ๋กœ ๋ชจ๋‹ˆํ„ฐ๋ง ํ•œ๋‹ค๊ฑฐ๋‚˜ ์ œ์–ด๋ฅผ ํ•œ๋‹ค๊ณ  ํ•˜์˜€์„ ๋–„ ์ด์— ์ฆ‰๊ฐ ๋ฐ˜์‘ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•˜๋Š” ์š”๊ตฌ ์‚ฌํ•ญ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด Reactive๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์˜ˆ์‹œ๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

Reactive System

Reactive๋ฅผ ๋ชจํƒœ๋กœ ํ•œ ๊ฐœ๋…์—๋Š” Reactive Programming๊ณผ Reactive System์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค์ƒ Reactive Programming์€ Reactive System์— ํ•˜์œ„์— ์†ํ•˜๋Š” ๊ฐœ๋…์ž…๋‹ˆ๋‹ค.

 

์šฐ๋ฆฌ๋Š” ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ๊ณผ ๋ถ„์‚ฐ ์‹œ์Šคํ…œ์„ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•ด ์‹œ์Šคํ…œ ๋ ˆ๋ฒจ์—์„œ ์•„ํ‚คํ…ํŠธ์™€ DevOps๋ฅผ ์œ„ํ•œ ์ƒ์‚ฐ์„ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ํ”ํžˆ ์šฐ๋ฆฌ๊ฐ€ ๋ฐฐํฌ ์ž๋™ํ™”๋‚˜ ํ…Œ์ŠคํŠธ ์ž๋™ํ™”๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” CI/CD ๋‚ด์ง€ ํ˜•์ƒ ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์ด ์ด์— ํ•ด๋‹นํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ, ์ด๋Ÿฌํ•œ ๊ฒƒ๋“ค๋„ Reactive System์œผ๋กœ ๊ตฌ์ถ•ํ•œ๋‹ค๋ฉด ๋ณด๋‹ค ์œ ์—ฐํ•˜๊ณ , ๋Š์Šจํ•œ ๊ฒฐํ•ฉ์„ ๊ฐ€์ง€๋ฉด์„œ ํ™•์žฅ์„ฑ ์žˆ๋Š” ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์‹œ์Šคํ…œ์„ ์ฑ„ํƒํ•œ ๋Œ€ํ‘œ์ ์ธ ์•„ํ‚คํ…์ฒ˜์—๋Š” Micro Service Architecture๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

์˜ˆ๋ฅผ ๋“ค์–ด, ์ปค๋จธ์Šค ์„œ๋น„์Šค๊ฐ€ ์žˆ๋‹ค๋ฉด ์ปค๋จธ์Šค๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ๋ฌผ๊ฑด์„ ์ฃผ๋ฌธํ•˜๊ณ , ๊ฒฐ์ œํ•˜์—ฌ ๋ฐฐ์†ก๊นŒ์ง€ํ•ด์ฃผ๋Š” ์„œ๋น„์Šค์ธ๋ฐ, ๋งŒ์•ฝ ๋Š์Šจํ•œ ๊ฒฐํ•ฉ์—†์ด ๊ฐ•๋ ฅํ•˜๊ฒŒ ๊ฒฐํ•ฉ๋˜์–ด ์žˆ๋Š” ์„œ๋น„์Šค๋ผ๋ฉด ์„œ๋กœ์˜ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฐ ์ปดํฌ๋„ŒํŠธ์— ์˜์กดํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด์„œ ํ•˜๋‚˜์˜ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ๋ชจ๋“  ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์ค‘๋‹จ์ด ๋˜๊ณ , ๊ฒฐ๊ตญ ์„œ๋น„์Šค๋Š” ์‚ฌ์šฉ ๋ถˆ๋Šฅ์—๊นŒ์ง€ ์ด๋ฅด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

ํ•˜์ง€๋งŒ ์œ„ ํ™”๋ฉด์ฒ˜๋Ÿผ ์„œ๋กœ๊ฐ€ ๋…๋ฆฝ์ด ๋˜์–ด ์žˆ๊ณ , ์ด๋“ค์„ ํ†ต์‹ ํ•˜๋Š”๋ฐ ์ง์ ‘์ ์ธ ๊ฒฐํ•ฉ์ด ์•„๋‹Œ ๊ฐ„์ ‘์ ์ธ ๊ฒฐํ•ฉ์„ ์ œ๊ณตํ•จ์œผ๋กœ์จ ํ•˜๋‚˜์˜ ์ปดํฌ๋„ŒํŠธ์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹คํ•˜๋”๋ผ๋„ ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ์—๋Š” ์˜ํ–ฅ์„ ๋ฏธ์น˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์„œ๋น„์Šค๊ฐ€ ์‚ฌ์šฉ ๋ถˆ๋Šฅ๊นŒ์ง€๋Š” ๊ฐ€์ง€ ์•Š๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

 

 

Reactive Programming

๊ทธ๋ ‡๋‹ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ ˆ๋ฒจ์—์„œ๋Š” ๋ฌด์—‡์ด ์š”๊ตฌ๋ ๊นŒ์š”? ์‹œ์Šคํ…œ์—์„œ๋Š” ๋Š์Šจํ•œ ๊ฒฐํ•ฉ, ๋ฉ”์‹œ์ง€ ์ฃผ๋„์˜ ๊ฐœ๋ฐœ ๋“ฑ์ด ํ•„์š”ํ–ˆ๋‹ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ํƒœ์Šคํฌ๋ฅผ ๋น„๋™๊ธฐ๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

๋งŒ์•ฝ, ๋™๊ธฐ๋กœ ์‹คํ–‰ํ•œ๋‹ค๋ฉด ์–ด๋–จ๊นŒ์š”? ๋งˆ์šฐ์Šค ์ด๋ฒคํŠธ๋ฅผ ๋Œ€๊ธฐํ•˜๊ณ  ์žˆ๋Š” ํƒœ์Šคํฌ๊ฐ€ ์ด๋ฒคํŠธ๋ฅผ ๋ฐ›๊ณ  ๊ทธ๊ฒƒ์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋™์•ˆ์—๋Š” ์•„๋ฌด๋Ÿฐ ์ผ๋„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๋ฐ๊นŒ์ง€ ๋ชจ๋“  ์‹œ๊ฐ„์ด ์†Œ๋ชจํ•˜๋ฏ€๋กœ Reactiveํ•œ ํ”„๋กœ๊ทธ๋žจ์ด ๋  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

 

์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅ ์ด๋ฒคํŠธ๋ฅผ ๋ฐœ์ƒ์‹œ์ผฐ์„ ๋•Œ ์ž…๋ ฅ์„ ์ง„ํ–‰ํ•˜๋Š” ๋™์•ˆ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ”๋กœ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋„๋ก ์Šค๋ ˆ๋“œ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋น„๋™๊ธฐ๋ฅผ ์ฒ˜๋ฆฌํ•จ์œผ๋กœ์จ Reactiveํ•˜๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ Reactive Programming์—์„œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๋น„๋™๊ธฐ๊ฐ€ ์š”๊ตฌ๋ฉ๋‹ˆ๋‹ค.

 

ํ•˜์ง€๋งŒ ์„œ๋ฒ„ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํ•˜๋‹ค๋ณด๋ฉด ๋ชจ๋“  ์ž‘์—…์„ ๋น„๋™๊ธฐ๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐ๋Š” ํ•œ๊ณ„๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๋ฆฌ์•กํ‹ฐ๋ธŒํ•œ ์•„ํ‚คํ…์ฒ˜๋กœ ๋„˜์–ด๊ฐ€๊ธฐ ์œ„ํ•œ ์ƒ์‚ฐ์ ์ธ ๋ฐฉ๋ฒ•์ด ํ•„์š”ํ•˜๋‹ค๋ฉด Strangler Pattern์„ ์ด์šฉํ•ด๋ณผ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

Strangler Fig pattern - Cloud Design Patterns

Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services.

docs.microsoft.com

 

 

 

๋งˆ์น˜๋ฉฐ..

์‚ฌ์‹ค ์ด ๊ธ€์„ ์ ๊ธฐ ์ด์ „์— RxJava๋ผ๋Š” ๊ธ€์— ๋Œ€ํ•ด์„œ ํฌ์ŠคํŒ…์„ ํ–ˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ ๊ธ€์„ ๋‹ค์‹œ ์ฝ์–ด๋ณด๋ฉด์„œ ๋ฌด์–ธ๊ฐ€ Reactive Programming์— ๋Œ€ํ•œ ์„ค๋ช…์ด ์—†์ด ์ˆœ์ˆ˜ RxJava์— ๋Œ€ํ•œ ์ด์•ผ๊ธฐ๋ฅผ ํ•œ ๊ฒƒ ๊ฐ™์•„ Reactive๊ฐ€ ์–ด๋–ค ๊ฒƒ์ธ์ง€ ์ข€ ๋” ์ƒ์„ธํ•˜๊ฒŒ ์ด์•ผ๊ธฐ ํ•˜๊ณ , ์•Œ๊ณ  ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•˜์—ฌ ์ ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

Reactive๋ฅผ ์ฒ˜์Œ ์ ‘ํ•˜์‹œ๋Š” ๋ถ„๋“ค์ธ๋ฐ, MSA๋ฅผ ํ•˜๊ณ  ๊ณ„์‹œ๋Š” ๋ถ„๋“ค์ด๋ผ๋ฉด MSA๋กœ ์šด์˜ํ•˜๊ธฐ ์œ„ํ•ด Reactive๊ฐ€ ํ•„์ˆ˜์ ์œผ๋กœ ์žˆ์–ด์•ผ ํ•œ๋‹ค๋ผ๋Š” ๊ฒƒ์€ ์–ด๋Š ์ •๋„ ๊ณต๊ฐํ•˜์…จ์„ ๊ฒƒ์ด๋ผ๊ณ  ๋ด…๋‹ˆ๋‹ค. ๋ฉ”์‹œ์ง€ ๊ธฐ๋ฐ˜๊ณผ ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜์— ๋Œ€ํ•ด ์ข€ ๋” ์•Œ๊ณ  ์‹ถ์œผ์‹  ๋ถ„๋“ค์ด ๊ณ„์‹ ๋‹ค๋ฉด ์•„๋ž˜์˜ ๊ธ€์„ ์ฐธ๊ณ ํ•ด๋ณด๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

What is #Reactive? Read Reactive Programming vs Reactive Systems @jboner & @viktorklang | @lightbend

Landing on a set of simple Reactive design principles in a sea of constant confusion and overloaded expectations.

www.lightbend.com

์ €๋Š” RxJava๋ฅผ ์ด์šฉํ•˜์—ฌ ์•ˆ๋“œ๋กœ์ด๋“œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํ–ˆ์„ ๋–„ ์ฒ˜์Œ Reactive๋ฅผ ์‚ฌ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋‹น์‹œ์—๋Š” Reactive๊ฐ€ ํด๋ผ์ด์–ธํŠธ์—์„œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐœ๋…์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์—ˆ๋Š”๋ฐ, ์ด๋ฒˆ์— Reactive ๊ธ€์„ ์ ๊ฒŒ ๋˜๋ฉด์„œ ํ˜„์žฌ ํ˜„์—…์—์„œ Python์„ ๊ฐ€์ง€๊ณ  MSA ๊ธฐ๋ฐ˜์˜ ์„œ๋น„์Šค๋กœ ์ „ํ™˜ํ•œ ์•„ํ‚คํ…์ฒ˜ ๋˜ํ•œ Reactive์˜ ๊ฐœ๋…์ด ๋“ค์–ด๊ฐ€ ์žˆ์—ˆ์Œ์„ ๋‹ค์‹œ ํ•œ ๋ฒˆ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

 

 

๋ฐ˜์‘ํ˜•
TAGS.

Tistory Comments