Assemble Tech Tree

Why I pick this tech tree

Server:floppy_disk:

< MySQL or MongoDB >

MongoDB๋Š” NoSQL(Not Only Sql)์ค‘ ๊ฐ€์žฅ ๋Œ€ํ‘œ์ ์ธ ํ•œ๊ฐ€์ง€์ด๋‹ค.

๊ธฐ์กด RDB(Relational Data Base)์˜ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ์†๋„๋กœ๋Š” ๋Œ€๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฌด๋ฆฌ๊ฐ€ ์žˆ๊ธฐ์— NoSQL์˜ ์žฅ์ ์ด ๋”์šฑ ํฌ๊ฒŒ ๋ถ€๊ฐ์ด ๋˜์—ˆ๋‹ค.

MongoDB๋Š” ๊ด€๊ณ„๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š๊ณ  Key-value ํ˜•ํƒœ์˜ json์„ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ธฐ์กด RDB์—์„œ ์‚ฌ์šฉํ•˜๋Š” Join์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค.

๋˜ ๋ฉ”๋ชจ๋ฆฌ์ž์›์— ์˜์กด์ ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ณ ์„ฑ๋Šฅ์˜ ํ•˜๋“œ์›จ์–ด ์„ฑ๋Šฅ์„ ์š”๊ตฌํ•œ๋‹ค.

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

MySQL์€ open source์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ˆ„๊ตฌ๋‚˜ ๋ฌด๋ฃŒ๋กœ ์ด์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋˜ํ•œ RDB์˜ ๋Œ€ํ‘œ์ค‘ ํ•œ๊ฐ€์ง€ ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ทœ๋ชจ๊ฐ€ ์ƒ๋Œ€์ ์œผ๋กœ ์ž‘๊ฑฐ๋‚˜ ํฐ app์— ๋งค์šฐ ์ ํ•ฉํ•˜๋‹ค.

๊ทธ๋ ‡๊ธฐ์— DB๋Š” Mysql๋กœ ๊ฒฐ์ •

< REST API vs GraphQL >

๊ณผ๊ฑฐ ์Šค๋งˆํŠธํฐ์˜ ์ถœํ˜„์œผ๋กœ RESTful๋ผ๋Š” ๊ฐœ๋…์ด ์ƒˆ๋กœ ๋„์ž…๋˜์—ˆ๋‹ค. client์—์„œ uri๋กœ ์ฟผ๋ฆฌ๋ฅผ ์š”์ฒญํ•˜๋ฉด server API์—์„œ ์š”์ฒญํ•œ ์ •๋ณด๋ฅผ ์ฃผ๋Š” ํ˜•์‹์˜ ๋ฐฉ๋ฒ•๋ก ์ด๋‹ค.

๊ณผ๊ฑฐ์—๋Š” ํ•œ๋ช…์˜ ๋ฐฑ์—”๋“œ ๊ฐœ๋ฐœ์ž๊ฐ€ Server, DB๋“ฑ์„ ๋ชจ๋‘ ์กฐ์ž‘์„ ํ–ˆ์ง€๋งŒ, ํ˜„์žฌ๋Š” ํ•œ๋ช…์˜ ๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฐ๋‹นํ•˜๊ธฐ์—๋Š” ์„œ๋น„์Šค ๊ทœ๋ชจ๊ฐ€ ์ปค์กŒ๋‹ค. ๊ทธ๋ ‡๊ธฐ์— RESTful์ด๋ผ๋Š” ๋ฐฉ๋ฒ•๋ก ์ด ํ•„์š”ํ–ˆ์ง€๋งŒ, ๋‚˜๋‚ ์ด ์ƒˆ๋กœ ์ƒ๊ธฐ๋Š” ์ˆ˜ ๋งŽ์€ ๊ธฐ๊ธฐ์— ๋งž๋Š” ์ •๋ณด๋ฅผ ์ฒ˜๋ฆฌํ•˜์ž๋‹ˆ ํ˜ธํ™˜์ด ์ž˜๋˜์ง€ ์•Š์•„ ์ •๋ณด๋ฅผ ๊ณผํ•˜๊ฒŒ ๋„˜๊ฒจ ์ž์›์„ ๋‚ญ๋น„ํ•˜๊ฒŒ ๋˜๊ณ  ํ•„์š”์—†๋Š” ์ •๋ณด๋ฅผ ๋„˜๊ฒจ์ฃผ๊ฒŒ ๋ผ์„œ ์†๋„๋„ ๋Š๋ ค์ง€๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

GraphQL์€ ์ •๋ณด๋ฅผ ์›ํ•˜๋Š” ๋งŒํผ๋งŒ ์š”์ฒญํ• ์ˆ˜ ์žˆ๋‹ค๋Š” RESTful์˜ ๋‹จ์ ์„ ๋ณด์™„ํ•˜์—ฌ ๋งŒ๋“ค์–ด์ง„ Query Language์ด๋‹ค. ์ฆ‰ server์— ์ •๋ณด๋ฅผ ์š”์ฒญํ•˜๋Š” ํšŸ์ˆ˜๋ฅผ ์ค„์ด๊ธฐ ๋•Œ๋ฌธ์— ์†๋„๋ฅผ ํ–ฅ์ƒ์‹œํ‚ค๊ณ , ์ž์›์„ ๋ณด๋‹ค ํšจ์œจ์ ์ด๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋‹ค.

๊ทธ๋ ‡๊ธฐ์— Data์š”์ฒญ์€ GraphQL๋กœ ๊ฒฐ์ •

Express

Express๋Š” Node.js๋ฅผ ์œ„ํ•œ ๋น ๋ฅด๊ณ  ๊ฐ„๊ฒฐํ•œ ์„œ๋ฒ„์‚ฌ์ด๋“œ ์›นํ”„๋ ˆ์ž„์›Œํฌ์ด๋‹ค.

๊ธฐ์กด Node.js์˜ ์ฝ”๋“œ๋ฅผ ๋”์šฑ ๊ฐ„๋‹จํ•˜๊ณ  ๋น ๋ฅด๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋ฉฐ, request, response๋ฅผ ๊ฐ„๋‹จํžˆ ์„ค๊ณ„ ํ•  ์ˆ˜ ์žˆ๋‹ค.

์ตœ๊ทผ ์ „์„ธ๊ณ„ ๊ฐœ๋ฐœ์ž๋“ค๋กœ ๋ถ€ํ„ฐ ์‚ฌ๋ž‘๋ฐ›๊ณ  ์žˆ๋Š” ์ค‘์ด๋ผ ์ปค๋ฎค๋‹ˆํ‹ฐ ํ™œ๋™์ด ํ™œ๋ฐœํ•˜๊ณ , ๋งŽ์€ npmํŒจํ‚ค์ง€๋ฅผ ์ œ๊ณตํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์„œ๋ฒ„๋ฅผ ๋งŒ๋“ค๋•Œ ํ•„์š”ํ•œ ๊ธฐ๋ณธ ๊ธฐ๋Šฅ๋“ค์€ ๋ถˆ๋Ÿฌ์™€์„œ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค

์ถœ์ฒ˜

MongoDB

  • https://elky84.github.io/2018/09/26/mongodb/

  • https://blckchainetc.tistory.com/350