๐ R2DBC ๋?
Java์ DB๋ฅผ ์ฐ๊ฒฐํ๋ ๋๋ผ์ด๋ฒ ์ค ํ๋.
Spring Framework version 5
- Spring WebFlux ์ถ๊ฐ
2019.12
- Spring Data R2DBC์์, ๋ฐ์ํ ๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋๋ผ์ด๋ฒ ์ถ์!!
- ์๋ต์๊ฐ์ด ๋ ๋น ๋ฅด๊ณ , ์ฒ๋ฆฌ๋์ด ๋๋ค.
- ์์ฒญ๋น ๋ฉ๋ชจ๋ฆฌ์ CPU๋ฅผ ๋ ์ฌ์ฉํ๋ค.
- JAR ํ์ผ์ ์ฉ๋์ ์ค์ผ ์ ์๋ค.
๐ ํ ์คํ
1. CPU : 4์ฝ์ด ํ ๋น
2. ์ปค๋ฅ์ ํ : 100๊ฐ
3. HTTP ์์ฒญ
- GET
- SELECT 10 ๋ ์ฝ๋, JSON ๋ฐํ
4. ํ๋ผ์ด๋ฐ ( ์๋น์ค์ ๋ถํ ์ฃผ๊ธฐ ) : 2์ด
5. ํ ์คํ ๋ฐ๋ณต์ : 5๋ฒ ( ํ๊ท ๊ตฌํจ )
์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์์ ์คํ๋ง ์ดํด๋ด
6. ํ ์คํ ํด : wrk
GitHub - wg/wrk: Modern HTTP benchmarking tool
Modern HTTP benchmarking tool. Contribute to wg/wrk development by creating an account on GitHub.
github.com
7. ํ ์คํ ๊ธฐ์ค
- ์๋ต ์๊ฐ
์ฒ๋ฆฌ๋ ( ์์ฒญ ์ )
ํ๋ก์ธ์ค CPU ์ฌ์ฉ๋ ( /proc/PID/stat ๊ธฐ๋ฐ )
๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ ( /proc/PID/maps ๊ธฐ๋ฐ ) - ์คํ์ข ๋ฃ์ ํ๋ก์ธ์ค ์ ์ฉ ๋ฉ๋ชจ๋ฆฌ
8. ํ ์คํธ ์คํฌ๋ฆฝํธ
https://github.com/MaartenSmeets/db_perftest/blob/r2dbc/test_scripts/run_test.py
GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
Materials related to testing different ways/drivers to access databases - GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
github.com
9. ๋ฐฑ์๋ ํ๊ฒฝ ๊ตฌํ
https://github.com/MaartenSmeets/db_perftest/tree/r2dbc/test_apps
GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
Materials related to testing different ways/drivers to access databases - GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
github.com
10. ๊ฒฐ๊ณผ ๋ถ์
MVC & JDBC | WebFlux & JDBC | MVC & R2DBC | WebFlux & R2DBC | |
ํ๊ท ์๋ต์๊ฐ | ๊ฐ์ฅ ๋น ๋ฆ | |||
2๋ถ๊ฐ ์ฒ๋ฆฌ ์์ฒญ ์ | ๊ฐ์ฅ ์ ์ | ๊ฐ์ฅ ๋ง์ | ||
CPU ์ฌ์ฉ๋ | ๊ฐ์ฅ ์ ์ | ๋์ด๋์ด | ||
์์ฒญ๋น CPU ์ฌ์ฉ๋ ์์ | 2 | 1 | 3 | 4 |
๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ | ๊ฐ์ฅ ๋ง์ | ๊ฐ์ฅ ์ ์ | ||
JAR ์ฉ๋ | ๊ฐ์ฅ ๋ง์ | ๊ฐ์ฅ ์ ์ |
๐ R2DBC ๋?
Java์ DB๋ฅผ ์ฐ๊ฒฐํ๋ ๋๋ผ์ด๋ฒ ์ค ํ๋.
Spring Framework version 5
- Spring WebFlux ์ถ๊ฐ
2019.12
- Spring Data R2DBC์์, ๋ฐ์ํ ๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋๋ผ์ด๋ฒ ์ถ์!!
- ์๋ต์๊ฐ์ด ๋ ๋น ๋ฅด๊ณ , ์ฒ๋ฆฌ๋์ด ๋๋ค.
- ์์ฒญ๋น ๋ฉ๋ชจ๋ฆฌ์ CPU๋ฅผ ๋ ์ฌ์ฉํ๋ค.
- JAR ํ์ผ์ ์ฉ๋์ ์ค์ผ ์ ์๋ค.
๐ ํ ์คํ
1. CPU : 4์ฝ์ด ํ ๋น
2. ์ปค๋ฅ์ ํ : 100๊ฐ
3. HTTP ์์ฒญ
- GET
- SELECT 10 ๋ ์ฝ๋, JSON ๋ฐํ
4. ํ๋ผ์ด๋ฐ ( ์๋น์ค์ ๋ถํ ์ฃผ๊ธฐ ) : 2์ด
5. ํ ์คํ ๋ฐ๋ณต์ : 5๋ฒ ( ํ๊ท ๊ตฌํจ )
์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์์ ์คํ๋ง ์ดํด๋ด
6. ํ ์คํ ํด : wrk
GitHub - wg/wrk: Modern HTTP benchmarking tool
Modern HTTP benchmarking tool. Contribute to wg/wrk development by creating an account on GitHub.
github.com
7. ํ ์คํ ๊ธฐ์ค
- ์๋ต ์๊ฐ
์ฒ๋ฆฌ๋ ( ์์ฒญ ์ )
ํ๋ก์ธ์ค CPU ์ฌ์ฉ๋ ( /proc/PID/stat ๊ธฐ๋ฐ )
๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ ( /proc/PID/maps ๊ธฐ๋ฐ ) - ์คํ์ข ๋ฃ์ ํ๋ก์ธ์ค ์ ์ฉ ๋ฉ๋ชจ๋ฆฌ
8. ํ ์คํธ ์คํฌ๋ฆฝํธ
https://github.com/MaartenSmeets/db_perftest/blob/r2dbc/test_scripts/run_test.py
GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
Materials related to testing different ways/drivers to access databases - GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
github.com
9. ๋ฐฑ์๋ ํ๊ฒฝ ๊ตฌํ
https://github.com/MaartenSmeets/db_perftest/tree/r2dbc/test_apps
GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
Materials related to testing different ways/drivers to access databases - GitHub - MaartenSmeets/db_perftest: Materials related to testing different ways/drivers to access databases
github.com
10. ๊ฒฐ๊ณผ ๋ถ์
MVC & JDBC | WebFlux & JDBC | MVC & R2DBC | WebFlux & R2DBC | |
ํ๊ท ์๋ต์๊ฐ | ๊ฐ์ฅ ๋น ๋ฆ | |||
2๋ถ๊ฐ ์ฒ๋ฆฌ ์์ฒญ ์ | ๊ฐ์ฅ ์ ์ | ๊ฐ์ฅ ๋ง์ | ||
CPU ์ฌ์ฉ๋ | ๊ฐ์ฅ ์ ์ | ๋์ด๋์ด | ||
์์ฒญ๋น CPU ์ฌ์ฉ๋ ์์ | 2 | 1 | 3 | 4 |
๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ | ๊ฐ์ฅ ๋ง์ | ๊ฐ์ฅ ์ ์ | ||
JAR ์ฉ๋ | ๊ฐ์ฅ ๋ง์ | ๊ฐ์ฅ ์ ์ |