Docs Menu
Docs Home
/
MongoDB ๋งค๋‰ด์–ผ
/ /

๋งต-๋™์‹œ์„ฑ ๊ฐ์†Œ

์ฐธ๊ณ 

๋งต ๋ฆฌ๋“€์Šค์˜ ๋Œ€์•ˆ์œผ๋กœ์„œ์˜ ์ง‘๊ณ„ ํŒŒ์ดํ”„๋ผ์ธ

MongoDB 5.0 ๋ถ€ํ„ฐ ๋งต ๋ฆฌ๋“€์Šค ๋Š” ๋” ์ด์ƒ ์‚ฌ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋งต ๋ฆฌ๋“€์Šค ๋Œ€์•ˆ์œผ๋กœ์„œ์˜ ์ง‘๊ณ„ ํŒŒ์ดํ”„๋ผ์ธ ์˜ˆ์‹œ๋Š” ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋งต ๋ฆฌ๋“€์Šค ์ž‘์—…์€ ์ž…๋ ฅ collection์—์„œ ์ฝ๊ธฐ, map ํ•จ์ˆ˜ ์‹คํ–‰, reduce ํ•จ์ˆ˜ ์‹คํ–‰, ์ฒ˜๋ฆฌ ์ค‘ ์ž„์‹œ collection์— ์“ฐ๊ธฐ, ์ถœ๋ ฅ collection์— ์“ฐ๊ธฐ ๋“ฑ ๋งŽ์€ ์ž‘์—…์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

์ž‘์—… ์ค‘์— map-reduce๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ž ๊ธˆ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

  • ์ฝ๊ธฐ ๋‹จ๊ณ„์—์„œ๋Š” ์ฝ๊ธฐ ์ž ๊ธˆ(read lock)์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. 100๊ฐœ์˜ ๋ฌธ์„œ๋งˆ๋‹ค ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  • ์ž„์‹œ ์ปฌ๋ ‰์…˜์— ๋Œ€ํ•œ ์‚ฝ์ž…์€ ๋‹จ์ผ ์“ฐ๊ธฐ์— ๋Œ€ํ•ด ์“ฐ๊ธฐ ์ž ๊ธˆ(write lock)์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

  • ์ถœ๋ ฅ collection์ด ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ, ์ถœ๋ ฅ collection์„ ๋งŒ๋“ค ๋•Œ๋Š” ์“ฐ๊ธฐ ์ž ๊ธˆ (write lock)์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

  • ์ถœ๋ ฅ ์ปฌ๋ ‰์…˜์ด ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ ์ถœ๋ ฅ ์ž‘์—…(์˜ˆ: merge, replace, reduce)๋Š” ์“ฐ๊ธฐ ์ž ๊ธˆ(write lock)์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด ์“ฐ๊ธฐ ์ž ๊ธˆ (write lock)์€ ๊ธ€๋กœ๋ฒŒ ์ด๋ฉฐ mongod ์ธ์Šคํ„ด์Šค์— ๋Œ€ํ•œ ๋ชจ๋“  ์ž‘์—…์„ ์ฐจ๋‹จํ•ฉ๋‹ˆ๋‹ค.

๋Œ์•„๊ฐ€๊ธฐ

์ƒค๋“œ ์ปฌ๋ ‰์…˜