It is important for users of OpenX to ask the question: if I run OpenX on MySQL, is it best to use the MyISAM or the InnoDB storage engine?
In general, using the MyISAM storage engine is recommended.
However, if performance is important to you and you want to get the most out of your OpenX installation, some knowledge and thought is required. The aim of this section is to provide OpenX administrators with all the information required to make an informed decision regarding which MySQL storage engine to use.
The MyISAM storage engine has one big advantage over InnoDB - speed. The MyISAM storage engine is about as fast as it gets, which makes it ideal for simple databases where you want to read and write data very quickly. This is obviously a good thing for OpenX, because fast read speeds mean that data relating to banner delivery can be obtained quickly. Fast write speeds mean that banner delivery logging is quick as well. Both of these add up to fast banner delivery to your web site(s).
However, this speed comes at a cost. Specifically:
As a general rule, OpenX has been written to operate without needing transaction support. In areas of the code where they would normally be employed, the code itself has been written to emulate transactions as far as is possible when using the MyISAM storage engine.
However, if you are using the MyISAM storage engine for your OpenX tables and your database crashes while the maintenance script is running, this might result in a situation where the statistics and priority values are inconsistent. If this occurs, once the database is running again delivery may not work correctly until the next time maintenance runs.
N.B. if your database crashes you already have problems with your server. Perfect delivery isn't something that can be guaranteed in this situation.
The issue of table-level locking is the main downside to using the MyISAM storage engine for OpenX. Whenever OpenX needs to write to a table that table is locked, and no other writes can be made to the table at the same time. This means:
Of course, for the average OpenX installation this will never be an issue. Most OpenX installations don't deliver enough banners per second to see the effect of table-level locking, and their maintenance script only takes a few seconds to summarise their statistics. In these instances banner delivery is barely affected when maintenance runs.
This is why it is recommended that the average OpenX user use the MyISAM storage engine.
It is possible to perform appropriate performance monitoring of your server(s) and tuning of OpenX to ensure that, for example, the maintenance engine does not take too long to run. If you intend to use the MyISAM storage engine it is recommended that you read our Performance Tuning section.
See also the MySQL documentation regarding the MyISAM storage engine.
Reading and writing using the InnoDB storage engine is much slower than with MyISAM. However, there are still some good reasons to consider using InnoDB for your OpenX database tables:
If you intend to run an OpenX installation that is going to:
then it is recommended that you consider whether the InnoDB storage engine might be more suitable for your needs.
Ultimately, if you are going to be running a high volume system it is recommended that you prepare a staging environment. This will allow you to experiment with both storage engines alongside your hardware and your delivery configuration to see how well they perform for you.
See the MySQL documentation regarding the InnoDB storage engine.
The InnoDB storage engine used to be recommended for "Max Media Manager" users, as earlier versions of OpenX were only intended for very high volume installations. Now that "Max Media Manager" has been merged into the main OpenX branded code base and released to the general public for use by the OpenX community, the recommended table type has been updated to take the average user's requirements into account.
If you are a high volume user please read the section above on the InnoDB storage engine, as you might find that the default recommendation does not meet your needs.