Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Life without transactions (MyISAM)

My site runs on a VDS-server. I've just found out that my MySQL server doesn't support InnoDB engine, therefore I can't use database transactions in my application.

It makes me think, that some people might never use transactions. Is this the case? If so, how does one manage to coordinate related operations on different tables in MyISAM?

Otherwise, is there a way to install InnoDB on a MySQL server which is run on a VDS?

Thanks!

like image 432
Webmezha Avatar asked Aug 28 '12 23:08

Webmezha


People also ask

Why MyISAM gives the best performance?

MyISAM is designed with the idea that your database is queried far more than its updated and as a result it performs very fast read operations. If your read to write(insert|update) ratio is less than 15% its better to use MyISAM.

What is MyISAM in MySQL?

MyISAM stands for Indexed Sequential Access Method. It was the default storage engine for MySQL until December 2009. With the release of MySQL 5.5, MyISAM was replaced with InnoDB. MyISAM is based on an ISAM algorithm that displays information from large data sets fast.

What is MyISAM table type?

MyISAM is the default table type in MySQL Version 3.23. It's based on the ISAM code and has a lot of useful extensions. The index is stored in a file with the . MYI (MYIndex) extension, and the data is stored in a file with the . MYD (MYData) extension.


1 Answers

If you need transactions, then you need transactions and MyISAM isn't going to cut the mustard.

Some applications won't need transactions. For example; an application that never runs more than one related SQL statement at a time and has no need to rollback multiple SQL statements. Another example is an application that uses MySQL as a simple Key-Value Store. There are many use cases that don't require database level transaction support.

It's hard to answer the second part of your question without knowing more details about your VDS. Who is you hosting provider? Do you have shell access and permissions to change my.cnf? If not, then you probably won't be able to enable InnoDB. If you do, then here is a another SO answer that details how to enable InnoDB on MySQL: How to enable INNODB in mysql

like image 170
theon Avatar answered Sep 19 '22 08:09

theon