InnoDB vs MyISAM

InnoDB

  • general-purpose storage engine that balances high reliability and high performance (์„ฑ๋Šฅ๊ณผ ์‹ ๋ขฐ๋„๋ฅผ ๋ชจ๋‘ ์žก์€ ์—”์ง„์ด๋‹ค!)

  • MySQL 5.7 ๋ถ€ํ„ฐ๋Š” ๊ธฐ๋ณธ์—”์ง„์ด๊ณ , ์ง์ ‘์ ์œผ๋กœ ์–ด๋–ค ์—”์ง„์„ ์“ธ์ง€ ๋ช…์‹œํ•˜์ง€ ์•Š๋Š” ํ•œ, CREATE TABLE ์ด๋ผ๋Š” ๋ช…๋ น์–ด ์‚ฌ์šฉํ•˜๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ InnoDB table๋กœ ์ƒ์„ฑ๋จ.

Key Advantages of InnoDB

  • DML(Data manipulation language) ๊ธฐ๋Šฅ์€ ACID๋ฅผ ๋ณด์žฅ.

    • transaction, commit, rollback, crash-recovery ๊ธฐ๋Šฅ์„ ์ œ๊ณต.

  • Row level locking, consistent reads increase multi-user concurrency (์—ฌ๋Ÿฌ ์œ ์ €๊ฐ€ ๋™์‹œ์— ์ฝ์–ด๋„, ์ผ๊ด€์„ฑ ์žˆ๋Š” ์ฝ๊ธฐ๋ฅผ ๋ณด์žฅํ•จ.)

  • PK(primary key) ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋””์Šคํฌ์— ์ €์žฅ๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ตœ์ ํ™”ํ•จ.

    • ๊ฐ๊ฐ์˜ InnoDB๋กœ ๊ตฌ์„ฑ๋œ ํ…Œ์ด๋ธ”์—๋Š” pk๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”๋ฐ ์ด๋Š” clustered index๋ผ ๋ถˆ๋ฆผ.

    • ์ด๋Ÿฌํ•œ ์ธ๋ฑ์Šค๋ฅผ ํ†ตํ•ด, I/O๋ฅผ ์ตœ์ ํ™”ํ•จ.

  • ๋ฐ์ดํ„ฐ์˜ ๋ฌด๊ฒฐ์„ฑ์„ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด Foreign key(FK) ์ œ์•ฝ ์กฐ๊ฑด์„ ์ œ๊ณต.

    • FK๋ฅผ ํ†ตํ•ด ํ…Œ์ด๋ธ”๊ฐ„ ๋ฐ์ดํ„ฐ ๋ถˆ์ผ์น˜๋ฅผ ๋ฐฉ์ง€ํ•จ.

MyISAM

  • only a table-level lock (table level์˜ ๋ฝ๋งŒ์„ ์ง€์›ํ•จ.)

    • ๋งŽ์€ ๋ณ€ํ™”๊ฐ€ ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—๋Š” ๋ถ€์ ์ ˆ.

    • ์™œ? ๋ณ€ํ™”๊ฐ€ ํ•„์š”ํ•  ๋•Œ ๋งˆ๋‹ค table lock์ด ๊ฑธ๋ฆดํ…Œ๋‹ˆ.

    • The table locking method is helpful for read-only databases as it doesnโ€™t require a lot of memory.

  • ํŠธ๋žœ์žญ์…˜, ์™ธ๋ž˜ํ‚ค, ํ…Œ์ด๋ธ”๊ฐ„ ๊ด€๊ณ„ ์ง€์›ํ•˜์ง€ ์•Š์Œ.

  • FULL TEXT Search ๋ฅผ ์ง€์›.

  • SELECT๊ฐ€ ๋งŽ์€ ์„œ๋น„์Šค์— ๊ถŒ์žฅ๋จ.

๊ณตํ†ต์ 

  • storage engine ์ž„.

    • storage engine ?

    • the component of the database that is responsible for managing how data is stored, both in memory and on disk

    • ์ฆ‰ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ฉ”๋ชจ๋ฆฌ์™€ ๋””์Šคํฌ์— ์–ด๋–ป๊ฒŒ ์ €์žฅ๋˜๋Š” ์ง€ ์ฑ…์ž„์„ ๋งก๊ณ  ์žˆ๋Š” ์š”์†Œ.

    • InnoDB๋ผ๋Š” ํ˜•์‹์˜ ๋ฐ์ดํ„ฐ ์ €์žฅ ๋ฐฉ์‹์ด ์žˆ๋Š” ๊ฑฐ๋กœ, MyISAM์ด๋ผ๋Š” ๋ฐ์ดํ„ฐ ์ €์žฅ ๋ฐฉ์‹์ด ์žˆ๋Š” ๊ฒƒ.

์ฐธ๊ณ 

Last updated