Benjamin Lannon

Select a theme. Click on the overlay or the button again to exit

AWS Services & Pricing Spectrums

Posted on:

Let's start with $50 USD. If you wanted to start building applications and projects on AWS, the spectrum widely varies in terms of how far that will get you. From my years of usage of AWS, I have heard the phrase "oh, AWS is too expensive", and in particular use cases it can be. As a platform it offers a vast variety of services and in particular many ways to do single things. Want to run a Docker Container? You have ECS to spin up services, do some compute, and then spin it down when you're done. Or how about EKS to run a kubernetes Cluster for long running services? Another scenario is storing data. You could go with a traditional relational database like Postgres or MySQL using RDS, or you could store data as flat files in S3. Or you can go the approach of NoSQL with Dynamo.

Through all of these scenarios, a pattern I see arises, managed services vs platforms for bring-your-own solutions. Tools like EKS, RDS, EC2, among others, are fairly lightly coupled into the AWS ecosystem. Say you are moving your postgres database from on-prem to AWS. Well, RDS handles running those databases fairly closely but you don't have to manage much of the underlying database itself. That said, it is still a continuous 24/7 running service that needs to exist somewhere. This is even further apparent with a service like EC2 where you're running VMs and putting applications onto likely either Linux or Windows systems. With all of these, due to the fact that there is a light coupling to AWS and their offerings, and due to that 24/7 uptime, the costs are fairly high. Take a t4g.nano VM, it will cost you approximately $4.00 a month if you leave it on 24/7. There are ways you could reduce that to say only run it during working hours, or shut it off during the weekend, but dependent on the services running on that box, you may never want to shut it off. RDS with the cheapest box to run a postgres instance ends up around $11.50 a month. If you're a buisness bringing in revenue, these numbers don't look too large, but for a hobbyist developer wanting to run services, you may not have wiggle room in your monthly budget to fit in those prices. And this is where the other side of the spectrum comes in: AWS managed services.

AWS is known for their offerings and push of event-driven architectures. When an image is saved to a S3 bucket, you could trigger a lambda function to do some analysis on the image, create thumbnails or optimized copies of the image for different devices, among dozens of other things I could implement. It is a paradigm shift of rather than focusing on where my code is deployed to and make sure those systems are reliable, I can just focus on the code itself, and even more, the logic for generating applications. No more am I running services 24/7 or managing VMs. The term serverless comes into play here where a developers focus is no longer on the servers, but the logic of what is going to run (on servers that you don't need to worry about).

With all of this, pricing scales from billing by the hour all the way down to the millisecond. Lambda has been a big push for this as of the past few years it went from charging per 100ms down to 1ms. And with that the aggregated cost at the end of the month is much lower than traditional VMs. If you have lower traffic one day, you aren't billed for idling servers. As well going the opposite way of scaling, horizontal scaling on managed services like Lambda or DynamoDB are much more cost effective. This isn't to discount that services like EC2 have autoscaling capabilites as well, but now you may have to account for that in your applications where in an event-based architecture, it is a much less of a concern. As well with databases, the old way of handling load was horizontal and vertical scaling, or deploying more instances of a database and giving it more CPU & memory. A service like Dynamo on the other hand based on the sharding of data by primary key switches the paradigm again where you will be billed based on reads and writes rather than CPU or memory usage.

So out of all of this, the deeper you get ingrained with AWS and their own services rather than a Bring-your-own-X system, the pricing does tend to become more approachable. For many of my personal projects where I am running lambda functions on a schedule, saving to a database, and then doing analysis or aggregating that data into a website, the costs at my scale are barely pennies. I could spin up a $4.00 EC2 VM and likely write similar capabilites, but the time of me managing linux VMs isn't a priority anymore compared to what I want to do of building applications. And because my goals for many of these projects aren't to make money and I'm not getting any revenue from them, the reduced prices gives me the scalability and reliability of AWS without a giant bill on my doorstep at the end of the day.