O'Reilly logo

Mastering JavaScript Single Page Application Development by John Moore, Philip Klauzinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MongoDB database performance

Topics such as replication and sharding are beyond the scope of this book. However, there are a number of things developers can do to optimize the performance of your MongoDB database.

Mainly, we'll talk about cover indexing and tuning queries for performance.

Indexing

In many database systems, adding an index in a field when appropriate can speed up querying. Queries are optimized when performed on indexed fields. MongoDB is no different.

The downside to indexes is that they add some extra time to write operations. They also take up extra space in the database. It makes sense to index wisely. When considering adding indexes, you want to think about whether you expect more read than write operations. This would be a plus ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required