Is there an optimum length for short strings in mongodb with performance in mind?
I’m currently implementing a comment system limiting the comment length somewhere around 150 – 300 chars and was wondering if there is a string length in that general range that would be more performant than others.
The thing about MongoDB is that performance is generally hardware dependent – the only way you can really find out is to test this on the hardware you’ll be using in production, with test data as close to real data as possible.
I’ve conducted quite a few tests on MongoDB, both on my laptop and on a Xeon server. I noticed horrible results for the laptop, e.g. a bulk insert of 10,000 records would take 90 seconds. But the same test on the server took 0.2 seconds, which I wasn’t expecting. Of course the server was going to be faster, but my point is that you can’t really make any assumptions on speed, based on other’s results.