4 ms·
Why is it faster?
by richcollins 17y ago
Why is it faster?
- paulgb 17y agoIt doesn't force you to fit non-tabular (eg. hierarchical) data into a table structure. Also, no schema means the data structure is more malleable. With the right ORM, this fits in well nicely with polymorphism: I can store objects with some common features in the same collection, but when I retrieve them from the database I get different types of objects which inherit the same base object. mongoengine is one ORM that does this.
- heresy 17y agoNice. But I have a difficult time seeing how storing "malleable" data like that, opaque to the storage engine, is going to be performant for querying. Must be nice to have requirements that never change once you've decided on a data representation...
- paulgb 17y agoThe database is still aware of the fields, so MongoDB can build indices on certain fields if you wish. Admittedly I haven't deployed Mongo in an environment that really tested its performance, but we've been serving about 20k pageviews per day with no issues. Granted, this was a fairly basic application. As for changing requirements, mongo handled those well too. It's certainly not a silver bullet, but when I just need a basic object store the query performance trade-off is worth it.
- richcollins 17y agoDoes MongoDB manage indexes for you?
- japherwocky 17y agoyou don't even have to think about schemas or SQL, you can focus completely in whatever your language of choice is.