|
20 | 20 | ---
|
21 | 21 |
|
22 | 22 | ### ๋ฐ์ดํฐ๋ฒ ์ด์ค ํ
|
| 23 | +- **Connection Pool** |
| 24 | + - ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ฐ๋ผ ๊ฐ ์ดํ๋ฆฌ์ผ์ด์
์ ์ค๋ ๋์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ๊ทผํ๊ธฐ ์ํด์๋ Connection์ด ํ์ํ๋ค. |
| 25 | + - Connection pool์ ์ด๋ฐ Connection์ ์ฌ๋ฌ ๊ฐ ์์ฑํด ๋์ด ์ ์ฅํด ๋์ **๊ณต๊ฐ(์บ์)**, ๋๋ ์ด ๊ณต๊ฐ์ Connection์ ํ์ํ ๋ ๊บผ๋ด ์ฐ๊ณ ๋ฐํํ๋ **๊ธฐ๋ฒ**์ ๋งํ๋ค. |
| 26 | + |
| 27 | + |
| 28 | +- **DB์ ์ ๊ทผํ๋ ๋จ๊ณ** |
| 29 | + 1. ์น ์ปจํ
์ด๋๊ฐ ์คํ๋๋ฉด์ DB์ ์ฐ๊ฒฐ๋ Connection ๊ฐ์ฒด๋ค์ ๋ฏธ๋ฆฌ ์์ฑํ์ฌ pool์ ์ ์ฅํ๋ค. |
| 30 | + 2. DB์ ์์ฒญ ์, pool์์ Connection ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ DB์ ์ ๊ทผํ๋ค. |
| 31 | + 3. ์ฒ๋ฆฌ๊ฐ ๋๋๋ฉด ๋ค์ pool์ ๋ฐํํ๋ค. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +- **Connction์ด ๋ถ์กฑํ๋ฉด?** |
| 36 | +๋ชจ๋ ์์ฒญ์ด DB์ ์ ๊ทผํ๊ณ ์๊ณ ๋จ์ Conncetion์ด ์๋ค๋ฉด, ํด๋น ํด๋ผ์ด์ธํธ๋ ๋๊ธฐ ์ํ๋ก ์ ํ์ํค๊ณ Pool์ Connection์ด ๋ฐํ๋๋ฉด ๋๊ธฐ ์ํ์ ์๋ ํด๋ผ์ด์ธํธ์๊ฒ ์์ฐจ์ ์ผ๋ก ์ ๊ณต๋๋ค. |
| 37 | + |
| 38 | +- **์ ์ฌ์ฉํ ๊น?** |
| 39 | + - ๋งค ์ฐ๊ฒฐ๋ง๋ค Connection ๊ฐ์ฒด๋ฅผ ์์ฑํ๊ณ ์๋ฉธ์ํค๋ ๋น์ฉ์ ์ค์ผ ์ ์๋ค. |
| 40 | + - ๋ฏธ๋ฆฌ ์์ฑ๋ Connection ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์, DB ์ ๊ทผ ์๊ฐ์ด ๋จ์ถ๋๋ค. |
| 41 | + - DB์ ์ ๊ทผํ๋ Connection์ ์๋ฅผ ์ ํํ์ฌ, ๋ฉ๋ชจ๋ฆฌ์ DB์ ๊ฑธ๋ฆฌ๋ ๋ถํ๋ฅผ ์กฐ์ ํ ์ ์๋ค. |
| 42 | + |
| 43 | +- **Thread Pool** |
| 44 | + - ๋น์ทํ ๋งฅ๋ฝ์ผ๋ก Thread pool์ด๋ผ๋ ๊ฐ๋
๋ ์๋ค. |
| 45 | + - ์ด ์ญ์ ๋งค ์์ฒญ๋ง๋ค ์์ฒญ์ ์ฒ๋ฆฌํ Thread๋ฅผ ๋ง๋๋๊ฒ์ด ์๋, ๋ฏธ๋ฆฌ ์์ฑํ pool ๋ด์ Thread๋ฅผ ์๋ฉธ์ํค์ง ์๊ณ ์ฌ์ฌ์ฉํ์ฌ ํจ์จ์ ์ผ๋ก ์์์ ํ์ฉํ๋ ๊ธฐ๋ฒ. |
| 46 | + |
| 47 | +- **Thread Pool๊ณผ Connection pool** |
| 48 | + - WAS์์ Thread pool๊ณผ Connection pool๋ด์ Thread์ Connection์ ์๋ ์ง์ ์ ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ์ ๊ด๋ จ์ด ์๊ธฐ ๋๋ฌธ์, ๋ง์ด ์ฌ์ฉํ๋ฉด ํ ์๋ก ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ง์ด ์ ์ ํ๊ฒ ๋๋ค. ๊ทธ๋ ๋ค๊ณ ๋ฐ๋๋ก ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ํด ์ ๊ฒ ์ง์ ํ๋ค๋ฉด, ์๋ฒ์์๋ ๋ง์ ์์ฒญ์ ์ฒ๋ฆฌํ์ง ๋ชปํ๊ณ ๋๊ธฐ ํ ์ ๋ฐ์ ์๋ค. |
| 49 | + - ๋ณดํต WAS์ Thread์ ์๊ฐ Conncetion์ ์๋ณด๋ค ๋ง์ ๊ฒ์ด ์ข์๋ฐ, ๊ทธ ์ด์ ๋ ๋ชจ๋ ์์ฒญ์ด DB์ ์ ๊ทผํ๋ ์์
์ด ์๋๊ธฐ ๋๋ฌธ์ด๋ค. |
| 50 | + |
23 | 51 | > :arrow_double_up:[Top](#4-database) :leftwards_arrow_with_hook:[Back](https://github.com/Do-Hee/tech-interview#4-database) :information_source:[Home](https://github.com/Do-Hee/tech-interview#tech-interview)
|
24 |
| -> - []() |
| 52 | +> - https://delf-lee.github.io/post/connection-pool/ |
25 | 53 |
|
26 | 54 | ### ์ ๊ทํ 1์ฐจ 2์ฐจ 3์ฐจ BCNF
|
27 | 55 | > :arrow_double_up:[Top](#4-database) :leftwards_arrow_with_hook:[Back](https://github.com/Do-Hee/tech-interview#4-database) :information_source:[Home](https://github.com/Do-Hee/tech-interview#tech-interview)
|
|
0 commit comments