As we are building a data feed REST service with node.js and MongoDB/Express, it works very well when the query result is small. But it will hang the server when the client query a large dataset, such as 1m rows (already using gzip to compression). Is this caused by node.js single thread design?
I would like to consulting you about any idea to handle this.
Any comments are welcome:)
Following are the code about the service (with JayData OData Server Module)
app.use('/d.svc', $data.ODataServer({
type: TYPE,
CORS: true,
database: 'odata',
responseLimit: -1,
checkPermission: function (access, user, entitySets, callback) {
logger.info('Check Access Permission for User');// + JSON.stringify(user));
if (access & $data.Access.Create) {
if (user == 'admin') callback.success();
else callback.error('Auth failed');
} else callback.success();
},
provider: {
name: 'mongoDB',
databaseName: 'odata',
address: settings.host,
port: settings.port,
username: USER,
password: PASSWORD
}
}));
Thank you very much.
Luke.