Rust On AWS (Really FAST Lambdas)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 149

  • @ighsight
    @ighsight 2 ปีที่แล้ว +24

    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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

  • @alexkarav
    @alexkarav 2 ปีที่แล้ว +15

    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 TH-cam, I wish you success!

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

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

    • @alexkarav
      @alexkarav 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว

      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 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @richsadowsky8580
    @richsadowsky8580 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      Nice Rich, really happy you found the video valuable!

  • @samyerkes
    @samyerkes 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว +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.

  • @masiarek
    @masiarek 2 ปีที่แล้ว +1

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

  • @NeelanshMathur
    @NeelanshMathur 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

  • @robomasticus
    @robomasticus 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thanks, glad you found it helpful!

  • @MrTickely
    @MrTickely 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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....

  • @bjornericcom
    @bjornericcom ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

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

  • @Krzysztow1985
    @Krzysztow1985 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

      Glad you found it valuable, thanks for watching!

  • @Khari99
    @Khari99 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

  • @n8style
    @n8style 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

      Thanks, glad you enjoyed it!

  • @html8525
    @html8525 2 ปีที่แล้ว +1

    Great tutorial with comparisons to JS

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

      thanks, glad you found it valuable!

  • @9SMTM6
    @9SMTM6 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@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(++).

  • @babalolajnr
    @babalolajnr 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @diegomarzo4001
    @diegomarzo4001 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thanks and welcome aboard, very happy to have you!

  • @vishnugovindan8550
    @vishnugovindan8550 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

      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

  • @9SMTM6
    @9SMTM6 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +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.

  • @HetThakkar809
    @HetThakkar809 2 ปีที่แล้ว +1

    Fantastic tutorial! Subscribed

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thank you and thanks for watching! More to come.

  • @drew4711
    @drew4711 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      Drew, would this also eliminate the need for Docker?

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

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

    • @DFPercush
      @DFPercush 2 ปีที่แล้ว +1

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

    • @gary3658
      @gary3658 2 ปีที่แล้ว +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).

  • @muezsier
    @muezsier 2 ปีที่แล้ว +1

    Very nice explanation, great video

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thank you, glad you liked it!

  • @wtho
    @wtho 2 ปีที่แล้ว +3

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thank you, and that's a great idea!

  • @pele7208
    @pele7208 2 ปีที่แล้ว +2

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      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

  • @Morum01
    @Morum01 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +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

  • @aazzrwadrf
    @aazzrwadrf 2 ปีที่แล้ว +1

    your videos are really excellent

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

      Thank you! More to come…

  • @gianmarcoiapoce6579
    @gianmarcoiapoce6579 ปีที่แล้ว

    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

  • @EpicHardware
    @EpicHardware 2 ปีที่แล้ว +3

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      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

  • @inDefEE
    @inDefEE ปีที่แล้ว +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  ปีที่แล้ว

      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 ปีที่แล้ว

      @@codetothemoon thanks you’re the man!

  • @andynelson2340
    @andynelson2340 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

      @@codetothemoon thanks, nice production value and content 👍

    • @kevinmcfarlane2752
      @kevinmcfarlane2752 ปีที่แล้ว +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?

  • @michaelbalian3513
    @michaelbalian3513 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @ianpogi5
    @ianpogi5 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      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.

  • @pauleaster5380
    @pauleaster5380 2 ปีที่แล้ว +2

    I liked the default_provider().or_elase() command

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +1

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

    • @pauleaster5380
      @pauleaster5380 2 ปีที่แล้ว

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

  • @code_marked
    @code_marked ปีที่แล้ว

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

  • @thisisnotok2100
    @thisisnotok2100 ปีที่แล้ว

    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.

  • @lilakouparouko1832
    @lilakouparouko1832 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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!

  • @andyburns
    @andyburns 2 ปีที่แล้ว +3

    Any chance of benchmarking rust lambdas against other languages?

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

    • @WorstDeveloper
      @WorstDeveloper 2 ปีที่แล้ว +1

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

  • @yankee-in-london
    @yankee-in-london 2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

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

  • @gabrielguesser
    @gabrielguesser 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      @@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.

  • @thisisnotok2100
    @thisisnotok2100 ปีที่แล้ว

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

    • @matthewsantiago7113
      @matthewsantiago7113 2 วันที่ผ่านมา

      I know this is late, but this is not Arch Linux. Arch is architecture. ARM architecture.
      Moreover, your docker image can have cargo preinstalled depending on the image you use.

  • @yaleynikov
    @yaleynikov ปีที่แล้ว +1

    Thanks!

  • @gamer-gw9iy
    @gamer-gw9iy 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว +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 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

    • @amaurymaillard5284
      @amaurymaillard5284 2 ปีที่แล้ว

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

    • @stevenallen3237
      @stevenallen3237 ปีที่แล้ว

      I'm having the same problem

    • @joecardella4235
      @joecardella4235 ปีที่แล้ว

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

  • @nathanlewis42
    @nathanlewis42 2 ปีที่แล้ว +1

    Liked and subscribed.

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thanks Nathan, great to have you here!

  • @driftFD
    @driftFD 2 ปีที่แล้ว +1

    Subscribed.

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Awesome, really happy to have you onboard!

  • @cxsey8587
    @cxsey8587 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 ปีที่แล้ว

      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.

  • @jwickerszh
    @jwickerszh 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 ปีที่แล้ว

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

  • @Rundik
    @Rundik 2 ปีที่แล้ว +2

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

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

  • @fluffio2976
    @fluffio2976 2 ปีที่แล้ว +1

    You deserve moar subs.
    Have mine~

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thank you, and very happy to have you onboard!

  • @alannxq159
    @alannxq159 2 ปีที่แล้ว +2

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว +2

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

    • @alannxq159
      @alannxq159 2 ปีที่แล้ว

      @@codetothemoon of course!

  • @jeanpierre5941
    @jeanpierre5941 2 ปีที่แล้ว +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…

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      None taken, thanks for watching!

  • @_tsu_
    @_tsu_ 2 ปีที่แล้ว +2

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

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

  • @nadavge
    @nadavge 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@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 ปีที่แล้ว

    Your thumbnail is against foundation policy 😂

  • @ciullaantj
    @ciullaantj 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      @@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 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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 2 ปีที่แล้ว +1

    > alex jones
    nice

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      alex jones?

    • @dranon0o
      @dranon0o 2 ปีที่แล้ว +1

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

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

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

  • @adambickford8720
    @adambickford8720 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      @@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 ปีที่แล้ว +1

    lambda is fast ok but cold start exceeds easily 3 seconds

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว

      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?