MyISAM or InnoDB
What’s the deal with MyISAM vs. InnoDB for Rails? Here’s what I know and think I know so far:
Reasons to use MyISAM:
- Faster according to anecdotal evidence. But is that really true, and how much does it matter given other factors?
- Easy backups are easy with mysqlhotcopy
- Full-text indexing
Reasons to use InnoDB:
- Transactions
- Foregin keys
- Row-level locking
- Rails defaults to InnoDB when creating new tables
- You can delete your Rails sessions in one go without locking the whole damn sessions table
I’m leaning towards using InnoDB, because:
- It’s the default for Rails so I don’t have to work around it
- It has more granular locking, which is good if you plan on getting lots of traffic
- It has transactions, which is always healthy
- You can do backups using mysqldump, which is OK
- You can do your searches with Ferret, which is much better than the MySQL full text index, anyway
- You can delete your Rails sessions in one go without locking the whole damn sessions table
Is there an official recommendation? What do some of the big-site folks out there do?
About Calvin Correli
I've spent the last 17 years learning, growing, healing, and discovering who I truly am, so that I'm now living every day aligned with my life's purpose.
6 comments
Leave a comment