๐ Today I Learned
- ๋ก์ปฌํธ์คํธ์ ๋ชฝ๊ณ ๋๋น ์ค์น ํ ๋ฐ์ดํฐ๊ทธ๋ฆฝ ์ฐ๊ฒฐ๊ณ ๋ฏผ๋ง ํด์ค๋ค๊ฐ ๋๋์ด NoSQL์ ์ฌ์ฉํด๋ณด๊ฒ ๋์๋ค. ์์ง์ ๋งค์ฐ ๋ฏ์ค๋ค๐ถ
-
- ์์ ๋ ์ธ์๋ค, API์ ํจ์จ์ฑ์ ๊ณ ๋ คํ์ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์์ ์์จ ์ ์๋ ํ ์ด๋ธ๋ค์ ์ญ์ ํ๊ณ , ์์๋๋ก ํ ์ด๋ธ์ ์ ๊ทผํ๊ธฐ ์ฝ๋๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ํญ ์์ ํ์๋ค.ํ..
-
- ์ด๋ฒ์ ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉด์, ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ค๊ณํ ๋ ํ์ํ ์นผ๋ผ๋ค๊ณผ ํ ์ด๋ธ๊ฐ์ ์กฐ์ธ ๋ฟ๋ง์๋๋ผ ํจ์ ๋ด์์ ๋ฐ์ดํฐ๋ค์ ์ฝ์ ํ๊ฑฐ๋ ๊บผ๋ด์ฌ ๋ ์ฐ๊ด๋ ํ ์ด๋ธ๊ฐ์ ์ ํ๊ด๊ณ๋ํ ๊ณ ๋ คํด์ฃผ๋๊ฒ ์ค์ํ๋ค๋๊ฒ์ ๊นจ๋ฌ์๋ค.
- Aniverse ๋ชฝ๊ณ ๋๋น๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ค์ ์ค๊ณ
- NoSQL๋ฒ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ์๋ฒ ๋๋ ๋ฐฉ์์ ์ฌ์ฉํ์ฌ ๋ค๋ฅธ ํ ์ด๋ธ๊ณผ์ ์ฐธ์กฐ๊ด๊ณ๋ฅผ ์ต์ํ์ํค๊ณ , 5~6๊ฐ์ ํ ์ด๋ธ๋ง์ผ๋ก ๋ฐ์ดํฐ๋ค์ ์ ์ฅํ ์ ์๋๋ก ์ค๊ณ์ค์ด๋ค. ํ ์ด๋ธ ์ค๊ณ๋ง์ผ๋ก ์ ๊ต์๋๊ป์ NoSQL์ ์ถ์ฒํ์ จ๋์ง ์ ๊ฒ ๊ฐ๊ธฐ๋ ํ๋ค..
- ๊ธฐ์กด Aniverse API ์๋ ์ธก์ MySQL๊ณผ ๋ชฝ๊ณ ๋๋น์ ์๋์ฐจ์ด๋ฅผ ๋น๊ตํ๊ธฐ์ํด console.time()์ผ๋ก ํจ์ ์ํ์๊ฐ์ ์ธก์ ํ๋ค.
exports.postAdoptUserInfo = async function (req, res) { console.time('protect/request'); const {animalIdx, userIdx, contactName, contactPhoneNum, adoptComment} = req.body; try{ var adoptListIdxRows = await adoptModel.selectAdoptListIdx(animalIdx); // console.log(adoptListIdxRows[0].adoptListIdx); var adoptListIdx = adoptListIdxRows[0].adoptListIdx; // const postAdoptListIdx = await adoptModel.insertAdoptListIdx(adoptListIdx); const postAdoptInfo = await adoptModel.insertAdoptRequestInfo( adoptListIdx, userIdx, contactName, contactPhoneNum, adoptComment ); res.json({ isSuccess: true }); console.timeEnd('protect/request'); } catch (err){ logger.error(`postAdoptUserInfo DB Connection error\n: ${err.message}`); return res.status(500).send(`Error: ${err.message}`); } };
๐ข Today's error
ํ๋ก ํธ์ ๋ง์ถฐ๋ณด๋ ๊ณผ์ ์์ ์๋ฒ์๋ฌ๊ฐ ๋ฐ์ํ์ ๋,
$ lsof -i TCP:3000
$ kill -9 PID
$ pm2 start index.js
์ด๋ ๊ฒ PID๋ฅผ ์ฐพ์์ ์ฃฝ์ฌ์ฃผ๋ฉด ์ฌ๋งํด์๋ ํด๊ฒฐํ ์ ์์๋ค.
๐ Comment
๋ฐ์ดํฐ๋ฒ ์ด์ค ์ค๊ณ๋ ํญ์ ์ฌ๋ฐ๋น
'TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[TIL/fairer] 2022-05-14 jpa๋ก์ง ๊ตฌํ (0) | 2022.05.16 |
---|---|
[TIL] 2021-11-09 (0) | 2021.11.17 |
[TIL] 2021-10-11 (7) | 2021.10.12 |