Lack of transaction is a tradeoff that allows MongoDB to be scalable.
The purpose of the transaction is to ensure that the entire database remains consistent when several operations are performed. But unlike most relational databases, MongoDB is not designed to run on a single host. It is intended for installation in the form of a cluster of several fragments, where each fragment represents a set of replicas of several servers (possibly in different geographical locations).
A transaction can potentially affect multiple database hosts. This means that the transaction must be synchronized between all these hosts. This will mean quite a bit of overhead and will deteriorate very much with an increase in the size of the database by adding more servers.
The MongoDB FAQ explains this as follows:
MongoDB does not support traditional locking or complex rollback transactions. MongoDB aims to be lightweight, fast and predictable in its performance. This is similar to the MySQL MyISAM automixing model. Because transaction support is extremely simple, MongoDB can provide great performance, especially for partitioned or replicated systems with multiple database server processes.
source share