As an indie maker with limited financial resources, I need to optimize the hosting costs. In the article, I'm sharing how I host my SaaS for free on AWS.
I think a lot of software over-constrains its users
7 Reddit Marketing Changes in 2025 That Nobody is Talking About
The Real Value of Coupons in the Indie Entrepreneur World
I'd highly recommend looking in to the serverless framework if you're running your API with Lambda.
Also important to remember that Dynamo is a document based database and so it's not appropriate for all situations. If you need to be doing complex queries with joins, it's not for you.
that is not true. you just need to know the access pattern before hand.
read this book if you want to learn more about dynamodb https://www.dynamodbbook.com/
Yeah, but in an early stage startup, this can be tricky.
Modeling your data after your queries comes with extra overhead when you need to change the queries.
Starting with a relational DB will make this much easier and once your patterns are stable I'd recommend ripping out pieces into dynamoDB if you need the scalability.
I've gone back from building APIs on serverless first to something like rails for MVPs
yes I'm aware, I'm at exactly the same spot only that I'm trying out flask (python). but I really hate to pay rds every month for a side project. that is my main motiviation to use dynamodb. and you have way lower ops overhead
Aurora has a serverless version and is postgres compatbile afaik :)
aurora serverless v2 does not scale down to 0 and the smallest capacity is still $50 and v1 is not really production material (even aws doesn't recommend it for prod workload, but I never gave it a try tbh)
Not sure, I used it briefly, but I guess better to go with their rec haha.
https://supabase.com/ has a free tier I think and it's postgres 🤔
+1 for Serverless framework, I'm also using it! One of the best tool working with Lambda.
Whether it's NoSQL or SQL, I try my best to avoid joins. It's one of the bottleneck for scalability.
Totally agree about the Serverless.com framework. You can also use cloud formation inside it.
+1 for using Lambda. It's how I structured my new SaaS so that 1) it scales well and 2) it's cheap until we grow!
This is great information, thank you! It's not AWS, but I like to also share that for frontend hosting, you can host static websites for free on GitHub with their Pages feature. I've been using that for all my projects and I've been very happy with it.
I'm also hosting my static website on GitHub Pages, love it! In the past, the only drawback is you cannot customize the build command. But, they recently announced a Beta feature: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/ which make possible to work with all major frameworks now.
You also have netlify & netlify CMS
I don't know why, but AWS is complicated for me compared to other hosting solutions :)
I'd add that it's too easy to turn on a paid option, especially if you are not that good in managing servers. And get a fat fresh bill from Amazon at the end of the month ) Personally, I prefer using Cloudflare Pages for hosting of my static sites and cheap vps hosting for apps (around 4euro a month for a 2Gb/30Gb/2CPU VPS, location - USA)
Yes, I totally agree with you. At first, AWS seems to be very complicated. They offers too much service for a newcomer. But once, you understand the basics and look for serverless services (managed services) by AWS, you start loving it (at least for me).
Totally agreed
There is something called as AWS Activate which gives you like $1000 worth free credits for hosting your application. Should be good enough to host the application till you start getting some traction. You need to send them details and they would validate your application. In case you get shortlisted at some local startup accelerator you can even get more credits.
https://aws.amazon.com/activate/
Nice writeup! I work with AWS a lot in my day job and enjoy working with many of these services.
One little caveat with Amplify though. It is a fairly new service and doesn't completely support certain frameworks or versions. For example, Next JS version 12 works on Vercel, but not Amplify. Same with SvelteKit.
At least that was my experience a few months ago. It may have changed since then.
There is some kind of credits you can apply for, depending on whether you are a student, or educational profession, or NGO, check out their sponsorship page!
one of my friend got 150k USD credits, which sounds like a lot!
I didn't know it can go up to 150k USD credits! I've seen a lot of programs where AWS offers credits, it was mostly around 1k USD credit, which is already a lot!
Great post and use of serverless free-tier limits !
I've always been a bit concerned about potential 'hidden costs' of AWS; particularly around VPCs (?). For that reason, I skipped AWS serverless for Oracle's always-free VPS
While a bit more maintenance than serverless, it's free and doesn't introduce lockin (containers for the win!)
Your post has me reevaluating AWS serverless options this weekend; thanks for the share!
In the architecture I'm currently using, there is no VPCs. I won't able to share any experience with it :s
In the past, I'm also setting up myself a dedicated server, but now with serverless, it free me so much time and burden. So, I can focus on my business and product.
With the right setup and tools, you can avoid any vendor lockin. For example, you can start using Serverless framework. Someone in the comment also suggested this tool.
Yep - if you keep your instances in a private subnet and add a NAT gateway so they can access the internet, it gets expensive REAL quick
I've been using AWS for both of my projects till date. Have found it cost-effective & hadn't faced any issues till date :)
Instead of AWS I prefer Linode or Vultr which has VPS starting from $2.5/3.5 and $5 which is good for MVP level projects
In the past, I'm also renting my own low cost dedicated server. I'm just sharing my personal experience in the article. Currently, I'm more focused on my product and business. So, I offload the server management to AWS. But if you need full control of your server VPS can be a solution.
Dynamodb may not be a good fit for many use cases, specially if you need a relational database. In my projects, I usually use sqlite (in production) until it reaches to a bottleneck (most of the time performance wise). Then I switch using RDS (I use postgres mostly) and export all the data to that. At that point the product usually is fairly profitable and you don't need to depend on free tiers anymore. Take look at these discussions to learn more about running sqlite in production:
https://news.ycombinator.com/item?id=31152490
https://blog.wesleyac.com/posts/consider-sqlite
You can use DynanamoDB for most use cases and it's fully serverless: scale to zero, no maintenance, pay per request, scale automatically, etc. Someone has shared good resource about Dynamodb in the comment.
Do I understand correctly that you host a full blown API backend on a single Lambda function? Serverless functions usually go to sleep and only support a limited execution time which is why fast startup is important and long-running task need to be avoided. How do handle that?
AWS Lambda can go up to 15 minutes of execution, it should be enough for most use cases. Serverless functions only goes to sleep after 45-60 minutes of inactivity (the number might be variable), it shouldn't happen often. And the wake up time happen to only the first request and it only adds 500ms. For most web applications, it shouldn't be a problem.
I usually start my projects with the AWS Lightsail and scale onto EC2 when it starts bursting out.
In my case, I was renting a dedicated server without noisy neighbors ;) Doing all the server management myself. But after discovering Serverless, I just offload to AWS and focus more on my product.
Combine all these AWS technologies into a single package would required quite lot of times. I can just go on straight 3 hours to create something out of blank file.
The Power Of Coder 💪🏼
This is the exact solution I am implementing for my new project, but I'm gonna use ElastiCache for caching - let's see if there's a generous free tier for that service.
AWS Cognito seems a much better solution than libraries like passport.js too.
I was wondering though - doesn't the time taken for each request /the amount of processing factor into the 1 mill free amount?
I love this article! This gave me the morale to start using AWS. Why? Because so far all I could hear is that AWS is complicated and expensive, but now this gave me a different perspective.
Also, your writing skills are pretty good 🔥
Thank you for your comments! 🔥
I think what make AWS complicate is because there are hundred services you can use for your application, there are too many choice and you can easily be lost. But, once you find the right services, things can be extremely easy. As an indie maker, I'm only using Serverless services from AWS or managed services by AWS.
Its a complicated thing man , you have to learn it
Yes, everything is complicated like software engineering at first. Especially when you want to deploy your application to production where you need to solve a lot of issues. Hopefully, now with Serverless, things are much more easier.
But once you understand the basics, everything is natural.
It looks more like an AWS advertisement.
Unfortunately, I not paid by them, just another indie maker without financial resources, I should contact them to my sponsor.
Happy to receive any feedback to improve: how can I sound less an advertisement.
Try to sponsor a solution that doesn't require you to rewrite your infrastructure or get to the bank to open debt to pay the bills if you need to scale then. That's called vendor lock-in.
If you are using the right tool and apply best practices by writing clean code, there is no need to rewrite the infrastructure or get vendor lock-in.
For example, I can host the frontend anywhere: GitHub Pages, Vercel, Netlify, Apache, Nginx all works. Any hosting who can serve static files.
Same for the backend, under the hood, it's just an Express.js server, any provider who can host an Express.js server will works. Or, one way I can do it to dockerize the application and migrate out of AWS.
I want to see your future willingness to migrate away from AWS Cognito meanwhile in production.
For the Email service, I use AWS SES but you can easily swap to another provide in seconds like Sendrid or Postmark without rewriting the whole application. It's already done.
In the same idea, I'll happy to add support for Auth0, Firebase Auth, Supabase Auth or any other providers. I've already prepared the codebase for this.
I can suggest one resource which helped me a lot in software architecture: https://refactoring.guru
Another things helped me a lot is to watch YouTube, there are tons of resources where people are sharing their knowledge to correctly architecture an application.
I wrote something similar back in the days with Azure. I think the free tier is better with Azure by far.
On Azure, you get 10 App services free (with limitation of 1GB shared storage (for your code) and 1hr compute/day). Think of App Service as a managed hosting (like ec2 server). On Azure functions (same as AWS lambda), the free tier will get you pretty far (you can share that with the free 10 App Service).
There's plenty of storage offerings on Azure at free tier too. If you run out, you can just create another subscription and you get another sets of free tiers. This is due to developers might be contractors and working for others, so the amount of free tiers is tied to # of subscriptions and not accounts.
Heck, even their AADB2C (Auth0 alternative) free tier is so attractive (free 50k MAU, unlimited register/login). Documentation for AADB2C was bad though.
Azure or AWS, an endless debate like VIM or Emacs. Each provider has his own pros and cons.
For your information with AWS, you can have an unlimited app, not limited to 10. Same as AADB2C, you can also have a free 50k MAU.
You should use the right provide based on your context whether it's Azure or AWS or any other providers
Sorry not up-to-date with AWS pricing, when did they allow unlimited EC2 server at free tier? Just looking right now, it says 750hrs/mo for first 12 months. There's no free tier for EC2 after 1st year.
I think as we scale, we should be able to do multiple cloud service provider, hybrid model. On linux, I think it's fairly easy to do that on both providers. The pricing is fairly similar. If you use dotnet, it's better to use Azure for the early access. Both are pretty competitive in terms of pricing. I just think Azure is more startup friendly and people on IH might not be aware of this.
While we are on the same topic, anyone hosting on github pages? you can essentially get hosting for free!
Hello,
Our Mobile Car Detailing Silver Spring Md specialist will work closely with you during our initial consultation to know exactly what type of service will https://sharpdetailsilverspring.com/ best suits your needs before starting any work. We have the solution no matter what kind of car you have and how much work your vehicle needs.
How fast is development speed on AWS lambda compared to "bare" ec2 server or docker? I tried serverless a few times but I found that the development cycles (change code, reload website, fix code, reload, …) was quite a bit slower with lambda, especially since you cannot run lambda on your local host.
My setup with AWS lightsail (similar to ec2) is currently 20$ per month. Granted I have 0 revenue, but that's still something I'm willing to pay for some months.
I have all my setup running locally and without internet connection, everything work perfectly with change code, automatically reload website, debugger directly in VSCode with breakpoint, etc. The same developer experience you'll have with "bare" ec2 server or docker.
Compared to docker, it's even lighter, you don't need to install the docker application.
interesting! So you run your code "outside lambda" locally? What language do you use? And I guess you have a "dev dynamo" instance you can connect to?
All the AWS ecosystem running locally without the need of connection: Lambda, Email Service, Database, etc.. I'm using Serverless framework and it has a large ecosystem of plugins, a lot of people also suggesting this tool in this comments.
hello
This comment has been voted down. Click to show.