Hackernoon logoSmaller, Faster, and Cheaper Coding Laptops via AWS by@Owen

Smaller, Faster, and Cheaper Coding Laptops via AWS

Owen Collier-Ridge Hacker Noon profile picture

@OwenOwen Collier-Ridge

Owen loves coding and writing about coding. Check out his course on APIs https://gum.co/learnapi

My Coding Laptop is Smaller, Faster, and Cheaper than Yours and it lives in an AWS Data Center!

I use an ephemeral AWS EC2 instance for development. It costs me less than $10 a year.

I have a desktop and smartphone. Getting a MacBook just for coding felt like overkill.

Architecture

Check out the code for this solution.

The secret sauce is a CPU Alarm that shuts the instance down if you aren't using it.

Cost

EBS-$0.10 / GB month

EC2-$0.0104 / hour

Cost was a big consideration for me when designing and using this system. This solution is free under AWS Free Tier, but that doesn't last forever.

As seen below, if you terminate your instance when you are done using it, you'll run a little over $0.01 an hour. It'll run you $0.46 a week at 40 hours a week, $1.84 a month, and $22.10 a year, all assuming you are running the instance for 40 hours a week.

# A month has ~720 Hours
>>> hourly_ebs_cost = 8*0.10/720
>>> hourly_ebs_cost
0.0011111111111111111
>>> hourly_instance_cost = 0.0104
>>> total_hourly_cost = hourly_instance_cost + hourly_ebs_cost
>>> total_hourly_cost
0.01151111111111111111
# 1.15 ¢ hourly cost
>>> weekly_cost = total_hourly_cost * 40
>>> weekly_cost
0.46044444444444443
# At 40 hours a week, you'd spend $0.46
>>> monthly_cost = weekly_cost * 4
>>> monthly_cost
1.8417777777777777
# A month's usage at 40 hours a week, $1.84
>>> yearly_cost = monthly_cost * 12
>>> yearly_cost
22.101333333333333
# A year's usage at 40 hours a week, $22.10

Portability

I use a free version of [Terminus](https://terminus.com/) on all my devices. I can't recommend Terminus enough, it is a fantastic product.

Using cloud computing also lets me centralize all my secrets. I don't need to make a new IAM User or API Keys for myself when I get a new machine.

Experimenting

Treating my development machines as Cattle instead of Pets lets me experiment freely.

I never have to worry about breaking my python environment.

AMD64 vs ARM64

This tweet brought up an interesting point, with new Mac Laptops running on ARM CPUs, local testing becomes more complicated.

Using cloud machines for local development could help alleviate this issue.

Owen Collier-Ridge Hacker Noon profile picture
by Owen Collier-Ridge @Owen. Owen loves coding and writing about coding. Check out his course on APIs https://gum.co/learnapiCheck out my new course!

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.