In MongoDb, if I only need to update 2 fields of a document that has 10-20 columns, is it more performant to do regular update of the whole document or an atomic update($set) of the two fields?
If only updating a few fields, should I always prefer doing atomic updates?
Based on the limited information you give, it is likely that $set is going to be more efficient, rather than rewriting an entire document.
Be careful of growing the document though because if it grows beyond its original bounds it will need to be moved – certainly not the most efficient operation. More information here:
http://www.mongodb.org/display/DOCS/Padding+Factor
Generally, the best thing to do is to test and see what makes most sense for you and what is most performant with your data set and your application