How to Decide to use Database Transactions

后端 未结 6 2209
小鲜肉
小鲜肉 2020-12-11 15:10

How do you guys decide that you should be wrapping the sql in a transaction?

Please throw some light on this.

Cheers !!

6条回答
  •  萌比男神i
    2020-12-11 15:43

    Anytime you want to lock up your database and potentially crash your production application, anytime you want to litter your application with hidden scalability nightmares go ahead and create a transaction. Make it big, slow, and put a loop inside.

    Seriously, none of the above answers acknowledge the trade-off and potential problems that come with heavy use of transactions. Be careful, and consider the risk/reward each time.

    Ebay doesn't use them at all. I'm sure there are many others.

    http://www.infoq.com/interviews/dan-pritchett-ebay-architecture

提交回复
热议问题