开发者

Is it important to use InnoDB and transactions for an auction

开发者 https://www.devze.com 2022-12-15 14:07 出处:网络
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开

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

精彩评论

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

关注公众号