Which MySQL database engine is better for storing sessions and session data: MyISAM or InnoDB?
Asked Answered
T

1

9

Pretty straightforward question.

I use InnoDB for everything else, for a couple of reasons. Is it a performance hit over MyISAM for a 'high-traffic' table?

Transceiver answered 29/7, 2010 at 4:1 Comment(7)
@Charles, MEMORY is a great choice, because it will be waay faster than anything else. Only issue is that session data won't persist between MySQL restarts.Money
@Greg: MEMORY = MEMORY :-)Snakemouth
@Chris, while that is true, MySQL restarts shouldn't occur in production.Vinyl
You also need to define 'high-traffic'. I've seen a website with over 6000 active sessions in a MyISAM table and not break a sweat.Kenton
@Charles, Mike -- thank you! I hadn't even considered that. @staticsan: Afraid I can't put a number on it at this time.Transceiver
@Vinyl Restarts occur pretty much everywhere. How do you deal with configuration changes, and those wonderful times when someone trips over the cord?Money
@Chris, a fair point. However, at that point the entire site is likely to go down, so losing only session data is likely to be the least of our cares.Vinyl
H
10

Since you're looking at a pretty even mix of read/write traffic, InnoDB is the better choice. MyISAM's full-table locks on every write would probably be murder. MyISAM fairs better with 90%+ read or 90%+ write situations.

I believe that's mentioned in High Performance MySQL

Halfandhalf answered 29/7, 2010 at 4:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.