32 ms·
The example in the book is very simple - it can be implemented in SQL database with 2 tables (products and carts). When you have more entities and relations it
by codedokode 9y ago
The example in the book is very simple - it can be implemented in SQL database with 2 tables (products and carts). When you have more entities and relations it would become too complex to keep all of them consistent in a denormalized scheme in MongoDB. You will have to write cron jobs that would cleanup broken references and still get errors.
So I wanted to say that denormalization and lack of foreign keys in MongoDB is much worse that lack of transactions.