AWS services moving forward - 3rd party services depreciation

Hey @Tyler_Collins

Try this code out. It works fine in my app.

exports = function(s3Path) {
  const s3 = context.services.get("AWS").s3("ap-southeast-2");
  const bucket = "my-bucket";

  const presignedUrl = s3.PresignURL({
    Bucket: bucket,
    Key: s3Path,
    // HTTP method that is valid for this signed URL. Can use PUT for uploads, or GET for downloads.
    Method: "GET",
    // Duration of the lifetime of the signed url, in milliseconds
    ExpirationMS: 900000
  });
  return presignedUrl;
};
1 Like

This worked, thank you

1 Like

Awesome, glad I could help!

Hi @Tyler_Collins – We should release the first in a series of performance improvements targeting packages that make external requests within the next week or so.

3 Likes

Hi Folks – As a quick update, we released a minor update targeting dependency performance last week but will continue to focus on this area.

1 Like

Hi Drew,

Thanks for the update!

In terms of feedback, it looks like the time is unchanged with the S3 getObject function I used in the examples above.

Time taken: 5839ms

Cheers

@Drew_DiPalma I am seeing the same bad performance with S3.

Thanks for the feedback! We are continuing to work on more performance improvements and I will update this thread as changes are released.

Hi Folks – Just wanted to update this thread that we pushed two additional changes to Realm’s Function engine yesterday which we believe will lead to significant performance improvements across many packages such as AWS, Stripe, and Axios. Very interested in hearing any and all feedback from this group!

1 Like

Hi @Drew_DiPalma thank you for the update! I will test this later today and report back.

Thank you

@Tyler_Collins were you able to see improvements with the SDK? @Drew_DiPalma any future enhancements / timelines we should be aware of?

Cheers!

You know, I didn’t get around to testing this. I will do this today and see if there is an improvement.

1 Like

Hi Folks – We have seen significant improvements in the past few weeks across all packages that make external requests. We also did just have another improvement go out towards the end of this week. We are always looking to make more improvements to our engine and interested in hearing feedback, but currently do not have any specific packages that we are working to optimize. Unless there are specific updates, it is likely that we’ll close this thread soon in favor of opening new threads for any future questions, etc.

A post was split to a new topic: Stripe Webhooks and AWS-S3 function call issue

I’ve tested the realm functions since the update and I am not seeing an improvement with aws-sdk.

I have aws-sdk - 2.737.0 installed as a dependency in functions.

Using the 3rd Party Services go AWS context my function takes 37ms to return.
Using the aws-sdk package my function takes 4000 ms to return.

For context I am using the aws package to generate pre-signed urls.

Thank you

@Drew_DiPalma I wanted to make sure you saw my previous comment. I am still seeing long runtimes when importing aws-sdk.

Hi Tyler – Thanks for checking in! This function seems to be an outlier from a performance perspective so we’ll be taking a closer look. That being said, I think we’ve seen it cut down a quite bit over the past few weeks in our benchmarks (though still certainly improvements to be made still).

Hi all,

I had another play with this just and I think the elevated run time we are seeing is due to the time spent loading the S3 SDK into memory.

The S3.getObject() runs in a reasonable time. But I think the issue of it feeling slow is due to the SDK having to be loaded into the function?

Just to add i’m using the latest AWS v2 - 2.1133.0

Thanks

I confirmed on my end and I am seeing this looks to be exactly the case. In the short term until you have guidance on how to increase this performance I am using the 3rd party service which is currently very fast.

Thank you

1 Like

@Tyler_Collins thank you for sharing your current solution. Are you able to provide a code snippet on how you are using the 3rd party service? Or at least elaborate a little bit more on how you are using this service? I have been dealing with this AWS issue for some time now and would love to use your solution to this performance bottleneck.

Cheers!

1 Like