Is shortening MongoDB property names worthwhile?

To quote Donald Knuth:

Premature optimization is the root of all evil (or at least most of
it) in programming.

Build your application however seems most sensible, maintainable and logical. Then, if you have performance or storage issues, deal with those that have the greatest impact until either performance is satisfactory or the law of diminishing returns means there’s no point in optimising further.

If you are uncertain of the impact of particular design decisions (like long property names), create a prototype to test various hypotheses (like “will shorter property names save much space”). Don’t expect the outcome of testing to be conclusive, however it may teach you things you didn’t expect to learn.

Leave a Comment