I am uploading some images to a blob in MySQL but every time I upload it is very slow. I tried uploading the plain text vs. converting the text to a buffer before uploading and both ways seem like they are just as slow as the other but I have a feeling that converting is faster. I am using NodeJS and uploading with the fileReader result value on the client. Is there any way I can make uploading faster on the server? I am thinking that if I insert the buffer, the MySQL blob will be able to read that a buffer is being inserted and wont attempt to convert it like it would a string. Is there a way to bypass the conversion process of a MySQL blob so I can upload faster? ..Or does the conversion happen quickly and is it something else that is slowing down the insertion?
if(req.body.product_images.length == 0) {
req.body.product_images = null;
} else {
req.body.product_images = req.body.product_images.join('***img_separator***'); //string upload
req.body.product_images = Buffer.from(req.body.product_images, 'utf-8'); //buffer upload
}