delete
MySQL Performance Boost by Selecting the Right Table Engine
Today I am going to explain you how the MySQL table engine affects the database performance. While designing MySQL-based applications, you should decide which storage engine to use for storing your data. If you don’t think about this during the initial phase, you will possible face difficulties later in the process of development of your application. MySQL default engine is MyISAM; this engine doesn’t provide a feature you need, such as transactions, or maybe the mix of read and write queries. May be your application will require more granular locking than MyISAM’s table locks. Because you can select storage engines on a table-by-table basis, you’ll need a clear impression of how each table will be used and the data it will store. It also helps to have a good indulgent of the application as a whole and its potential for growth in future.
Although many factors can affect your decision about which storage engine(s) to use, it usually boils down to a few primary considerations.
Keep in mind the following points while selecting your storage engine:
Transactions
If your application requires transactions, InnoDB is the most stable, well incorporated, proven choice at this time. However, we expect to see the up-and-coming transactional engines become strong contenders as time passes.
MyISAM is a good choice if a task doesn’t require transactions and issues mainly either SELECT or INSERT queries. Sometimes specific modules of an application (such as logging) fall into this category.
Concurrency
How best to satisfy your concurrency requirement depends on your job. If you just need to insert and read concurrently, believe it or not, MyISAM is a fine choice! If you need to allow a mixture of operations to run concurrently without interfering with each other, one of the engines with row-level locking should work well.
Backups
The need to perform regular backups may also influence your table choices. If your server can be shut down at regular intervals for backups, the storage engines are equally easy to deal with. However, if you need to perform online backups in one form or another, the choices become less clear. Also bear in mind that using multiple storage engines increases the complexity of backups and server tuning.
Crash recovery
If you have a lot of data, you should seriously consider how long it will take to recover from a crash. For example MyISAM tables generally become corrupt more easily and take much longer to recover than InnoDB tables. In fact, this is one of the most important reasons why a lot of people use InnoDB when they don’t need transactions.
Special features
Finally, you sometimes find that an application relies on particular features or optimizations that only some of MySQL’s storage engines provide. For example, a lot of applications rely on clustered index optimizations. At the moment, that limits you to InnoDB and solidDB. On the other hand, only MyISAM supports full-text search inside MySQL. If a storage engine meets one or more critical requirements, but not others, you need to either compromise or find a clever design solution. You can often get what you need from a storage engine that seemingly doesn’t support your requirements.