12 ms·
The Free Stack – Running Your Application for Free on AWS
- ameliaquining 8y agoWhat's wrong with using RDS in production? I'd rather do that than build around a vendor-lock-in Amazon offering when not strictly necessary. I'd also rather do that than administer a database myself.
- bootlooped 8y ago"...AWS RDS Sevice. It offers t2.micro for free during the first 12 months. It is fine for development. However, I will not recommend using it in production." I think maybe they were talking specifically about not using the t2.micro instance size in production.
- scanr 8y agoDo you know what the downsides would be of using a t2.micro in production (for a low volume of requests)?
- jrs95 8y agoNothing is "wrong" with it, you just can't feasibly do it for free.
- pagnihotry 8y agoHi ameliaquining, like bootlooped pointed out, I am suggesting to not use t2.micro in production and not RDS.
- Drdrdrq 8y agoHi, thanks for the write-up, very informative! What would be the lowest instance type you would recommend for a similar setup? I have an app I'm thinking of porting to AWS...
- pagnihotry 8y agoC/M should do it for general workloads in production, R/I on RDS. If you are doing something specific, you may have to look closely at the resource bottlenecks on those instances. t2.micro should be fine for development.
- fredley 8y agoTL;DR: Not free, but ~$6/year for the first year, ~$20/year thereafter
- TomMarius 8y agoI think I lose more coins out of my pocket on the street yearly
- amarka 8y agoIf you're loosing $20 worth of coins out of your pocket somewhere on the street on a yearly basis you're either dealing with a hell of a lot more coins than the average person or you're one clumsy individual.
- Scoundreller 8y agoIt depends. US coins larger than 25c are uncommon. But other countries have $1 and $2 coins, with paper bills only starting at $5. Transit tokens in Toronto are tiny and worth $3. I’ve dropped a few because they catch on my phone case edge.
- Tade0 8y agoRecently I thought I've lost a €5 banknote because some toll machines in Italy send cash[0] flying as if they were doing it with contempt. I found it eventually along a €2 coin somebody left there. On my way back I also found a €1 coin and a 50c one. I guess people lose a measurable amount of cash this way. [0] Non-Italian cards don't work on Italian motorways - only cash. Knowledge I acquired through error of my own so now other people don't have to.
- owenversteeg 8y agoHuh. How'd that work then? Did they just fine you or send you a bill later?
- pmiri 8y agoI always enjoy articles like this, but must counterbalance with the vast vast cost saving of working with a stack with which you're familiar.
- cmurf 8y agoIs it generally reliable asking Amazon support what capacity you need for a particular use case, so you're not buying more than needed? e.g. a service that might be used once per day for a minute, and another day it might get used a dozen times for maybe an hour, and only during fixed business hours. And there are general purpose, compute optimized, storage optimized, etc. But what if the service is more network latency sensitive than either storage or compute sensitive? Or are there 3rd party estimators that do a better job of telling you what kind of instance to get? Or just pick a general purpose instance, run it for a week, and then tweak it?
- lazharichir 8y agoI am on GCP but I usually request/allocate more and once in production for a few weeks, I can turn some things down and others up. That is if your product/setup is new and you aren't sure how everything will interact once live (in terms of perf). Otherwise, for Lambda there is on Github a repo with a script that will publish your code in every configuration possible, run stress tests, and only keep the most optimum (perf/cost).
- pagnihotry 8y agoI think you will have to buy premium support https://aws.amazon.com/premiumsupport/ https://aws.amazon.com/premiumsupport/ or spin up an instance around what usage you expect and then analyze your bottlenecks to swap it later on.
- michaelt 8y ago
- fpgaminer 8y agoThat's a rather misleading title. More like, Running Your Application for Free on AWS for the first 12 months (and then $20/mo after...) I'm obsessive about optimizing cost on cloud platforms. I tend to make many, small hobby/experimental/etc projects. So I've long needed to find every way I can to ensure the costs for these projects remains small. $20/month is fine for a single project, but 20 projects? Yeah... I know a lot people just look at cloud service pricing from the perspective of a startup. But I can't be the only one who uses cloud services for small, hobby/experimental/etc projects. So perhaps my insights will be helpful. TL;DR: Use Google Cloud. App Engine Standard if you can. When it comes to cost at small and medium scale, it's _really_ hard to beat Google Cloud. Check their Always Free tier: https://cloud.google.com/free/ https://cloud.google.com/free/ That'll cover pretty much everything you need for small scale projects. You can grab a tiny VM, some Storage, some Datastore, all for the low, low price of $0/mo "forever". On top of that I've found their service pricing to either be on-par with AWS, cheaper, or if it isn't cheaper it's more granular than AWS so your off-the-lot prices end up cheaper anyway. For example AWS's managed NoSQL service requires you to allocate processing bandwidth up-front, which means there is a minimum cost no matter how little you use. Gcloud's is just charged based on usage. Don't use it? It's free. Azure is interesting and has _some_ always free tier like Google Cloud. Their prices have come down a _lot_ in the past few years. They're worth a look if you haven't checked in awhile. But they're still up-and-coming in a lot of ways. E.g. their Container Registry is charged by how much disk you've allocated, rather than how much you've used. GCloud CR charges based only on usage, and gets roped into your Storage usage so it's part of the Always Free tier. Gcloud's App Engine Standard Environment is a _beast_ for cost optimization. If you can fit your project into an App Engine + Datastore shaped hole, your project will absolutely, no strings attached, cost _nothing_ at the small scale. And when your project suddenly gets rocket fuel, it'll scale automatically with no effort on your part at reasonable cost. (Do not even look at Flexible Environment. Its pricing is ludicrous.) The BIG CAVEAT to Google Cloud is the usual Google failings. Their services tend to be unreliable (not the case for App Engine), their customer support is atrocious, their automated systems may randomly ban you and nuke your projects, and they may increase service pricing 25x with short notice when you least expect it. I can't emphasize those caveats enough. Tread carefully. I'm sure others will chime in with their horror stories for AWS/Azure/etc. But Gcloud comes up on the HN news feed more often than the other cloud providers for a reason. (This is all for people who want general cloud infrastructure. If you just need servers, there's of course the usual Vultr, et. al. with just low cost VMs.) EDIT: For reference, I'm currently running some 12 or so small, personal projects in Gcloud right now. Some are "dead" projects, others are actively used by myself, and a rare few are used actively by a small user base. My monthly costs for all those projects is currently ~$1/mo all-in. A lot of that stuff lives on App Engine, which means I've had to do no maintenance on them in ... well some of them have been their for _years_ now without me touching them. One of my previous companies transitioned from AWS to Gcloud for cost reasons. That move cut the cloud expenses down to 25% of what they were, and also enabled us to add new features (because it was not possible to deploy them to AWS without it costing absurd amounts of money). But I'll also note that the transition was incredibly painful due to Gcloud's various failings [luckily foisted on one of my new hire's who enjoyed the learning experience].
- mhfs 8y agoWith all costs that goes into building a business (directly in $ or indirectly in hours) is it worth going down the path of saving money to this degree? Setup heroku in <1 hour for <$100/month, forget about hosting and go build your product. If $100/month breaks you, I think you’re in the wrong path anyways.
- RussianCow 8y agoYou're discounting hobby projects or small side businesses that don't generate a lot of revenue. For those, much more than a few bucks a month may be a deal-breaker.
- scarface74 8y agoI've been called a mercenary before, but the only reason I spend time working on software development "hobby projects" is with the sole aim of learning new skills that will make me more money on my job/contract work or at least keep me up to date with my skills. For that reason alone, I use AWS for side projects. Companies pay well for "AWS Architects". If I want to do a hobby project and save money, I could just as easily set up my own server and use my own gigabit home internet.
- nzoschke 8y agoYou can set up a FaaS app just as fast as Heroku. I find it even more efficient, since Go, AWS SAM and Lambda offers dev/build/prod simplicity that Heroku never figured out. I open sourced and documented the stack that I use instead of Heroku here: https://github.com/nzoschke/gofaas https://github.com/nzoschke/gofaas
- malchow 8y agoI read this, and I think: wow, that's extraordinarily expensive. The stack he designs is $20/mo for 1,000 user sessions/day. Back in the days of cPanel/LAMP shared hosting, you'd have similar capability for $5/mo.
- anothergoogler 8y agoWith a basic DO droplet, you can still do that for $5/month, and hey, if it takes off your app won't depend on a bunch of expensive proprietary software. Also I'm guessing that if cost is a concern, denial of service is preferable to blowing the bank under unanticipated high loads. Maybe I need to drink more AWS/GCP kool-aid though and see the light.
- evv 8y agoRecently I've been fascinated at gap between server providers these days. It seems each provider is either: - Enterprise public cloud, AWS/GCP/Azure, expensive but scalable and enterprise friendly - Developer public cloud, Linode/DO, cheap and easy to use Although I say that AWS/GCP/etc are expensive, they obviously have negotiable prices for large customers. I doubt the smaller providers do that. But it makes me wonder why people use AWS/GCP when the other providers are so much cheaper. How do Linode/DO offer such good prices? Would they kick me off if I actually maximized the server capacity they offer, like a shared cPanel host would do, back in the day?
- swebs 8y agoI wouldn't consider VPS providers part of "the cloud". You simply rent a (virtual) server. With AWS and the like, you pay for their automation of services. You don't need to manually deploy load balancing, CDNs, DDoS mitigation, security hardening, and the like. The big pitch is that you're paying a bit more in order to phase out your IT team.
- falcor84 8y ago> The big pitch is that you're paying a bit more in order to phase out your IT team. Really? I have to say I don't understand it. I remember the "NoOps" movement from a few years ago and I just find the whole concept around it to be almost hilarious; kind of like Salesforce's old "No Software" logo (which is nowhere to be found in their newer marketing). As I see it, as long as your organization has people using IT in any capacity at all, you will need someone in charge of IT Operations. Whatever you may want to call it: DevOps, or SRE, or PE, or even if you just decide it's something that each of your regular devs is going to be doing, it's a function that needs to be done. Someone needs to be able to set up the systems, monitor them, scale them, secure them, and troubleshoot issues. It doesn't matter how well-engineered and maintained and automated the components you rely on are, they will break in various compound fractures and you will need to deal with the downtime and potential corruption to your composite system. I'll eat my hat if you can point me towards a single non-trivial software service that has been running continuously without any "IT".
- zoidb 8y agoThere are a lot of naysaying in the comments but I think it's a nice write-up and if you are interested in doing something like this I can say for sure it is possible based on my own experience. One of my side projects, https://cmdchallenge.com https://cmdchallenge.com is setup almost identical. Cloudfront / api gateway / dynamodb and is covered a bit in this blog post https://about.cmdchallenge.com/building-cmdchallenge.html https://about.cmdchallenge.com/building-cmdchallenge.html . My last month's AWS bill (not in the free tier anymore) was only $2.23. For the runner that runs arbitrary shell commands I used to run a t2.micro in AWS but when the free tier expired I moved that over to gcp and I'm burning through their credits. I'm also using gitlab ci/cd to periodically renew the docker instance that runs shell commands. It only works because there isn't much traffic obviously, and api requests are not made on every page load.
- Neighbor_ 8y agoI just wanna say, thas an awesome project
- indigodaddy 8y agoWow, just want to say nice work on whatever validation method you are using... # You have a new challenge! # There is a file named "access.log" in the # current directory. Print the contents. # bash(0)> tac access.log | tac 163.56.115.58 - - [09/Jan/2017:22:29:57 +0100] "GET /posts/2/display HTTP/1.0" 200 3240 75.113.188.234 - - [09/Jan/2017:22:30:43 +0100] "GET /posts/foo?appID=xxxx HTTP/1.0" 200 1116 69.16.40.148 - - [09/Jan/2017:22:34:33 +0100] "GET /pages/create HTTP/1.0" 500 3471 225.219.54.140 - - [09/Jan/2017:22:35:30 +0100] "GET /posts/foo?appID=xxxx HTTP/1.0" 500 2477 207.243.19.2 - - [09/Jan/2017:22:38:03 +0100] "GET /bar/create HTTP/1.0" 200 1116 199.37.62.156 - - [09/Jan/2017:22:42:18 +0100] "GET /posts/1/display HTTP/1.0" 200 2477 55.74.240.123 - - [09/Jan/2017:22:44:25 +0100] "POST /posts/1/display HTTP/1.0" 200 3471 251.111.109.143 - - [09/Jan/2017:22:49:02 +0100] "GET /posts/foo?appID=xxxx HTTP/1.0" 200 2477 101.163.230.250 - - [09/Jan/2017:22:52:31 +0100] "DELETE /posts/2/display HTTP/1.0" 404 2477 200.19.168.148 - - [09/Jan/2017:22:57:11 +0100] "GET /posts/foo?appID=xxxx HTTP/1.0" 200 3471 # Correct! # You have a new challenge! # Print the last 5 lines of "access.log".
- Willamin 8y agoThere are ways to actually run your application for free using the big players' free services. One route I've looked at for e-commerce is storing product data on Stripe, hosting product pages with Netlify, pulling product data during static site build, triggering a build when Stripe data gets updated, and using Netlify's wrapper around AWS Lambda for free FaaS (AWS Lambda can be free forever, but you also need AWS API Gateway which isn't free forever). This results in the only fee being a CC fee. I've put together a demo over at libra-shop.org. It definitely still needs some work, but I think most of the important bits are all sorted out. Of course, the biggest issue with using free tiers for your entire stack is that you have no guarantee that the services will be running forever. (eg. Netlify could stop providing a free AWS Lambda connection)
- copperx 8y agoAll of this work and complete dependency on third party services is worth it? Isn't much easier to create a lightweight app in say, Go and SQLite, and pay a so-low-to-be-insignificant monthly fee?
- suff 8y agoI agree. There is a diminishing return on service reliability as you approach 'free', and at some point, you finally pay $9.78/mo and survive anyway.
- Roritharr 8y agoI wonder what amount of money would be sufficient to create the digital equivalent of a foundation to ensure the uptime of a website/project. It would be kinda cool to put away a few grand to ensure something stays up "forever".
- exikyut 8y agoWell, Network Solutions seems(?) to offer 100-year domain registration for $1k ($999). Thinking about it, a holistic solution to this kind of problem would [categorically need to] be extremely expensive in order to ratelimit demand. Because it's not just "host this for me for a while" with an implicit sort of "maybe let it fall over one day and see if I yell at you" - that 2nd bit is completely removed, and the expectation is 100.0% (amortized, aggregate) uptime... indefinitely. It's interesting how not even graves last forever. They decay over time (hundreds of years). Not all are maintained. What sort of "forever" are you talking about? "Most Important Thing™ when the paperclip maximisers take over"?
- skybrian 8y agoI wonder how this compares with App Engine's free tier? That's what I use for hobby projects that I don't want to pay a monthly fee on.
- warrentr 8y agoI do the same but haven't calculated just what the gae free tier would cover in the way the author did
- ibudiallo 8y agoThis is a nice write up. My only concern is that these days we think that the alternative to free is $40 to hundreds of dollars a months for something decent. In the days of shared hosting, you could drop $3 to $5 to host your small website and expect your website to decently perform. But with your DO/Linode, you can expect excellent performance for the same price. Only last month my two $5 droplets handled 5 million web requests from a viral post.
- azeirah 8y agoYou'd have to be doing something really computationally expensive or be running a very large operation to really need something expensive. Simple budget web hosting packages can easily handle tens of thousands of requests per hour for like $4/month.. You're absolutely right.
- cutler 8y agoFor 5 Euros per month a cloud VPS at Hetzner.com. comes with 2 CPUs and 4GB RAM. That's 8 or maybe 16 times the RAM that Facebook probably launched with plus extra CPU and SSD disk speed. All these cobbled-together free tiers may be slightly cheaper but the added complexity I can do without. It just seems like tech for tech's sake.
- SpecialistEMT 8y agoIm running a $5(+$2 for backups) 1GB linode and getting around 50k views a month on a properly configured wordpress with caching and 30 plugins with nginx on Centos 7. Sometimes 25-50 ppl at the same time. Site is pretty fast(faster than most- maybe because lack of a dozen of trackers). With 2GB ram and 1 more core it would be super fast. Im using Centmin mod stackscript for managing nginx.
- codesections 8y agoI think this is the wrong way to go about building a free stack, given the vendor lock-in problem. I use a lot of free services from Netlify, for example, but I'm cautious about relying on anything that I can get only from Netlify. I feel a lot better if I can list 3+ providers who all provide a free tier that meets my needs (even if some aren't quite as present to use). That way, I know I have somewhere else to go if I need to—and I feel better than I won't need to because the provider knows I have other options.
- mariushn 8y agoWhat Netlify alternatives have you prepared? eg Github pages
- Neighbor_ 8y agoHow would this work with a more standard webpage. For example, Laravel (PHP) on the backend with a Relational Database like MySQL?
- pagnihotry 8y agoAWS Lambda does not support PHP. You will need to spin up an EC2 instance for running PHP and another instance in RDS for MySQL. For development, you can spin up t2.micro on EC2 and RDS and pay $0 but pick another instance type when you go live to production.
- simon_weber 8y agoI recently went through this, though with the (arbitrary) goal of running for free indefinitely. This is tougher, since you can't use API Gateway and need to throttle your dynamo operations. SQS ended up being the key to making this work: everything is asynchronous, and the js SDK is used to enqueue messages directly from the frontend. That setup is described in https://www.simonmweber.com/2018/07/09/running-kleroteria-for-free-by-abusing-free-tiers.html https://www.simonmweber.com/2018/07/09/running-kleroteria-fo..., if you're interested.
- NightlyDev 8y agoBad title. It's not free, and after 12 months it's even very expensive compared to alternatives, considering what one gets for the price. A couple of cheap VPSs would be cheeper and have way more headroom for the price.
- MaxBarraclough 8y agoYup. It's not free even for the first 12 months, even assuming upper bounds on load. $6.35 != $0. (For any numerical value of $ not equal to zero.)
- cunninghamd 8y agoI think the complexity of AWS's pricing is what led me to use the simplicity of AWS' lightsail offering. No free tier, but the free tier is frought with potential for overrun. Lightsail is not. https://aws.amazon.com/lightsail/ https://aws.amazon.com/lightsail/
- mamurphy 8y agoThat looks a lot like Digital Ocean's offering - anyone tried both who can compare Lightsail vs DO? edit: Blog post that says they are about equal, Lightsail has AWS integration but DO is a but more full-featured as of the writing (https://cloudacademy.com/blog/amazon-lightsail-vs-digital-ocean/ https://cloudacademy.com/blog/amazon-lightsail-vs-digital-oc...)
- kayoone 8y agoI am not convinced that you really need lambda and all that complexity. I also don't really like the characteristics of Lambda, taking forever to wake up and limited debugging. A $5 DO/Hetzner Instance can already do a lot if you pay a bit attention to performance. I run a small Golang Api on DO for $5, using DynamoDB and some Cloudflare Caching (free) and it can handle quite a lot of traffic.
- nzoschke 8y agoNot only is this stack free, it’s easy to develop and set up and operate. Here’s a boilerplate Go app that sets up this stack: https://github.com/nzoschke/gofaas https://github.com/nzoschke/gofaas
- ToFab123 8y agoIs there a similar offer on Azure?
- mcnnowak 8y agoWhy is everyone so concerned with $20/mo? If you're running a business, this should be the least of your concerns. Building on AWS means easy scaling for the future. Who wants to redesign their entire project if it takes off?