MyISAM or InnoDB

Started by vcmptr, Jun 16, 2015, 03:34 PM

Previous topic - Next topic

vcmptr

I'm creating users table on MySQL. Table contains passwords, usernames, stats and register dates.
Which one should I use?
My English is not good.

Thijn

MyISAM. InnoDB is better if you're going to use foreign keys and more relational database schema's.
I believe InnoDB gets corrupted faster as well, but I'm not totally sure :P

Stormeus

MyISAM if you read from a table more than you write. (player registrations, vehicle data, etc.)

InnoDB if you write to a table more than you read. (stats, kill logs, etc.)

InnoDB is actually more crash-safe than MyISAM because of its transaction logs and support for transactions, so if a table is corrupted during a write, it can recover from the transaction log.

I use MariaDB over MySQL so I end up using Aria for everything anyway.

.

TBH I did some benchmarks on InnoDB with huge amounts or rows. And InnoDB was slower because of the better concurrency. MyISAM has table-level locking. Which means that once you query a table other queries can't be executed on that table in parallel. InnoDB supports row-level locking. Which means that concurrent queries can be executed on the same table at the same time. But since you'll most likely query your database from your server only I'd say that level of concurrency isn't going to be of use to you.

For example. I ran a few queries in a loop on a table with a few million rows. And monitored the HDD activity. With InnoDB the speeds where around ~2 Mb/s while with MyISAM the speeds where almost as much as the HDD supported. This was just an example of how much that higher level of concurency slows things down. Probably that's useful on a very active website with lots of concurrent clients but since you have only one client (your game server) I'd say you're on the safe road.
.