Storage Engine คืออะไร?
โมดูลซอฟต์แวร์ที่ DBMS ใช้สร้าง อ่าน อัปเดต ข้อมูลจากฐานข้อมูล
Default Engine ปัจจุบัน: InnoDB
ดู Engine ทั้งหมด
mysql> SHOW ENGINES;
ผลลัพธ์ (สรุป)
| Engine | Support | Comment | Transactions | XA | Savepoints |
|---|---|---|---|---|---|
| InnoDB | DEFAULT | รองรับ Transactions, Row-locking, FK | YES | YES | YES |
| MyISAM | YES | Full-text search, ไม่มี Transactions | NO | NO | NO |
| MEMORY | YES | Hash-based, ใน RAM, เร็วแต่หายเมื่อ Restart | NO | NO | NO |
| CSV | YES | เก็บเป็นไฟล์ CSV | NO | NO | NO |
| ARCHIVE | YES | Compressed, Insert-only, ไม่มี Index | NO | NO | NO |
| BLACKHOLE | YES | /dev/null เขียนได้ อ่านไม่ได้ (Replication) | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Monitoring ระบบ | NO | NO | NO |
| FEDERATED | NO | Remote tables | NULL | NULL | NULL |
| MRG_MYISAM | YES | รวม MyISAM tables | NO | NO | NO |
เลือก Engine ไหน?
- InnoDB: เริ่มต้น ใช้ทั่วไป ACID, FK, Row-locking
- MyISAM: Read-heavy, Full-text (เก่า), ไม่ต้องการ Transaction
- MEMORY: Temp tables, Cache, Lookup tables (ข้อมูลเล็ก)
- ARCHIVE: Logs, Audit trail (Write-once, Compressed)
- CSV: Exchange data with external tools