software engineering/๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์„ค๊ณ„

[DB] ๋ฐ์ดํ„ฐ ๋™์‹œ์„ฑ๊ณผ ์ผ๊ด€์„ฑ

jjingle 2023. 11. 6. 15:14

* ๋ฐ์ดํ„ฐ ๋™์‹œ์„ฑ(Data Concurrency) 

  : ์—ฌ๋Ÿฌ ์‚ฌ์šฉ์ž๊ฐ€ ๋™์‹œ์— ๋ฐ์ดํ„ฐ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Œ์„ ๋ณด์žฅ

 

* ๋ฐ์ดํ„ฐ ์ผ๊ด€์„ฑ(Data Consistency)

  • ๊ฐ๊ฐ์˜ ์‚ฌ์šฉ์ž๋Š” ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•œ ์ผ๊ด€์„ฑ ์žˆ๋Š” ๋ทฐ๋ฅผ ๋ณด์žฅ
  • ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž๊ฐ€ ์ปค๋ฐ‹ํ•˜๊ธฐ ์ „์— ๋ณ€๊ฒฝ๋œ ๋ถ€๋ถ„์€ ๋ณด์—ฌ์ง€์ง€ ์•Š์•„์•ผ ํ•จ

 

* ํŠธ๋žœ์žญ์…˜์˜ ์ง๋ ฌ๊ฐ€๋Šฅ์„ฑ(Serializability)

  • ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํŠธ๋žœ์žญ์…˜์ด ๋™์‹œ์— ์ˆ˜ํ–‰๋˜๋ฉด์„œ ์ผ๊ด€์„ฑ์„ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•ด ํŠธ๋žœ์žญ์…˜ ๊ฒฉ๋ฆฌ ์ˆ˜์ค€(Transaction isloation level)์„ ์ •์˜
  • ํŠธ๋žœ์žญ์…˜์˜ ์ง๋ ฌ๊ฐ€๋Šฅ์„ฑ์€ ๊ฐ๊ฐ์˜ ์‚ฌ์šฉ์ž๊ฐ€ ๋งˆ์น˜ ๋‹จ๋…์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์ด ๋ณด์ด๋„๋ก ํ•จ
  • ํŠธ๋ž™์žญ์…˜์„ ๋‹ค๋ฅธ ํŠธ๋žœ์žญ์…˜๊ณผ ์™„๋ฒฝํžˆ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ์„ฑ๋Šฅ์— ํฐ ์˜ํ–ฅ์„ ๋ฏธ์นจ
  • DBMS๋Š” ๋ฉ€ํ‹ฐ๋ฒ„์ „ ์ผ๊ด€์„ฑ ๋ชจ๋ธ(multiversion consistency model)๊ณผ ๋‹ค์–‘ํ•œ ํƒ€์ž…์˜ ๋ฝ(Lock)์„ ์‚ฌ์šฉํ•˜์—ฌ ์ผ๊ด€์„ฑ์„ ๋ณด์žฅํ•˜๋ฉด์„œ๋„ ์„ฑ๋Šฅ์„ ๋†’์ž„

 

* ๋ฉ€ํ‹ฐ๋ฒ„์ „ ์ฝ๊ธฐ ์ผ๊ด€์„ฑ(Mutiversion Read Consistency)

  • : ํŠน์ • ์‹œ์  ์ฟผ๋ฆฌ์— ๋Œ€ํ•œ ๊ฒฐ๊ณผ๊ฐ’์€ ์ปค๋ฐ‹๋œ ๊ฐ’์ด๊ฑฐ๋‚˜ ์ผ๊ด€์„ฑ์ด ์žˆ์–ด์•ผ ํ•จ.
  • ๋ช…๋ น๋ฌธ ์ˆ˜์ค€ ์ฝ๊ธฐ ์ผ๊ด€์„ฑ : ๋ช…๋ น๋ฌธ์ด ์‹คํ–‰๋˜๋Š” ์‹œ์ ์—์„œ ๋ฐ์ดํ„ฐ ์ผ๊ด€์„ฑ์„ ๋ณด์žฅ
  • ํŠธ๋žœ์žญ์…˜ ์ˆ˜์ค€ ์ฝ๊ธฐ ์ผ๊ด€์„ฑ : ํŠธ๋žœ์žญ์…˜์ด ์‹คํ–‰๋˜๋Š” ์‹œ์ ์—์„œ ๋ฐ์ดํ„ฐ ์ผ๊ด€์„ฑ ๋ณด์žฅ / ํŒฌํ…€๋ฆฌ๋“œ ๋ฐฉ์ง€