profile

ESPRESSO FRIDAYS

Getting More from AWS Without Breaking the Bank

Published 2 months ago • 3 min read

Hi friends,

AWS is sometimes looked at as a money black hole where you’ll burn your cash the second you sign up. In a way, that’s not wrong.

Interestingly, there's also a group of people who dive right in and only realize the expenses when they see their monthly bill.

It doesn’t have to be this way

AWS can be used at no cost, or if not entirely free, then for minimal expenses.

Stating the obvious

When you join, AWS enrolls you in their free tier, allowing you to use certain databases, compute instances, and other services at no cost.

However, this free tier only lasts for 12 months; after that, charges begin.

While a free tier that ends might seem like a lure, it's a common practice.
Yet, with AWS, you might find yourself heavily reliant on these services, making it hard to simply stop using them.

Today, I'll focus on AWS's lesser-known "always free" offerings, which could enable truly cost-free production deployments for various projects.

Push the erverless boundaries

If you start with a serverless approach, you'll likely run mostly for free, and I stand by this. However, I must mention the risks involved.

My strong opinion is that serverless doesn't scale in terms of costs and hidden fees as many people expect. More on that here.

“You get 1 million free requests per month and 400,000 GB-seconds of compute time per month indefinitely.”

1 million free requests per month can support many side projects, and even many initial staging or production environments. Take advantage of this offer.

There are numerous excellent frameworks available to help you do so; one that I particularly recommend is SST.

It’s a serverless framework for building serverless applications, that takes infrastructure and decisions around it very seriously.

S3 is cheap, but it’s rarly a must

The Free Tier for Amazon S3 is only for the first 12 months.

Everybody loves S3, it’s easy to use, it’s robust and has been around forever (literally the first service ever offered by AWS!).

However, while S3 isn’t especially expensive, it can get out of hand, and it’s not free past the first 12 months. There are multiple tiers offered by AWS which you most likely should use unless you feel 11 9’s after the decimal dot of 99% uptime is for you.

More often than not, small projects don’t actually need S3.
They use it because it’s there, and it’s easy.


The ultimate discount machine: Spot Instances

Spot Instances are a way to use unused computing power on AWS. They come in a lower price than usual, but they can be taken back by Amazon at any time if someone else needs them or is willing to pay more.

It’s like renting a video game for a cheaper price because the store has too many copies, but you have to return it suddenly if more people want to rent it.

You can get away with 90% off the on-demand price if you’re willing to take the relatively small risk. And, if you know what you’re doing, things like auto scaling groups will revive the workload anyway.

But wait, it gets better

ECS (Elastic Container Service) is a service that allows you to run and manage groups of tasks or services using containers.

Combined with Fargate, it lets you scale up and down without having to manage the underlying servers yourself. Essentially, it’s like a serverless container solution.

You can mix the two (Fargate and Spot) and configure ECS to run the underlying servers for you, but on spot instances.

And this, creates a perfect combo: enjoying containers, while running them on a serverless platform, all while using spot instances for discounts!

Databases don’t have to break the bank either

If I were deploying a a stateful application today I’d probable do one of two things:

1. I’d use an on-disk SQLite DB and make sure it sits on a detachable EBS volume that’s snapshotted and can be recovered

2. I’d use a service with free tier like PlanetScale or Neon which I’ve userd in the past for free and loved.

AWS will offer a free tier RDS but as with other services, after 12 months you start paying.

DynamoDB offers a generous, indefinite free tier: 25 GB of storage, and 25 units each of read and write capacity.

However, remember that Dynamo uses a unique API, making data migration harder than moving Postgres data. For a side project, this might be less concerning, but it's important to consider all factors.

Don’t forget the marketplace

AWS provides a marketplace for no-longer-needed compute resources. For instance, if you're locked into a three-year server contract but only need it for 12 months, you can offer the remaining time to other AWS users via the marketplace.

Over the years companies started to take advantage of this feature, and AWS recently responded with limiting the usage for accounts.

But again, for solo users, this can be a big deal and a money saver.


These are the basics, and I'm working on an entire new section called “Advanced Mode” which I’ll share in the future.

As always, feel free to respond if you have feedback or questions.

Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

Focus is a huge problem in modern days. These days, lots of apps and websites try to grab our attention and keep us hooked. Most of us know we should resist these distractions. But instead of making a plan, many people just wing it. I used to do that too. But I’ve had enough. Another Instagram post, YouTube short, or funny meme won’t make me feel good about my day. In fact, they: Make my workday longer. Slow down my progress, bit by bit. So, I put together some tools and rules to help me stay...

5 days ago • 3 min read

Hi friends, On July 15th, 2019, I messed up bad. Real bad. I wanted to finish a project quickly, and show a quick POC to a customer I was working with. To make a long story short, I pushed a container, to a public repo, containing admin credentials to an AWS account. I thought of myself as a senior consultant, who delivers, fast, with no mistakes. Man I managed to break that reputation. The silver-lining however, is that I learned my lesson. So deeply so, that I’ve implemented these same...

11 days ago • 3 min read

Hi friends, Today we’re going to explore a lesser-known but incredibly powerful feature of Git: git rerere. This feature is particularly useful for anyone who frequently manages branches and encounters merge conflicts. * not a real magician What is git rerere? The git rerere feature stands for “reuse recorded resolution.” It helps to automate the resolution of merge conflicts by remembering how you’ve resolved them in the past. When enabled, git rerere kicks in as soon as a conflict occurs...

19 days ago • 2 min read
Share this post