Introduction to Backend Architectures

Serverless Use Cases

Erik Reinert

Erik Reinert

TheAltF4Stream
Introduction to Backend Architectures

Check out a free preview of the full Introduction to Backend Architectures course

The "Serverless Use Cases" Lesson is part of the full, Introduction to Backend Architectures course featured in this preview video. Here's what you'd learn in this lesson:

Erik provides various use cases for serverless computing including real-time file processing, ETL (Extract, Transform, Load) processes, and serving static websites. He emphasizes the cost-effectiveness and ease of management that serverless offers for these use cases.

Preview
Close

Transcript from the "Serverless Use Cases" Lesson

[00:00:00]
>> Erik Reinert: So let's talk about the use cases for serverless, real-time file processing. So as soon as the file is uploaded in S3, AWS Lambda can trigger a function to process it. This is really awesome for being able to do things like post processing files, making changes to files, checking files, validation, stuff like that.

[00:00:18]
It allows you to say, okay, we'll hear from my one little function, I don't have to create a whole service, I don't have to figure out how that service listens for changes, it's just integrated into the platform. I can just wait for Amazon to say, file updated, and then I can immediately hop in there and do the thing that I need to with the Lambda.

[00:00:34]
So real-time file processing is really powerful with Lambdas and functions as a service. Mostly because a lot of these cloud providers like Amazon, like Google, have integrations with these services in other places. And this can even be queues, distributed queues can have Lambdas hooked up to them so that you can have a queue, drop a payload to a Lambda worker.

[00:00:58]
And then you only process that one thing and that's when we start talking about like how do things communicate between each other. That's how Lambdas could potentially communicate with each other by using queues and stuff like that. Real-time stream processing as well, so perform real time analytics on data streams using Kinesis.

[00:01:18]
Things like Kinesis allow you to do real-time stream processing, and so using functions as a service can make it so that you can handle this in real-time and then this function just disappears, right? And this happens per request. And this can be any time of real-time stream processing.

[00:01:35]
This can be video, this can be audio, this can be text, this can be machine learning. It really just depends on what you wanna shove in that function and let it run for the period it does before it's done. So real-time stream processing is really nice with functions as a service as well.

[00:01:52]
Who here knows what ETL is?
>> Speaker 2: Extract, transform, load.
>> Erik Reinert: Yep, exactly, yeah. So ETL is really around like data manipulation and things like that. It's not as common as it used to be. But there are companies like my company, for example, that still deal with ETL especially with datasets and being able to process data properly.

[00:02:16]
You can extract that data, you can transform it and then you can reload it. So for example, to perform an ETL on demand, when a new file is uploaded to S3, AWS can trigger to process that data and then load it into a database, that's what an ETL is effectively.

[00:02:32]
And so, think about every time a piece of data is loaded onto a S3 bucket, having to have a service that's handling that all the time. Or just have a Lambda that triggers literally every time and can scale to the end whenever you need. The management, the cost effectiveness are just way easier than hooking up a service to it.

[00:02:53]
>> Erik Reinert: Finally websites, as I mentioned before with Frontend Masters and a bunch of other websites like Cork. Websites that are purely static, HTML,CSS, JavaScript can be served from S3 directly or other cloud providers, serverless solutions, right? And so again, when you're talking about the costs of running a frontend for your company, serverless does become very interesting, especially if you already fit these requirements.

[00:03:20]
If you're basically taking a flat file, shoving it in a container and putting Nginx in front of it, you should move to serverless, because you're already two steps on the way there. The only reason why you have a container there is just hosting it and Nginx can process, and serverless can handle that for you really easily.

[00:03:40]
As a matter of fact, we do some of this at HIPAA today and I'm already working with teams to try and get us out of that so that we don't have to pay those costs. We might have circumstances where teams wanna use, again, Nextjs and other kind of server side rendering, things like that, HTMX or whatever.

[00:03:58]
But if you're purely static, and you're running that in a container, you should move to serverless. There should really be no reason why you couldn't, unless you've got other requirements or stuff like that.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now