Lesson 3 of 14

What MongoDB really stores on disk - 001

"Meeru MongoDB JSON store chestundi ankuntunnara? Pedda mistake! Production lo space enduku egiripothundo eppudaina confuse ayyara?"

Core Explanation: MongoDB disk meeda JSON store cheyyadu, BSON (Binary JSON) store chestundi. Idi jus format eh kadu, type information kuda untundi. Old versions lo "padding factors" undevi, kani WiredTiger storage engine vachaka, idi compression tho work avutundi. Kani gurthupettukondi, me document structure frequent ga change aithe, disk fragmentation confirm ga vastundi

Wrong Practice: Storing loose numbers or excessive field names repeatedly.

// Space waste design
{
  "user_first_name_string": "Pavan", // Key names repeat in BSON
  "user_age_number": 25 // Datatype in name isn't needed
}

Best Practice: Short, readable field names and proper types.

// Efficient design
{
  "fname": "Pavan", // Shorter keys save space (BSON limitations)
  "age": 25 // Native NumberInt type
}

Closing Insight: "Keys kuda disk space occupy chestayi, so field names ni short and meaningful ga pettandi."