Review patterns for scaling data for networks, files, and data for a serverless web application.
- [Instructor] We're now going to look at scaling in terms of entire applications. We're gonna look at some patterns of common applications. The first one, from a business case, is what's called the static website. So, what we're looking at here is a set of services, and we can accomplish this entirely serverlessly and there's very good business case to do this in terms of the scalability to host this static content. So, in this particular case, for compute, we're going to use one or more lambdas. For scalability, we need to make sure that we've set the lambdas up in terms of configuration.
So, the memory size and the time op values. And because it's typical when you're using lambdas to have rapid deployment, and to add new features very frequently, redeploy the lambdas 'cause it's very easy, we wanna have version management. So, it's very, very important that we have an automated deployment process, which includes configuration. In terms of files, we'd work with S3. We may not need to do anything, depending on where the customers were for this. If we needed lower latency because we were making changes on a regular basis to this static set of resources, we might wanna use cross-region bucket replication.
But probably we would just use S3. That would be sufficient. We really wouldn't have to worry about scalability. In terms of data, this solution is using DynamoDB. DynamoDB has some relatively new features that we might wanna look at for scalability. We have the ability to do table backup, and we can set the frequency of that. And, of course, we would then wanna work with auto-scaling for DynamoDB. Now, if this was a really small-scaled website, we may just wanna turn on auto-scaling and set an alarm so that we would be notified if scaling reached a certain threshold, just to control, really, more costs than anything else.
If this was a larger scaled website, we may want to have more control over DynamoDB scaling and we may wanna set scaling based on one or more metrics in DynamoDB itself. And then the other piece of this architecture is to use the API gateway. As with lambda, it would be very critical to have proper service configuration. So, a couple of things to notice in terms of the scalability of this solution, there is no VPC. All of these services work without needing to have VPC boundaries, and the security is handled by Amazon, so long as you have properly set up the IM roles.
And I cannot really emphasize this enough. Again, this is something that I see done incorrectly, kind of a laxness, around IM roles. It's very, very important in the emerging serverless architectures. When you do not have the protection of VPCs and other security groups, and so on and so forth, that you practice the principle of least privilege when you are setting up the IM roles. Notice there's no redundant virtual servers or load balancers, so less work for you to do. Really, I call it redirected work.
Whereas in the past, you might have been protecting your resources with these software firewalls, if you will, with the security groups and the subnets and so on and so forth, now the expertise needs to be applied to granularity of IM roles and policies. So, to summarize, in the serverless scenario, service configuration is key. And capturing that, and storing that in source control, is a critical part of proper scalability.
- Scalability in AWS application design
- Scaling serverless vs. server-based applications
- Scaling files
- Storage design approaches
- Design approaches to scaling data and data storage
- Scaling SQL queries
- Understanding Data Migration Service
- Scaling applications