Quantcast
Channel: Meteor Blog - Medium
Viewing all articles
Browse latest Browse all 160

Inserting 50000 documents into a collection — slow, fast and fastest

$
0
0
Here’s a short story: A production user shows us two benchmarks that insert 50000 documents into a collection. They seem to do the same thing but perform differently. And it seems scary -- the version with Meteor’s synchronous APIs (you know, like what ever other language other than JavaScript has?) is slower.

 

Has Meteor’s decision to expose synchronous APIs using fibers put apps in a performance trap? And what is the fastest way to insert 50000 documents into a collection in Meteor?
(tl;dr: fibers aren’t the problem; and you should use Mongo's bulk insert operation)


Viewing all articles
Browse latest Browse all 160

Trending Articles