1

Perhaps related to the unanswered question I asked here yesterday is the question about whether it is advisable to use short field names in a schema in Mongoose? According to the article here, longer field names do result in a larger database in the server's hard disk, as well as the any cache used in the memory.

Is that true? Why didn't the designers of Mongoose use some kind of mapping mechanism for the field names to save space in the database?

Community
  • 1
  • 1
Chong Lip Phang
  • 8,755
  • 5
  • 65
  • 100
  • Very much related to your unanswered question you are still confusing your data access framework ("mongoose") with the data storage ("mongodb"). Or are you suggesting it would be a wise idea to have a programming framwork that took "myReallyLongAndDescriptiveNameAboutSomething" and only went away and stored that actually as "xs522hjsds"? You also might consider that an unanwered question is likely because it is unclear what you are actually asking, or that there is nothing really concise to answer and it is in fact no more than a discussion point. – Blakes Seven Sep 11 '15 at 07:21
  • 1
    Thanks. That removed my doubts. – Chong Lip Phang Sep 11 '15 at 07:55

1 Answers1

1

Yes, property names do increase the size of the documents, like the article mentioned. If I were you, I honestly wouldn't worry about it. Mongo is a pretty liberal database as far as resources is concerned, it's not known for conserving disk space or RAM. If you have severely limited resources, MongoDB is probably not the database you'd want. Most people don't care about space that much as it becomes an issue only on a very very large scale, where other hadoop based databases become much better alternatives to Mongo. As far as why the devs didn't implement some sort of mapping? Who knows? Probably performance considerations, and the fact that like I mentioned, it wasn't designed for deployments where saving a few bytes per document would be a deal breaker.

Yuri Zarubin
  • 11,439
  • 4
  • 30
  • 33