mongoDB – Foreground Index Vs Background Index

Foreground Index Vs Background Index

By default an index in MongoDB is Foreground index and while an index is a foreground index it will block all other writers (i-e no other process can write to collection), We can build it in background so that it will not block other writers.

Foreground Indexes are

1. Fast

2. Block other writers.

Background Indexes, If we set background:true then it will

1.  Slow

2. Will not block concurrent writes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.