开发者

Is it important to use InnoDB and transactions for an auction

I wanted to know how important it is to use InnoDB table and transactions for an auction website.

I know that when there is payment involved the transactions are important, but in this case, there开发者_高级运维 are only bids placed.

The bids that are placed however are placed very quickly, maybe a few every second.

I was wondering if i couldn't just use the normal MyIsam tables for this problem.

There will be a huge amount of reads and writes every second.


MyISAM has serious performance issues with concurrent updates to a single table. So based on that alone, I'd say go with InnoDB.

Transactions are important when you need to ensure an all or nothing behavior for multiple updates to the database. It's quite possible that you can get away without transactions by using the compare and swap technique: read the current highest bidder, if current bid is higher atomically update the record only when the highest bidder hasn't changed, if not updated start at the beginning. But be careful, concurrency is really hard even with transactions, ensuring consistency without them is an order of magnitude more difficult. I'd even go as far as to say that if you have to ask, you're not going to get it correct.


MyISAM will be quicker, definitely, because it's losing the ACID-compliance that is inherent in InnoDB. I'd do performance benchmarking to make the decision, but I'm more inclined towards InnoDB for this type of system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜