views:

189

answers:

3

Wordpress is using MyISAM storage engine. MyISAM does not support transactions.

How wordpress is maintaining transactions?

I mean if wordpress is having two database write operations, how does it ensure atomicity?

A: 

I would think the transaction would assure atomic correctness at the previous layer of abstraction. When a transaction is occurring it default locks what it is writing. I'm not sure though.

kylex
+1  A: 

Well, as far as I can tell, it doesn't! The only reason there are not much problems with this is, that most write operations are done with a single insert or update (adding a comment, creating a new post...).

In general, most web applications I have seen so far, don't bother too much with transactions, atomicity or even referential integrity, which is quite sad. On the one hand it is sad that so many applications just rely on pure luck that nothing bad happens and on the other hand it might lead to the impression that all these techniques aren't that important when it comes to database stuff.

Simon Lehmann
+1  A: 

I haven't looked at the implementation details of Wordpress, but it doesn't strike me as an application that needs transactions. If all you do is single insert and select statements with one or few users, the need for transactions is a bit academic.

Brian Rasmussen