Legacy MongoDB versions blocked all database writes during foreground index generation. MongoDB 4.2+ builds indexes concurrently with writes, yielding locks during phase boundaries.
However, building indexes on massive multi-terabyte collections still creates heavy CPU/disk contention. Production SREs employ rolling index builds: provisioning indexes on isolated secondary nodes sequentially before orchestrating a clean primary step-down.