If you let lambda explode crazy and say its good to be infinite for you* writing a bad code then your billing will be in billions. I'm happy to have my server crazy than to bear the risk of huge unexpected billing that comes out from no where. EC2 is enough for smaller applications.
A REAL A+++ CONTENT. This is one of the best videos on TH-cam explaining the tradeoffs of using serverless vs dedicated servers. Something that can be of a great value for both technical and non-technical individuals when needed. This is the type of content that helps developers (especially the beginner ones) to advance their career, by providing a deeper understanding of crucial details that will ultimately assist them in making important and critical technical decisions down the line.
Great Content! Just one thing which I didn't understand. At 9:50, you are saying "You tried to open a lot of files", how does it make sense to open a lot of files in a serverless environment?
quite helpful, i was confused to where to launch my saas project and as confused with lambda and costing guess i would go with ec2 only or will check something other cheap for now!
As i have learned cloud and preety active on aws re post i have analysed that even though lambda is a good/cheap service for those individual or organisations which are small scale does not have that much invocations and complexity in their products and do not want any headache of downtime or managing instances and vms . Lambda is basically designed for the cost saving purpose of these kind Whereas EC2 , it is service particularly designed for scalable and complex applications , even though in some scenarios like complex website or task ec2 saves the cost as it using particular computing power and not using its 100% . Recently Amazon prime also shifted from serverless to EC2 and ECS to save their cost and scale their platform So no one can ec2 is better than lambda or lambda is better than ec2 both have thier own pros and cons also purposes for which they are designed for
Can you please keep it a little simple I have just started and it is overwhelming to watch your videos. Please elaborate some tech words/concept a little more. Thanks
Great explanation. I was just having a question. Can't, we solve the factors like Monitoring, Versioning, Zero down time Deployment, HA using k8s and helm with one ec2 instance being one pod ?
lets say i have scheduler service where user can give date and time and my service will try to send mail on that day and time, implementing this kind of feature is hard in serverless but at the same time i dont want to make ec2 instance and run cron jobs to make sure user gets the mail because my compute is just getting wasted and what if i dont have any scheduled mail i am just wasting resource for nothing how does someone solve this kind of problem
if it's not a strictly time sensitive task (for example it's okay for it to be delayed 1 minute), you can attach event bridge to lambda to make it a cron and run once every minute and let it check if there is any pending work from a database table. when you don't have any scheduled emails for lambda you'll probably spend less than 10-20ms (effectively just a db call) so you won't spend much.
I mean the thing is i have a turborepo and i will have to deploy each servcie individually to aws lambda but on ec2 i can simply run the whole turborepo as a monolith .
What are the edge cases from an engineering point of view where we have to - have to, move from serverless to serverfull or the other way round, irrespective of the cost but just from an engineering perspective ?
Just a suggestion for you, don’t switch from dark theme to light theme it seriously hurt my head, please and if you can please use Dark theme everywhere
out of curiosity but any specific tool that you use at codedamn for calculating billing alerts or getting triggers or warnings when a certain aws threshold is crossed like in case when you get a lot of unexpected/unwanted requests ?
Can you please make more video on coding motivation for mehul mohan hindi channel, because after sometime maybe after 4 to 5 days of coding for myself project. I got lost and don't know what to do... how can I code for long a period of time... I really want to get a job in a good tech company but i know i have to work hard.
If you let lambda explode crazy and say its good to be infinite for you* writing a bad code then your billing will be in billions. I'm happy to have my server crazy than to bear the risk of huge unexpected billing that comes out from no where. EC2 is enough for smaller applications.
A REAL A+++ CONTENT.
This is one of the best videos on TH-cam explaining the tradeoffs of using serverless vs dedicated servers. Something that can be of a great value for both technical and non-technical individuals when needed.
This is the type of content that helps developers (especially the beginner ones) to advance their career, by providing a deeper understanding of crucial details that will ultimately assist them in making important and critical technical decisions down the line.
💯
Theo also made a video on this. Both of these videos are great.
@@Lalit-yw2tb Both are so knowledgeable, but sometimes I don't trust Theo's intentions that much.
watching this and now will act cool in meeting once I start throwing this. Thanks lol
love the content that you are making for the past 15 days, don't let the low view count stop these amazing videos!
This is the content we want keep going
Another option - Use Fargate with auto scaling - best of both worlds
Yeah everyone just forgets that ECS and Fargate exist.
Is it like flyio?
Thank you very much for explaining this topic. This helped me a lot Mehul 👍🏻
Great Content!
Just one thing which I didn't understand. At 9:50, you are saying "You tried to open a lot of files", how does it make sense to open a lot of files in a serverless environment?
When we have auto scaling group. Why do we need k8s?
quite helpful, i was confused to where to launch my saas project and as confused with lambda and costing guess i would go with ec2 only or will check something other cheap for now!
Why not then Fargate ?
As i have learned cloud and preety active on aws re post i have analysed that even though lambda is a good/cheap service for those individual or organisations which are small scale does not have that much invocations and complexity in their products and do not want any headache of downtime or managing instances and vms . Lambda is basically designed for the cost saving purpose of these kind
Whereas EC2 , it is service particularly designed for scalable and complex applications , even though in some scenarios like complex website or task ec2 saves the cost as it using particular computing power and not using its 100% .
Recently Amazon prime also shifted from serverless to EC2 and ECS to save their cost and scale their platform
So no one can ec2 is better than lambda or lambda is better than ec2 both have thier own pros and cons also purposes for which they are designed for
You can use EBS and not worry about maintaining the server.
haha had the same doubt yesterday while watching the video. thanks for this
Smart guy Mehul selling shovels
Great explanation!
I also made similar comments and here we go a new video😂
Can you please keep it a little simple I have just started and it is overwhelming to watch your videos. Please elaborate some tech words/concept a little more. Thanks
bro, learn things then come here. why would you want a degraded content?
You can follow beginner friendly channels and you can always come back and watch this channel
can you please tell me which software you used for drawing these diagrams?
I need this video thanks
Another quality content 👏
Basically it's cost of lambda vs cost of engineering
Great explanation.
I was just having a question.
Can't, we solve the factors like Monitoring, Versioning, Zero down time Deployment, HA using k8s and helm with one ec2 instance being one pod ?
please complete Codedamn DevOps learning path,few courses are missing...........
Does edge deployments also fall under these serverless category??
lets say i have scheduler service where user can give date and time and my service will try to send mail on that day and time, implementing this kind of feature is hard in serverless but at the same time i dont want to make ec2 instance and run cron jobs to make sure user gets the mail because my compute is just getting wasted and what if i dont have any scheduled mail i am just wasting resource for nothing how does someone solve this kind of problem
if it's not a strictly time sensitive task (for example it's okay for it to be delayed 1 minute), you can attach event bridge to lambda to make it a cron and run once every minute and let it check if there is any pending work from a database table.
when you don't have any scheduled emails for lambda you'll probably spend less than 10-20ms (effectively just a db call) so you won't spend much.
@@codedamn i implemented this solution and cron is running every 2 mins but i was thinking of optimizing it, anyways cool video
What is the software that is being used for the note taking and illustrations
tldraw
@@codedamn Thanks. Really good content, keep em coming.
So it will be decided by devs or devops team to use lambda or ec2
Devops and devs
Can we get a video on EC2 vs baremetal (my own hardware and i got a beefy PC) regarding what should be my choice as a new buisness?
Try to stick to AWS or any other provider until you know exactly how to build a server and manage security!
@@aryanshmahato Thanks for the clarity! Building a server isnt gonna be a problem. Security will be. Thanks for the insight
I mean the thing is i have a turborepo and i will have to deploy each servcie individually to aws lambda but on ec2 i can simply run the whole turborepo as a monolith .
Love it !
What are the edge cases from an engineering point of view where we have to - have to, move from serverless to serverfull or the other way round, irrespective of the cost but just from an engineering perspective ?
Just a suggestion for you, don’t switch from dark theme to light theme it seriously hurt my head, please and if you can please use Dark theme everywhere
What about DDOS attacks? Does lambda handle it automatically? coz in EC2, we have to handle it manually
You can use the API gateway to route your request through for both lambas and EC2 and use inbuilt rate limiter to mitigate ddos risk.
out of curiosity but any specific tool that you use at codedamn for calculating billing alerts or getting triggers or warnings when a certain aws threshold is crossed like in case when you get a lot of unexpected/unwanted requests ?
we use aws billing alerts (inbuilt), for some abuse requests we have custom infra for detecting and mitigation
Power cord got disconnected 🤣🤣
⚠️⚠️ please make a video on “why didn't you use serverless database?”
many people on twitter are talking about self hosting with a vps instead of vercel for next js, whats that about? is it only for cost cutting ?
Vercel is the perfect platform to host NextJs application (Next js), if you can invest $20-30/month
Can you please make more video on coding motivation for mehul mohan hindi channel, because after sometime maybe after 4 to 5 days of coding for myself project. I got lost and don't know what to do... how can I code for long a period of time... I really want to get a job in a good tech company but i know i have to work hard.
informative
This video is good... but did you forget misuse of lambda that blows out your costs and bankrupts your lean startup while you were sleeping ?
yeah, you can put good rate limits + waf in front of it (via aws or cloudflare)
Only benefit of server over serverless is that I can sleep peacefully thinking that I will not receive 1,00,000$ bill tomorrow. 😊
You can set limits so this is not an issue in real life.
@@ikboI use vercel.. if you know how to set it in vercel(it is built on top of AWS)..let me know it would be helpful
better option: ECR -> ECS
are you not using mongodb atlas anymore?
dropped it last year
Unpopular opinion: Use Neither
Hetzner is a very very bad service. Never ever deploy anything production. Also, goodluck getting verified :)