Video není dostupné.
Omlouváme se.

Rust On AWS (Really FAST Lambdas)

Sdílet
Vložit
  • čas přidán 17. 08. 2024
  • Learn about why you should consider the Rust language when using AWS Lambdas, especially when you need to minimize cold start times.
    We walk through using the Rust AWS SDK and creating a Rust based Lambda.
    Code can be found here: github.com/Me1...
    00:00 Why Rust On AWS
    00:42 Creating a Rust Lambda Project
    01:20 Dependencies
    02:54 Use Statements
    03:29 Main Function
    04:59 CustomEvent Struct
    05:25 Lambda Handler Function
    06:02 DynamoDB with Rust
    06:50 Handler Return Value
    07:07 Building For Lambda
    07:50 Build Shell Script
    09:36 Uploading To The AWS Console
    09:55 Invoking The Lambda
    10:20 Conclusion

Komentáře • 148

  • @ighsight
    @ighsight Před 2 lety +23

    As I write this, a solitary tear trickles down my cheek. Thanks so much for doing this video, I sorely needed it. I'm running Python Lambdas all day and the slow speed is contributing to long run times and significant costs. I've just got to move to a faster language and was really considering Node but Rust seems like a much more future aware move. That being said, knowing you need to move to Rust and actually writing code in Rust are vastly different things, so thanks for this explainer.

    • @codetothemoon
      @codetothemoon  Před 2 lety +5

      Best comment ever LOL! Very happy that you found the video valuable, let us know how the migration to Rust goes if you decide to go that route!

  • @LazarRedDevil95
    @LazarRedDevil95 Před 2 lety +57

    Great production level of the video, really appreciate the effort put in. And your teaching style is really good! Hope to see more Rust videos.

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thank you and thanks for watching! I'm pretty excited about Rust as well!

  • @alexkarav
    @alexkarav Před 2 lety +16

    I accidentally came across your channel in the recommendations, I was very surprised that with such a high quality of content you have so few subscribers. Your Rust lessons are some of the best on CZcams, I wish you success!

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thank you so much, I'm really happy it was recommended to you! More to come....

    • @alexkarav
      @alexkarav Před 2 lety

      @@codetothemoon Can't wait to see! I can suggest an idea - why not to make a video about creating a whole website using Rust - i.e. write a Backend on something like Actix Web or Tokio, and write a Frontend on Yew or any other framework, that can provide easy UI creation and can be compiled down to Webassembly?

    • @Malero
      @Malero Před rokem +1

      You have to remind people/ask for people to subscribe or they won’t think about it, they’re going to be thinking about the content of the video.

  • @FMontanari709
    @FMontanari709 Před 2 lety +13

    This is a great straightforward tutorial, I think a great way to improve it is to show the end result before starting the project (so we see better what is the problem we're trying to solve)... I know little to nothing about both rust and AWS (I might not exactly be the target audience) but it would help understand a few of the steps along the way

    • @codetothemoon
      @codetothemoon  Před 2 lety +5

      Thank you, and this is great feedback! I think it makes sense to show the end result in the beginning, even for folks that may be familiar with Rust and AWS.

  • @ricochen429
    @ricochen429 Před 2 lety +3

    Definitely a much better guide than the official AWS rust lambda guide. Regarding al2build function, here's another docker based solution using cross: cross build --release --target aarch64-unknown-linux-gnu

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thanks, glad you found it helpful! re: cross build, interesting I'll give that a try!

  • @samyerkes
    @samyerkes Před 2 lety +3

    This tutorial was great and helped me get started with Rust. It would be cool to see how you test this locally before deploying to AWS.

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Glad you liked it! and good idea - typically the go-to way for testing locally would be via AWS SAM, but I haven't tried it for a Rust based lambda

    • @Decstorose
      @Decstorose Před 2 lety +1

      @@codetothemoon with CDK's "new" hot swap for lambda functions, combined with streaming cloudwatch logs to your terminal for the function while it's in hot swap mode, it's getting easier to ignore local testing. Would be cool to see a video from you on that.

  • @richsadowsky8580
    @richsadowsky8580 Před rokem +1

    Awesome video. Clear explanation of all the tricky parts and needed scaffolding code. I can use this information immediately to start experimenting.

    • @codetothemoon
      @codetothemoon  Před rokem

      Nice Rich, really happy you found the video valuable!

  • @masiarek
    @masiarek Před 2 lety +1

    Thank you. Your teaching style is great. Your videos are short and to the point. Awesome!

  • @NeelanshMathur
    @NeelanshMathur Před 2 lety +2

    This was great! Your explanation was to the point and the topic of Rust and AWS was interesting. You have yourself a subscriber :)

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thank you, very happy to have you onboard!!!

  • @MrTickely
    @MrTickely Před 2 lety +9

    Great stuff!
    My one wish would be scaling the screen to be equal to the maximum line length (or using new lines in between method calls to shorten the longer lines), it makes it v hard to fully absorb the longer lines of code when they cant be read

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      Thanks MrTickely - thats a great idea - just the sort of feedback I'm looking for! It's probably frustrating when you want to see something that's just slightly off screen....

  • @EpicHardware
    @EpicHardware Před 2 lety +3

    0:20 look python thou i didn't expect that

    • @codetothemoon
      @codetothemoon  Před 2 lety

      yeah odd how it seems to have an advantage at 128mb, didn't see this as relevant in most real world scenarios as Lambda doesn't give you much CPU with that amount of memory

  • @bjornericcom
    @bjornericcom Před rokem +1

    I know almost no Rust and still felt like I could get the gist of this. Thanks!

    • @codetothemoon
      @codetothemoon  Před rokem

      nice! I do try to make these as accessible as possible to those not familiar with Rust - glad I succeeded here!

  • @robomasticus
    @robomasticus Před rokem +1

    I love this! Thank you for making a video that covers a practical use case.

  • @Krzysztow1985
    @Krzysztow1985 Před 2 lety +1

    Really nice explanations of each piece of code. Thanks a lot!

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Glad you found it valuable, thanks for watching!

  • @babalolajnr
    @babalolajnr Před 2 lety +1

    Great video and tutorial in general. Subscribed. I will definitely like to see more rust content in the future because there are limited video resources for learning Rust, which makes it harder for newer developers to get into.

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thanks, great to have you onboard! I'm really enjoying Rust, so there's definitely more to come....

  • @9SMTM6
    @9SMTM6 Před 2 lety +3

    You can write once, run anywhere with Rust.
    Not sure how production ready that is, but it does the simpler things fine.
    It's called WASM+WASI.

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      Great point! I'm very interested in applications of Rust in the WASM space, and I plan to explore this - there'll likely be a video about it!

    • @9SMTM6
      @9SMTM6 Před 2 lety

      @@codetothemoon I do hope that this will liberates from the need for proprietary platforms like the JRE per language (or that other languages have to adapt, often forcing them to conform to bad design choices).
      We will see however. It has to be said, that this approach requires (or at least much prefers) a small runtime by the language targeting wasm. Languages with a larger runtime will suffer from large binaries.
      Probably the reason the available material does recommend Rust or C(++).

  • @9SMTM6
    @9SMTM6 Před 2 lety +6

    Doesnt rustup support the necessary cross-compilation natively, without the need for Docker? rustup target add or stg like that, no need for Docker stuff.
    Not that it's not nice to know, but it does let rust look worse than it really is.

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      It does, but there appears to be a problem when cross compiling with the aws-lambda-rust-runtime library on the Mac. See the Building on MacOS Using Docker section here github.com/awslabs/aws-lambda-rust-runtime/blob/master/README.md. I tried it without Docker and did indeed run into an error. Googling the error seemed to indicate that the problem is related to specific versions of dependencies not being available, but I didn't dig any deeper at that point.

    • @pauleaster5380
      @pauleaster5380 Před 2 lety +4

      I just went through this process in the last couple of days on MacOS as well. I use cargo to build using x86_64-unknown-linux-musl target. It was pretty straightforward. I did spend a lot of time setting up the configuration which doesn't appear to exist in this video though :) I found that Terraform+rust was the path of least resistance. Two days from scratch to a severless API with lambda and API gateway.

  • @Khari99
    @Khari99 Před 2 lety +1

    The fireship editing inspiration does it for me. Def getting the sub just for that.

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thanks Khari!! You've correctly identified my biggest source of inspiration! His newer one about creating a stock trading app is hilarious.

    • @Khari99
      @Khari99 Před 2 lety +1

      @@codetothemoon definitely one of my favorite coding creators for sure

  • @n8style
    @n8style Před 2 lety +1

    good video! especially liked the attention to detail of speeding up the non speaking parts

  • @html8525
    @html8525 Před 2 lety +1

    Great tutorial with comparisons to JS

  • @drew4711
    @drew4711 Před 2 lety +5

    Guarantee it will be 100x faster if you deploy the rust code as a wasm module to cloudflare workers. Cloudflare workers have a sub millisecond cold startup time and are globally distributed by default

    • @When_am_I
      @When_am_I Před 2 lety

      Drew, would this also eliminate the need for Docker?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Interesting, Cloudflare wasn't on my radar, I'll have to check it out!

    • @DFPercush
      @DFPercush Před 2 lety +1

      great thing about that is, Rust already has a wasm toolchain.

    • @gary3658
      @gary3658 Před 2 lety +2

      A fair warning: as of June 2022, Cloudflare Workers work with Rust/WASM, but do not allow Rust connections to cloud MongoDB Atlas (which includes a free tier), due to missing "MongoDB App Services" SDK for Rust. The cloud database directly on Cloudflare is Cloudflare KV (key-value), which, under the free tier, allows only 1,000 write requests per day (less than 1 write request per minute).

  • @wtho
    @wtho Před 2 lety +3

    Awesome content!
    Maybe you can make a follow-up where you use this lambda code in a cdk project

  • @vishnugovindan8550
    @vishnugovindan8550 Před 2 lety +2

    Thanks for the video!
    Lambda functions are completely new to me so this was a nice intro to it!
    Can you try to write the same lambda function in different languages like JS, Python, Go etc, deploy them and then compare the performance (to really see how fast Rust is in comparison to others)?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      You're very welcome, I didn't give much context around Lambda itself so it makes me happy to know that it is useful for Lambda newbies as well!
      Re: your benchmark comparison request, actually this is a fantastic blog post that does just that! filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1

  • @pele7208
    @pele7208 Před 2 lety +2

    Nice video. Can you show us the init duration of the lambda during cold starts?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thanks, glad you liked it! Check out Aleksandr Filichkin's blog post! filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1

  • @thisisnotok2100
    @thisisnotok2100 Před rokem

    How was cargo already available in the container when he built it? Does arch have cargo preinstalled?

  • @michaelbalian3513
    @michaelbalian3513 Před 2 lety +1

    when I zip the file with the docker script after building with the al2build function, It gives me a no such file or directory error. Can anyone help me out with this?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      hey Michael - what file is it looking for that it can't find?

  • @thisisnotok2100
    @thisisnotok2100 Před rokem

    Is this in a VPC so the db is not exposed to the outside world? Last time I checked that requires a minimum $30/mo investment due to the need of an NAT gateway, if you need your function to access the internet.

  • @inDefEE
    @inDefEE Před rokem +1

    I write a tonnnnn of lambas in my job and would love to give rust a shot. Where did you learn all the semantics of getting rust up and running in Lamba? I’m not seeing a lot of docs from them on it

    • @codetothemoon
      @codetothemoon  Před rokem

      yeah docs are a bit sparse, which is part of the reason I created this video. I thought this would certainly have been addressed in the year since I created the video, but maybe not. Here's a promising looking guide docs.aws.amazon.com/sdk-for-rust/latest/dg/lambda.html

    • @inDefEE
      @inDefEE Před rokem

      @@codetothemoon thanks you’re the man!

  • @Morum01
    @Morum01 Před 2 lety +1

    Great video! Just would really like to see the performance numbers.

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thank you! I didn't actually do any benchmarking myself - check out Aleskandr's blog post! filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1

  • @diegomarzo4001
    @diegomarzo4001 Před 2 lety +1

    Very good video, I really enjoyed, you have a new Subscriber!

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thanks and welcome aboard, very happy to have you!

  • @code_marked
    @code_marked Před rokem

    Is there any full out courses around that teaches one how to use Rust with AWS?

  • @HetThakkar809
    @HetThakkar809 Před 2 lety +1

    Fantastic tutorial! Subscribed

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thank you and thanks for watching! More to come.

  • @muezsier
    @muezsier Před 2 lety +1

    Very nice explanation, great video

  • @gianmarcoiapoce6579
    @gianmarcoiapoce6579 Před rokem

    I started testing rust SDK. I must say it's still quite unstable compared to other languages SDK and getting things done in rust is not so easy or straightforward but I think it's worth a try

  • @aazzrwadrf
    @aazzrwadrf Před 2 lety +1

    your videos are really excellent

  • @andynelson2340
    @andynelson2340 Před 2 lety +2

    Cool video, rust seems like a cool language to pick up. I'm doing all my API work in python at the moment but would like to try Rust at some point.

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Nice! Yeah there's a bit of a learning curve but the performance advantage and type system is pretty compelling. If you decide to try it, definitely let us know how it goes!

    • @andynelson2340
      @andynelson2340 Před 2 lety +1

      @@codetothemoon thanks, nice production value and content 👍

    • @kevinmcfarlane2752
      @kevinmcfarlane2752 Před rokem +1

      A while ago I wrote a digit recognition machine learning console application in Rust that was a copy of a .NET application from a book. I had also previously written a Python version of it. I then compared timings. This is what I found.
      Python - 22s
      C# - 1.03s (.NET 4.8)
      C# - 0.52s (.NET 6.0)
      Rust Debug - 5.72s
      Rust Release - 0.28s
      (Rust release builds are much faster than debug builds. A release build typically runs much faster than a debug build. 10-100x speedups over debug builds are common!)
      So it will be interesting to see what happens when you redo your work in Rust. As this is 9 months later perhaps you've progressed since?

  • @yankee-in-london
    @yankee-in-london Před 2 lety +1

    Question ... can't you just add a target for AWS's Linux and compile to that target instead of whipping out Docker? I'd have thought at least the M1 apple silicone (or other ARM arch) would be able to do this.

    • @yankee-in-london
      @yankee-in-london Před 2 lety +1

      oops ... I see that this question was already asked and discussed right below my scroll point in the questions . :)

    • @codetothemoon
      @codetothemoon  Před 2 lety

      np, hoping we don't have to rely on docker to do this in the future!

  • @pauleaster5380
    @pauleaster5380 Před 2 lety +2

    I liked the default_provider().or_elase() command

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      definitely nice to be able to do this in one line!

    • @pauleaster5380
      @pauleaster5380 Před 2 lety

      @@codetothemoon lol, I was actually commenting on the typo :P but yes it is convenient that this is a one liner

  • @yaleynikov
    @yaleynikov Před rokem +1

    Thanks!

  • @andyburns
    @andyburns Před 2 lety +3

    Any chance of benchmarking rust lambdas against other languages?

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Aleksandr Filichkin made a blog post about this! Check it out here filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1

    • @andyburns
      @andyburns Před 2 lety +1

      @@codetothemoon thanks, I didn't catch the name as you mentioned it ...

    • @WorstDeveloper
      @WorstDeveloper Před 2 lety +1

      That's a cool comparison. I wish they didn't use such old C# and Node versions though.

  • @lilakouparouko1832
    @lilakouparouko1832 Před 2 lety +2

    The post "clearly shows rust as the best performer" ?
    Isn't the conclusion of the post saying : "Golang and Rust are the winners. They have the same brilliant performance." ?

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Go seems to provide great performance as well! It looks like they are neck and neck for warms starts, but most languages seem to be in the same ballpark there. Usually the sticking point in considering Lambda over other compute solutions is cold start performance, and Rust seems to have a non-negligible advantage over Go there. Probably hard to go wrong with either language though!

  • @gamer-gw9iy
    @gamer-gw9iy Před 2 lety +1

    Great video, definitely subscribing -- the example seemed a bit useless though 😅 writing to a database seems way too simple of a function to me

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thank you and thanks for the feedback! I'm looking forward to sharing something a bit more substantial on here - in the meantime, I'd love to hear some success (or failure!) stories incorporating Rust Lambdas into a larger system.

  • @philvini4731
    @philvini4731 Před rokem +1

    Very nice tutorial! I am pretty confident that I configured AWS Lambda and DynamoDB correctly, including the necessary permissions. I still get an Error from AWS Lambda that GLIBC is not found. :(

    • @amaurymaillard5284
      @amaurymaillard5284 Před rokem +1

      Hi! I used a slightly different method that seems to work. If you have a problem with `cross build` you may need to add `docker` to a group to avoid using `sudo` (if on linux).
      Don't forget to `source *.bash` (or *zsh) before calling the functions.
      Also do not forget to create a DynamoDB table named `users` with a partition (primary) key as `uid`, the code does not create the table automatically. Finally, create a lambda function with custom runtime `Custom runtime on Amazon Linux 2`.
      Hope it helps!
      # deploy.bash or deploy.zsh
      # source *.bash or *.zsh
      RUST_TARGET="x86_64-unknown-linux-musl" # should solve the GLIBC problem
      PROJECT_NAME="rust-aws"
      build() {
      cargo install cross \
      && cross build --release --target ${RUST_TARGET}
      }
      package() {
      cp target/${RUST_TARGET}/release/${PROJECT_NAME} ./bootstrap \
      && zip lambda.zip bootstrap \
      && rm bootstrap
      }

    • @codetothemoon
      @codetothemoon  Před rokem

      Thanks! Did you build using the Docker approach? I'm wondering if Lambda changed the custom runtime since this video was created...

    • @amaurymaillard5284
      @amaurymaillard5284 Před rokem

      @@codetothemoon I actually did not use Docker, I directly uploaded the .zip file to AWS lambda!

    • @stevenallen3237
      @stevenallen3237 Před rokem

      I'm having the same problem

    • @joecardella4235
      @joecardella4235 Před rokem

      @@amaurymaillard5284 this fixed it for me. Thank you for sharing.

  • @alannxq159
    @alannxq159 Před 2 lety +2

    i did a double take when i saw "43 subscribers" lmao

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      Hopefully this means you were number 44? :) if so, very happy to have you on board!

    • @alannxq159
      @alannxq159 Před 2 lety

      @@codetothemoon of course!

  • @driftFD
    @driftFD Před 2 lety +1

    Subscribed.

  • @ianpogi5
    @ianpogi5 Před 2 lety +1

    Great stuff! How do you run this locally like serverless-offline?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thank you! Great question, I haven't actually explored this in a Rust context, in other languages I've used AWS SAM, not sure if that is actually an option for Rust Lambdas. Worth looking into though.

  • @gabrielguesser
    @gabrielguesser Před rokem +1

    Thanks for the video, excellent as always!
    I'm getting an error when running the function on AWS:
    /var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.29' not found (required by /var/task/bootstrap)
    /var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/bootstrap)
    It seems that has something to do with the latest rust versions using GLIBC, which al2 doesn't support.

    • @codetothemoon
      @codetothemoon  Před rokem

      I hate to punt on this, but I haven't run this in awhile and I'm wondering if AWS changed the linux runtime in some way. Are you building it using Docker?

    • @gabrielguesser
      @gabrielguesser Před rokem

      @@codetothemoon Yes, exactly same process as in your video. It seems to be something with the newer rust version. I think in your video you were using 1.57.0 and I'm using 1.64.0, don’t know if there's a compatibility issue with the glibc version provided by al2.

  • @jwickerszh
    @jwickerszh Před 2 lety +1

    This is cool, but why can't AWS just build it for you and run it in whatever arch they see fit? This kind of things is a bit why no one really uses AWS directly. 😅

    • @codetothemoon
      @codetothemoon  Před 2 lety

      I agree that would be really nice! Hoping to see more and more Rust support in AWS, starting with a built-in Lambda runtime...

  • @Rogueixpresents
    @Rogueixpresents Před rokem

    Hey, couldn’t you just compile right into the architecture instead of using dockers?

  • @nathanlewis42
    @nathanlewis42 Před 2 lety +1

    Liked and subscribed.

  • @cxsey8587
    @cxsey8587 Před 2 lety +3

    I really like rust but I find the code to be extremely verbose, kinda hoping someone makes a language using rust that’s a bit more abstracted but allows you to use some of the really nice features

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      I agree! There are a ton of compelling reasons to use Rust at the moment, but I think the perfect language still remains elusive.

    • @kevinmcfarlane2752
      @kevinmcfarlane2752 Před rokem

      Depending on the kind of applications you want to write you might find F# more attractive if verbosity is a major issue for you. It overlaps a bit in the syntax and features, as both languages draw from ML. F# is also now cross-platform, since .NET is.

  • @_tsu_
    @_tsu_ Před 2 lety +2

    pretty sure --bin is the default behavior of cargo. No need to type it out😀

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Ohh nice, I'm going to try omitting it next time!

  • @Rundik
    @Rundik Před 2 lety +2

    aws can scale. why would you save their resources if you'll pay the same anyway

    • @codetothemoon
      @codetothemoon  Před 2 lety +2

      Lambda charges based on (number of executions + GB/second of runtime). Since Rust generally achieves better performance than other languages given the same allocation of memory (which also determines CPU resource allocation), you can choose to pay the same and have faster APIs, or pay less money (by allocating less memory) and get similar performance.

    • @Rundik
      @Rundik Před 2 lety +1

      @@codetothemoon fair enough, I didn't know about that GB/second thing

  • @jeanpierre5941
    @jeanpierre5941 Před 2 lety +1

    I mean no offense to anyone, but discovering that ahead of times compiled languages who have minimal runtimes, and no garbage collection, supported by Optimizing compilers and optimizing linkers, are faster than interpreted/JIT compiled garbage collected languages, is not news.
    That fact hold true on most operations in AWS lambda and elsewhere…

  • @fluffio2976
    @fluffio2976 Před 2 lety +1

    You deserve moar subs.
    Have mine~

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thank you, and very happy to have you onboard!

  • @nadavge
    @nadavge Před 2 lety +1

    This aims to be a Rust on AWS tutorial, but you fast forward everything both Rust and AWS related.
    The intent is appreciated, but how is someone to learn something from this tutorial? It’s basically a code snippet in a video format…

    • @codetothemoon
      @codetothemoon  Před 2 lety +1

      Thanks for the feedback! How could I change the format to make it more valuable? Less fast forwarding and more explanation of what I'm doing?

    • @nadavge
      @nadavge Před 2 lety

      @@codetothemoon That’s a tough one, because I assume you also wanted to keep it concise.. Easier to critic than give easy to follow suggestions. If you really want to hear I’d be happy to attempt to give constructive suggestions over a chat session, comments are.. too concise haha

  • @eyesight2073
    @eyesight2073 Před rokem

    Your thumbnail is against foundation policy 😂

  • @ciullaantj
    @ciullaantj Před 2 lety +1

    My recommendation would be to stop fast forwarding when writing the code, some areas where you were writing functions I wasn't familiar with the fast forwarding made it extremly difficult to follow and required me to rewind multiple times.

    • @codetothemoon
      @codetothemoon  Před 2 lety

      Thanks Anthony, i'm glad you brought this up - Ive been on the fence about the fast forwarding, as like you said it's probably a bit jarring. I'll tone it down a notch!

    • @gajop
      @gajop Před 2 lety

      @@codetothemoon also your face kinda covered bits and pieces of code, but I guess having the GitHub link is good enough in the end! Thanks for the video

  • @danielbrenot5173
    @danielbrenot5173 Před rokem +1

    Disliked because you have multiple coding errors like not actually defining uuid and misspelling results, and you didn't show fixing those or that they were mistakes at all, and that might confuse newcomers.
    Edit: I should have made it clear before, but I did love the video for showing off that rust can do lambda. Thanks for the video regardless!

    • @codetothemoon
      @codetothemoon  Před rokem +1

      Thanks for the feedback Daniel! Sorry about those mistakes, I hope you got some value from the video despite them. It sounds like you figured out the corrections yourself already, but you can find the final code here if you like github.com/Me163/youtube/tree/main/RustOnAWS. Cheers!

  • @dranon0o
    @dranon0o Před 2 lety +1

    > alex jones
    nice

    • @codetothemoon
      @codetothemoon  Před 2 lety

      alex jones?

    • @dranon0o
      @dranon0o Před 2 lety +1

      ​@@codetothemoon At the end near 10:20 :)

    • @codetothemoon
      @codetothemoon  Před 2 lety

      ohh yeah I chose that name completely at random (as i did for bobby smith), is that an actual famous person?

  • @adambickford8720
    @adambickford8720 Před 2 lety +1

    Rust n00b here. Wouldn't `request.send().await?` actually be anync and non-blocking? However, since its lambda you aren't actually freeing up the "thread" and still charged until the "Ok()" call as if we were blocking? IOW: aws gets the resources you freed up instead of the CPU in an EC2 instance, no?

    • @codetothemoon
      @codetothemoon  Před 2 lety

      I *think* send() is async and "await" causes it to block, so yes the thread should yield to any other tasks that need to be performed, and in this case there aren't any. So yeah Lambda would still charge us for runtime while we're waiting for the DDB response. Would be great if there was a way around this!

    • @adambickford8720
      @adambickford8720 Před 2 lety

      @@codetothemoon Also a lambda n00b but i think you'd effectively have to use "step functions" or you'll pay for the lambda that is "orchestrating" the calls while it waits for the response.
      Where this get even trickier (to me) is lambda might reuse your context. Does that mean it effectively hibernates deamon threads between requests when it suspends you?

  • @michelvandermeiren8661
    @michelvandermeiren8661 Před rokem +1

    lambda is fast ok but cold start exceeds easily 3 seconds

    • @codetothemoon
      @codetothemoon  Před rokem

      it's very abnormal to have a cold start exceeding 3 seconds, unless maybe you're using the Java runtime and your package is huge - like 100s of megabytes or gigabytes. Can you share more details about your specific setup?