MrBlackJack
MrBlackJack

Reputation: 11

InnoDB VS Myisam Regarding Logs Data & Logs Retrieval on every minute

Well, I know already that: 1. InnoDB is faster for data insertion but slower on data retrieval. 2. MyISAM is faster for data retrieval but slower for data insertion.

My situation is a bit different, and I just cant figure out what settings are good for me, let me explain:

  1. My software inserts each user's hit's data (IP, Host, Referral data etc) to a Logs table at run-time. Previously, I used to write this data to a .csv file and then import it to the DB after predefined minutes/hours, but it was not good for me, I need real-time data.

  2. I have several auto processes that run each minute, getting data from the Logs table, hence I need this to be fast.

My question is, what type of MySQL engine should I use for the Logs table, InnoDB or MyISAM?

currently, I'm using InnoDB cause it's faster for insertion, however, should I leave it this way, or switch back to MyISAM?

Thanks

Upvotes: 0

Views: 113

Answers (1)

Bill Karwin
Bill Karwin

Reputation: 562290

  1. InnoDB is faster for data insertion but slower on data retrieval. 2. MyISAM is faster for data retrieval but slower for data insertion.

Not true. In fact, under most workloads it's just the opposite.

That prevailing wisdom you cite is based on InnoDB of about 2004.

My question is, what type of MySQL engine should I use for the Logs table, InnoDB or MyISAM?

If you care about your data not getting corrupted, use InnoDB.

Upvotes: 0

Related Questions