Building .NET 8 Minimal APIs With AWS Lambda and Amazon RDS

  Рет қаралды 37,894

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 48
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Get the source code for this video for FREE → the-dotnet-weekly.ck.page/aws-lambda Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@vlad.kravchenko
@vlad.kravchenko 6 ай бұрын
I'm a complete 0 in AWS. Before, I tried few times publishing Hello World on AWS using other tutorials and Chat GPT with no luck. Thanks to you now I have one up and running!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Nice work! I'm so thrilled to hear that, honestly 😅
@blackpaw29
@blackpaw29 6 ай бұрын
Interesting, quite straightforward. Pity theirs not a permeant free RDS tier.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
I'd say you can still host a database cheaply. Of course, we'd have to compare it to other options (or cloud providers) to decide which option is better.
@igorilyichyov6414
@igorilyichyov6414 6 ай бұрын
Milan, thanks a lot for this video! It's very useful!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Glad it was helpful!
@rookieew
@rookieew 6 ай бұрын
Dont do this! Only with AOT. The C# Lambda cold starts are horrible. And if you use the aws lambds templates and every api method in a function handler you'll pay the pain. Dont forget the most aws Services are money maker. Read the Lambda docus twice.lambda Powertools double your cloudwatch Costs. Beware the using of cloud if you dont really know how it works and what you will pay.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
| Dont forget the most aws Services are money maker. Is this not true for any cloud service? Is this also not true for the applications we build (hopefully)? Price is also an argument of value - do you get enough value back for the price you pay. Value is a function of what's important to you(r team).
@pilotboba
@pilotboba 6 ай бұрын
There are some things you can do. Also cold start time depends on how many lambdas in the AWS region/az are using the runtime. Also, if you are getting a decent amount of traffic, the underlying infra isn't shutting down, so you don't get as many "starts" . Everything is a tradeoff. Cost of ECS with fargate could be less, it could be more. It depends. There is a tipping point were traffic gets more expensive and it's time to move from lambda -> containers on fargate -> containers on EC2 -> MVs on EC2 with wix or something. Maybe in the future wasi with native AOT will actually happen.
@ChrisBuckmaster-y8u
@ChrisBuckmaster-y8u 6 ай бұрын
Thanks for this Milan - how would you adapt this for larger APIs? I.e how can you create multiple lambdas for each endpoint? Do you do a separate project, or is there a way to deploy a lambda per endpoint?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Will discuss this in a future post/video, great question
@xearlx
@xearlx 6 ай бұрын
Great demo! I'm using api gateway + .net aws lambda for a rest api, but sometimes warmup time is over 5seconds in prod. Do you experience this or have any suggestions countering aside from writibg a lambda warmer which I've already done lol??
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
This also sets up an API gateway that routes the request to the lambda. For faster startup, you can try AOT compilation. But other than that...
@vshengur
@vshengur 6 ай бұрын
Thanks for good idea for Friday's evening!)
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
You are welcome! I love how simple they've made the entire process.
6 ай бұрын
Dude nice video! thanks for sharing all your knowledge with all of us. Quick question, why do you prefer Postgres instead of MSSQL for mostly all your videos? Is it because of the open-source stuff?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
I prefer PostgreSQL for the more flexible data model and rich JSON support. Plus you can store arrays and event key-value pairs. Opens up very interesting data modeling options. That that it's free to use, unlike MSSQL which requires a license, is another reason. However, I've worked with MSSQL for years, maybe even more than I've used PostgreSQL.
@AndrewJudd
@AndrewJudd 6 ай бұрын
Doesn't making your RDS instance public pose security issues since the outside world is then able to connect to it?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Yes, just for demo purposes though.
@AndrewJudd
@AndrewJudd 6 ай бұрын
@@MilanJovanovicTech The problem is that's not mentioned in the video, and when you end up deploying to the Lambda function, there is a little more set up required for making it work with the database when it's not available remotely. That part of it is rarely mentioned in any demo videos but is a key part of the actual set up.
@dallasthornton2374
@dallasthornton2374 Ай бұрын
@@AndrewJudd Yeah this needs more eyes on it. It's a totally different beast when you want to connect to a database that is properly secured in a private subnet of a VPC. It was really just a small bit of the video mentioning allowing the RDS to be publicly available.
@sunzhang-d9v
@sunzhang-d9v 6 ай бұрын
How do you use the domain model modification, for example, in the order field, I need to change the data, but the content is not sure, how to make the modification method of the domain model
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Which order field?
@sunzhang-d9v
@sunzhang-d9v 6 ай бұрын
@@MilanJovanovicTech Any one
@abhinavsrivastava2128
@abhinavsrivastava2128 6 ай бұрын
Hey Milan, huge fan of your videos. However, for this particular video, don't you think you should reconsider the choice of tool for hosting web applications from aws suite? Not only does the lambda cold start cause issues of increased start up time but also from the perspective of the web application having background services, the max run time limitations of lambda functions don't help much. Moreover looking at the benefits of lambda that you highlighted almost all of them are available with something like fargate beneath ECS. Please let me know your thoughts on this thanks.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
| from the perspective of the web application having background services We won't use Lambda in this case, obviously. Or we could run background services in a separate process. | the lambda cold start cause issues of increased start up time How much of an issue is it? I think this should be something we measure and see
@AurelioPiccinino
@AurelioPiccinino 6 ай бұрын
Nice video, is it possible create Minimal APIs also with Azure function ?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Most likely, let's do another video
@ChristopherBriddock
@ChristopherBriddock 6 ай бұрын
Milan, can you do a video about Read and Write separation at a database level.Curious to see how you would handle this.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
I believe I did
@ransandu
@ransandu 6 ай бұрын
Thanks for sharing this. Seems AWS made .NET developers life easier. On the same note, would you be able to explain the difference betwen LambdaEventSource.HttpApi and LambdaEventSource.RestApi? Cheers
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
We're choosing between the type of API Gateway that will send requests to the lambda: docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html - RestApi = API Gateway REST API - HttpApi = API Gateway HTTP API
@edwang4810
@edwang4810 10 күн бұрын
Is it possible to run console app on lambda?
@MilanJovanovicTech
@MilanJovanovicTech 10 күн бұрын
Yes it should be
@pilotboba
@pilotboba 6 ай бұрын
I know it's a demo... but most of the work to configure stuff in AWS should be done with cloud formation, the aws cloud dev kit or terraform. Also, I would expect DynamoDb would be much less expensive for this application than Postgress. It's basically just key/value. Also, some caching will help keep costs down, perhaps with cloudfare. You can do a lot with the cloudflare free level. Since once you have a sort URL it's not going to change and can be cached almost forever.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
| but most of the work to configure stuff in AWS should be done with cloud formation, the aws cloud dev kit or terraform. That's assuming you have AWS experience, know how to setup the infrastructure, etc. In most companies that will be done by a dedicated DevOps role. So it's though to expect from people new to AWS to know how to set all that up from scratch. But I see the video is giving you some nice ideas. URL shorteners are fun for system design exercises, as you can touch on important concepts.
@comroec
@comroec 6 ай бұрын
How to generate the report with Blazor? pls (crystal or any)
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
What report?
@comroec
@comroec 6 ай бұрын
@@MilanJovanovicTech SAP Crystal Reports
@pilotboba
@pilotboba 6 ай бұрын
Not sure what this video has to do with generating reports. If you want to consult with Milan I bet he would be happy to give you a quote. :)
@comroec
@comroec 6 ай бұрын
​@@pilotboba I need a sample Blazer project with a report generate. pls
@antonmartyniuk
@antonmartyniuk 6 ай бұрын
Nice video!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Thanks!
@ahmadshoib8957
@ahmadshoib8957 6 ай бұрын
​@@MilanJovanovicTech1:29 1:32 1:32
@kennethkenn3414
@kennethkenn3414 4 ай бұрын
I'm afraid you over-simplified the actual steps in your video. In reality this is not the case in that i could not get past "Enter Function Name:" using the cli. I already have my .Net8 c# minimal api which connects to Dynamodb via the brilliant PocoDynamo ORM. The database has data and the minimal api works perfectly in Swagger. I've been on this for a week now - and the cli route seems to be the simplest way to deploy your minimal api to aws. And i'm still encountering problems ...
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
Try it with AWS Toolkit from Visual Studio. Get it working the manual way.
Exceptions Are Extremely Expensive… Do This Instead
17:15
Milan Jovanović
Рет қаралды 50 М.
.NET Project Setup From Scratch Using These 6 Best Practices
16:07
Milan Jovanović
Рет қаралды 15 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Easily Deploy a .NET Application to AWS Elastic Beanstalk
16:32
Milan Jovanović
Рет қаралды 33 М.
AWS Lambda function - Beginner to Advanced
45:58
LoveToCode
Рет қаралды 17 М.
AWS Lambda on .NET 8 | Getting Started | AWS LAMBDA SERIES
18:26
Easy Email Verification in .NET: FluentEmail + Papercut
19:29
Milan Jovanović
Рет қаралды 11 М.
The Simplest Vertical Slice Architecture With .NET 8
13:04
Milan Jovanović
Рет қаралды 26 М.
Secure Your .NET API in 15 Minutes: JWT Authentication Tutorial
15:05
Milan Jovanović
Рет қаралды 28 М.
Deploying  .NET Web API to Amazon ECS Fargate Easily!
15:52
Mukesh Murugan
Рет қаралды 2,2 М.
Completely Get Rid of Exceptions Using This Technique
19:24
Milan Jovanović
Рет қаралды 27 М.
A Step-by-Step Guide for the Cache-Aside Pattern + Stampede Protection
19:29
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН