Sould I avoid transaction?

In the official mongodb youtube channel I saw- they recommended not to use transaction unless it is acutely required.
Is transaction costly in mongodb ?

Hi @Md_Mahadi_Hossain

There is certainly an additional overhead with transactions but it isn’t too computational costly. However, the best practice is not to use a transaction unless you must as using transactions without proper design is definitely a sign of poor planning and will likely lead to poor performance as you may equally be able to achieve the vast majority of what is needed using simple single document atomic updates.

I’d recommend visiting Transactions | MongoDB and reviewing the videos there on tansactions to get a better understand of how and of when to use transactions.

Kindest regards,
Eoin

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.