AWS services moving forward - 3rd party services depreciation

Hey @henna.s,

Thank you for the quick reply. I apologize that you have been trying to manage various concerns flowing through this thread, mine is related to the original issued shared just regarding AWS (specifically s3) performance. I am just trying to upload an image from Realm to AWS s3.

Loading the AWS SDK package (which I understand is the direction this thread started to take) is not the issue. We currently have not tested 3rd party services given the depreciation anticipated by the end of the year.

The image being uploaded is in base64. With that, my understanding is that as the image quality increases (# of bytes), there is a drastic reduction in the upload speed.

// uploadImageToS3
exports = async function(newId, newPicture, bucket) {  
  const S3 = require('aws-sdk/clients/s3'); // require calls must be in exports function
  const s3 = new S3({
    accessKeyId: context.values.get("AWS_ACCESS_KEY"),
    secretAccessKey: context.values.get("AWS_SECRET_ACCESS_KEY"),
    region: "AWS_REGION",
  })
    
  const putResult = await s3.putObject({
    Bucket: bucket,
    Key: newId,
    ContentType: "image/jpeg",
    Body: Buffer.from(newPicture, 'base64'),
    ContentEncoding: 'base64'
  }).promise();
}

Link to documentation: Class: AWS.S3 — AWS SDK for JavaScript

It is my understanding that using base64 may be driving the issue, but if that is so, it leads me to the following questions:

  • This would imply to me that normal - high quality base64 images are really not really supported by Realm. I say that because my Realm function times out after 60 seconds and sending the original image quality will force a timeout. In order to avoid a timeout consistently we have been reducing the base64 image quality prior to sending it to the Realm function. Is that a fair takeaway?
  • What image type should be passed through Realm? We are using base64 strings because frankly it was the only solution we could find that seemed to work. I’m not sure if documentation has been updated / added to be clearer as to the types of images we can upload.
  • Are there better solutions?

Your help is really appreciated on this. If we need to share more, I am happy to do so.

Cheers,
Jason