Web Server
- ์น ์๋ฒ(Web server)๋ HTTP ๋๋ HTTPS๋ฅผ ํตํด ์น ๋ธ๋ผ์ฐ์ ์์ ์์ฒญํ๋ HTML ๋ฌธ์๋ ์ค๋ธ์ ํธ(์ด๋ฏธ์ง ํ์ผ ๋ฑ)์ ์ ์กํด์ฃผ๋ ์๋น์ค ํ๋ก๊ทธ๋จ์ ๋งํ๋ค.
- 1์ฃผ์ฐจ ํ์ต์์ ์ ๋ฆฌํ ๊ทธ๋ฆผ ํํ์ผ๋ก๋ B.L(Backend Language) ๊ตฌ๊ฐ์ด๋ค
- ์ข ๋ฅ๋ก๋ Spring, Spring-boot, node.js, php ๋ฑ์ด ์๋ค.
- ๋ผ์ด์ง ์บ ํ์์ 4์ฃผ์ฐจ์ node.js ๋ SpringBoot ์ค์ ์ ํํ๊ฒ ๋๋ค
- ํ์๋ ๊ตญ๋ด์์ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๋ค๊ณ ์๋ ค์ง JAVA ๊ธฐ๋ฐ SpringBoot ๋ฅผ ์ ํํ๊ธฐ ๋๋ฌธ์ ํด๋น ํฌํ๋ฆฟ ์ค๋ช ๊ธ์ด ๋ ๊ฒ์ด๋ค.
SpringBoot Tamplate
- ํด๋น ๊ธ PRACTICE์ Github Springboot ํ ํ๋ฆฟ README ํ์ผ์ ์ ๋ ํ๋ฉด์ ์ดํด๋๋ฅผ ๋์ด๊ธฐ๋ฅผ ์ถ์ฒ
- [ํฌํ๋ฆฟ ๊ตฌ์ฑ]
Route -> Controller - > Provider -> Dao
ใด> Service โคด๏ธ
- [์ญํ ]
Route : (Restful) URI ์บ์น, ์ฆ ํด๋ผ์ด์ธํธ์์ ์์ฒญํ๋ request ์บ์น ex) GET /users/:userId
Controller : URI์ ์๋ Query String ๋๋ Path Variable ๋๋ Body ๊ฐ์ ์ฒ๋ฆฌํ์ฌ ๋ฐ๋๋ค.(ํ์์ Validation ์ฒ๋ฆฌ)
Provider, Service: DB connection , Transaction ์ฒ๋ฆฌ (์๋ฏธ์ Validation ์ฒ๋ฆฌ)
Dao : ์ค์ง์ ์ธ Query & ์คํ
- ๊ฐ ๊ตฌ์ฑ์ java ํ์ผ(ํด๋์ค)๋ก ๊ตฌ์ฑ๋์ด ์ํธ์์ฉํ๋ค.
- Spring-boot๋ Route๊ฐ Controller์ ํจ๊ป ๊ตฌ์ฑ๋์ด ์๋ค.
- ๊ฐ ๊ตฌ์ฑ ์ฌ์ด ์ฃผ๊ณ ๋ฐ๋ ๋ฐ์ดํฐ ํ์์ DTO๋ผ๊ณ ํ๋ค.
- Dao์์ ๋ฐ์ํ row(Response, ์๋ต)๋ฅผ ์๋ ๊ธธ๋ก ๋ค์ ์ ๋ฌํด์ค๋ค.
- ํด๋น ๊ตฌ์กฐ๋ ๋๋ฉ์ธ ๋ณ๋ก ๊ตฌ๋ถํ์ฌ ์์ฑํ์ฌ์ผ ํ๋ค.
๋ฐฐ๋ฌ์ ๋ฏผ์กฑ ์์) ์ ์ ์ ๋ณด ๋๋ฉ์ธ๊ณผ ์๋น ์ ๋ณด ๋๋ฉ์ธ ๋ถ๋ฆฌํ์ฌ ์์ฑ ์ฆ, /users ์ /restaurant ๊ฐ ๊ตฌ์กฐ๋ฅผ ์์ฑ, ๊ตฌ๋ถํ์ฌ ์์ฑ
Provider vs Service
- Select => Provider
- Insert, Delete, Update => Service
Validation
- ํ์์ Validation : ์์ฒญ ์ฒ๋ฆฌ๋ฅผ ์ํ ํ์์ ์์ ์ ๋ฌด๋ฅผ ํ์ธ ex) ํ์๊ฐ์ ์ ์ํ ์์ฒญ์ email ์ด ์์
ใด ์๋ฏธ์ Validation : ์ ๊ตํ ์ฒ๋ฆฌ๋ฅผ ์ํ ์์ ํ์ธ ex) ์ด๋ฉ์ผ/ ๋น๋ฐ๋ฒํธ ์ ๊ทํํ์ ํ์ธ
Transaction
- DB ์ํ๋ฅผ ๋ณ๊ฒฝํ๋ ํ๋์ ์ํ ๋จ์
- CRUD(Create, Read, Update, Delete) ์ค ํ๋์ ์ํ ์ค ์ค๋ณต ์ํ ๋๋ ์จ์ ํ ์ํ์ ๋ชป ํ์ ๋ ์ง๊ธ๊น์ง ํ ์ํ์ ๋ชจ๋ ์ทจ์
- ๊ฒฐ๊ณผ๋ Rollback(์ํ ๋ชป ํจ) ๋๋ Commit(์ํ ์๋ฃ) ์ค ํ๋์๋ง ์ํ๋ค.
[ํน์ง]
- ์์์ฑ(Atomicity)
- ํธ๋์ญ์ ์ด DB์ ๋ชจ๋ ๋ฐ์๋๊ฑฐ๋, ํน์ ์ ํ ๋ฐ์๋์ง ์์์ผ ๋๋ค.
- ์ผ๊ด์ฑ(Consistency)
- ํธ๋์ญ์ ์ ์์ ์ฒ๋ฆฌ ๊ฒฐ๊ณผ๋ ํญ์ ์ผ๊ด์ฑ ์์ด์ผ ํ๋ค.
- ๋ ๋ฆฝ์ฑ(Isolation)
- ๋ ์ด์์ ํธ๋์ญ์ ์ด ๋์์ ๋ณํ ์คํ๋๊ณ ์์ ๋, ์ด๋ค ํธ๋์ญ์ ๋ ๋ค๋ฅธ ํธ๋์ญ์ ์ฐ์ฐ์ ๋ผ์ด๋ค ์ ์๋ค.
- ์ง์์ฑ(Durability)
- ํธ๋์ญ์ ์ด ์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋์์ผ๋ฉด, ๊ฒฐ๊ณผ๋ ์๊ตฌ์ ์ผ๋ก ๋ฐ์๋์ด์ผ ํ๋ค.
PRACTICE
[๊ธฐ๋ณธ ํ ํ๋ฆฟ]
https://github.com/kseenyoung/RC-SprintBoot-tamplate
GitHub - kseenyoung/RC-SprintBoot-tamplate: ๋ผ์ด์ง์บ ํ ์ ๊ณต ์คํ๋ง๋ถํธ ํ ํ๋ฆฟ
๋ผ์ด์ง์บ ํ ์ ๊ณต ์คํ๋ง๋ถํธ ํ ํ๋ฆฟ. Contribute to kseenyoung/RC-SprintBoot-tamplate development by creating an account on GitHub.
github.com
[Netflix ์น ์๋น์ค ํด๋ก ์ฝ๋ฉ]
- Github
https://github.com/kseenyoung/springboot-tamp
GitHub - kseenyoung/springboot-tamp: ๋ผ์ด์ง์บ ํ ์ ๊ณต ํ ํ๋ฆฟ์ ์ด์ฉํ Netflix ํด๋ก ์ฝ๋ฉ
๋ผ์ด์ง์บ ํ ์ ๊ณต ํ ํ๋ฆฟ์ ์ด์ฉํ Netflix ํด๋ก ์ฝ๋ฉ. Contribute to kseenyoung/springboot-tamp development by creating an account on GitHub.
github.com
- Notion ์ ๋ฆฌ
https://www.notion.so/softsquared/4-REST-API-SpringBoot-8961f53889d948cbb8ad2e4d09befb8b?pvs=4
[4์ฃผ์ฐจ] REST API ๋ฆฌ์คํธ์ ํ๊ณ ๊ตฌํ- SpringBoot
A new tool for teams & individuals that blends everyday work apps into one.
www.notion.so
- API ๋ช ์ธ์
API__Templete.xlsx
์ธ์์ธ๊ณ ์ฌํญ Server,DB Spec,t2.micro,Spec,mysql 5.7.21 Ip,ERD Url,Url Id,ubuntu,Password Password,(pem),์ ์์ ๋ณด OS,ubuntu18.04,Ip WebServer,nginx1.10.3,Database Backend-Language,springboot,Port Id,ksy,(root ๋์ผ) AWS Account,Password Id,<a hr
docs.google.com
REFERENCE
[๋ฐ์ดํฐ๋ฒ ์ด์ค] Transaction, ํธ๋์ญ์ ์ด๋?
Transaction, ํธ๋์ญ์ ํธ๋์ญ์ (Transaction) ์ด๋, ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ํ๋ฅผ ๋ณ๊ฒฝ์ํค๊ธฐ ์ํด ์ํํ๋ ์์ ๋จ์์ด๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ํ๋ฅผ ๋ณ๊ฒฝ์ํจ๋ค๋ ์ด์ผ๊ธฐ๋ SELECT, UPDATE, INSERT, DELETE ์ ๊ฐ์
wonit.tistory.com
https://hudi.blog/data-transfer-object/
DTO์ ๊ฐ๋ ๊ณผ ์ฌ์ฉ๋ฒ์
DTO๋ ์ฐํ ์ฝ ๊ณผ์ ์ค ์ ๋ง ๋ง์ด ๋ค์ด๋ดค๊ณ , ๋๋ฆ ์ฌ์ฉ๋ ๋ง์ด ํ์ง๋ง ์ด์ํ๊ฒ ๋ฐ๋์งํ๊ฒ ์ฌ์ฉํ๊ณ ์๋ค๋ ํ์ ์ด ๋ค์ง ์๋ ๊ฐ๋ ์ด๋ค. DTO์ ๋ํ ๋ด์ฉ์ ํญ์ ์๋กญ๊ฒ ์์๊ฐ๋๋ฐ, ์ด๋ฌ๋ค๊ฐ DTO
hudi.blog
https://gyoogle.dev/blog/computer-science/data-base/Transaction.html
DB ํธ๋์ญ์ (Transaction) | ๐จ๐ป๐ป Tech Interview
DB ํธ๋์ญ์ (Transaction) ํธ๋ ์ญ์ ์ด๋? ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ํ๋ฅผ ๋ณํ์ํค๊ธฐ ์ํด ์ํํ๋ ์์ ๋จ์ ์ํ๋ฅผ ๋ณํ์ํจ๋ค๋ ๊ฒ → SQL ์ง์์ด๋ฅผ ํตํด DB์ ์ ๊ทผํ๋ ๊ฒ ์์ ๋จ์ → ๋ง์ SQL ๋ช ๋ น๋ฌธ๋ค
gyoogle.dev