On 21/05/14 00:00, Matt wrote:
> What options are out there currently for streaming blob support in Node.js databases?
>
> I know that MongoDB has GridFS which seems to support streams. Are there any others?
I suppose you mean "DBMS supported by Node,js", rather than "Node.js databases".
Anyway, I streamed successfully fairly sizeable binary attachments (600MB) to/from
CouchDB with Nano (Node.js driver for CouchDB), by piping directly to the response
(or, conversely, from the request body to the attachment):
var stream = datastore.db.attachment.get(docid, "blob",
function(errStream) {
if (errStream) {
datastore.commons.logger.error(
"Doc. %s load attachment error: %s", docid,
errStream.message);
return datastore.swagger.stopWithError(res, {
code : 500,
reason : errStream.message
});
}
});
if (stream) {
stream.pipe(res);
} else {
return datastore.swagger.stopWithError(res, {
code : 500,
reason : "Error creating stream"
});
}
...
Regards,
Luca Morandini
Data Architect - AURIN project
Melbourne eResearch Group
Department of Computing and Information Systems
University of Melbourne
Tel. +61 03 903 58 380
Skype: lmorandini