Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to design a forum script with MySql. Which database engine would have better performance? MyISAM or InnoDB ?

share|improve this question

closed as off-topic by Mark Storey-Smith, Max Vernon, Phil, StanleyJohns, Mat Aug 31 '13 at 5:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Shopping list question - questions about which tool, library, product or resource you should use are off-topic here because they quickly become obsolete and often are just about the preferences of the answerer. If you have an issue with or a question about a specific tool, please revise your question to conform to that scope." – Mark Storey-Smith, Max Vernon, Phil, StanleyJohns
If this question can be reworded to fit the rules in the help center, please edit the question.

Asking questions about what engine performs better when you have provided almost no detail will likely result in your question being closed as "shopping list". Add details about your scenario, please! – Max Vernon Aug 30 '13 at 23:31
Nor MyISAM or InnoDB belongs to me. I want know the experiences of experts. I think all of programmers interesting on database performances. The forum script is an explanatory for specific programmings. – Huseyin Aug 31 '13 at 11:12
up vote 6 down vote accepted

Always use InnoDB by default.

  • InnoDB is durable and crash-safe. Your database will not be corrupted in a crash. MyISAM is very susceptible to data corruption. This should be a more important consideration than performance -- unless you don't really care if you lose your data.

  • InnoDB caches both data and indexes in RAM. MyISAM caches only indexes in RAM. So if you have enough RAM, queries will almost certainly be faster in InnoDB.

  • InnoDB is the default. It has been MySQL's default storage engine since MySQL 5.5 (circa 2010).

  • InnoDB continues to improve. MyISAM is not being improved. All of the storage engine engineering work is going into InnoDB.

  • InnoDB is faster anyway. Here's a performance comparison from way back in 2007 that shows InnoDB beats MyISAM in most tests:

    Of course, benchmarks results show the performance of the benchmark, not the performance of your application. If you want a more authoritative answer, you should run sysbench to test your database on your hardware.

There are cases where MyISAM is faster, but these cases are becoming more and more rare. For instance, doing table-scans. Or SELECT COUNT(*) FROM Table. But you should treat InnoDB as the default storage engine choice until you can demonstrate a case where MyISAM beats it.

share|improve this answer
+ Foreign Keys. – ypercubeᵀᴹ Aug 30 '13 at 23:35
@ypercube, of course, but that's not as relevant to the OP's question about performance. Foreign keys can even be a disadvantage for scalability because of extra S-locks. – Bill Karwin Aug 30 '13 at 23:50
Yes, it's not exactly relevant to the question. Can you pop on the Heap if you have a minute to spare? – ypercubeᵀᴹ Aug 31 '13 at 0:01
+1 on the full InnoDB pitch since MyISAM can't cache a lick of data anywhere (as shown by your second point) – RolandoMySQLDBA Aug 31 '13 at 0:02
Thanks @BillKarwin . Your answer is complete and explanatory. – Huseyin Aug 31 '13 at 11:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.