SAAS architecture is inherently complex and designing one on a tight budget can be extremely difficult. When you are starting as a founder your focus should be on acquiring users, getting feedback, and building a great product. This is where a serverless architecture comes in, it handles all the underline complexity of managing servers through an abstract interface.
Disclaimer ⚠️ - This article doesn't convey that you will be able to host your SAAS for free forever. A lot of these tools have Free tier and credits for Startups. That can be used to host your SAAS app for a year or so, or until you receive traction.
What are the benefits of hosting your SAAS on a serverless architecture?
- Most serverless platforms have generous limits and have pay as you go, model. So your cost is directly proportional to your usage. If you price your product correctly you don't need to worry about the infrastructure pricing at all.
- Serverless scales really and the underlying complex infrastructure is abstracted. This way when your SAAS takes off you do not need to about scaling your infrastructure on worry about the platform going down.
What things to consider before using a serverless architecture?
- You have tonnes of users and a big team. Although, If you are following a microservice-based architecture some of your services can be hosted on these platforms but at that stage, it makes more sense to look into Bare Metal Servers, you will be able to reduce your cost drastically(That's a topic for another day).
- Your SAAS uses very long-running processes like web crawling. Most serverless platforms have a hard timeout limit. This only means your backend for this service. The rest of your application can still be serverless.
- Your SAAS uses really huge Machine Learning models. The most popular platforms have a memory limit(AWS has 10Gb). Bonus: If you are planning to use such a model. You might want to look into GPT3. Here is a crash course to get started with GPT3.
Tools to consider for your Serverless architecture
There are a lot of tools in the market. Here are my personal picks, Which I have personally used and should cover a majority of use cases.
Website and Web Application Hosting
Netilify and Vercel are best suited for web hosting. I personally use Vercel but Netilify is equally good. They both have CDN built in, generous limits(paid plans starting at 20$), image optimization, Continuous Integration and Continuous Deployment.
You might want to consider using Cloudflare as A DNS management service as it offers DDOS protection, loads of optimizations and a free inbox for your @domain emails. If you don't want to buy Gsuite or similar services.
Backend and Crons Hosting
AWS Lambda is my go-to choice when it comes to backend hosting. You can configure your domain or subdomain in Route 53 and API Gateway to interface with your functions via REST API. I highly recommend using Serverless for deploying your code. It abstracts all the complexity and you can deploy all the complex cloud configurations using a simple YAML file.
Databases
Depending on your use case you should consider one of the following.
- Firestore - If you need a real-time database and need 2-way communication between your frontend and backend.
- AWS DynamoDB - If your SAAS requires basic CRUD operation and you are planning to use a No SQL Database. This DB scales very well horizontally.
- PlanetScale - If you are planning to use a SQL database.
- MongoDB - If your SAAS requires Advance No SQL queries, Aggregations and etc. MongoDB Atlas has a serverless option and you can get free credits by applying to the MongoDB Startup program
Authentication
For Authentication trust me to go with Firebase. It's super easy to implement and has tonnes of Authentication options including auth by phone numbers. The limits are amazing and are perfect if you are in the initial stages.
Monitoring And Logging
In a serverless environment, it's super important to keep track of your errors, logs and usage. These are the must-haves for any serverless application.
- Sentry - Monitor all your errors in a single place using this. This tool converts errors into issues so you can prioritize the important issue.
- New Relic - Extremely powerful with a very generous limit. Help you analyze all your logs in a single place. This comes in extremely handy when your whole application is distributed. It integrates very well with all the services mentioned above.
Conclusion
Choosing a serverless architecture will save you a lot of time and a lot of headaches. Launching a SAAS product requires juggling multiple things. This architecture just takes the infrastructure off your plate until you can afford a dedicated DevOps person. It takes some work but you can incrementally move your application to a dedicated server.
I personally feel using the right tools can 10x your productivity. Like what you read? Check out my top list of must have SAAS Tools.
Happy Building 😊
Top comments (8)
I feel there's a need of a disclaimer here.
It's a good article Siddharth have written with up-to-date tools. However, the completely free clickbait isn't true at all. Most services mentioned have a free tier, but some of them will most likely cost you money.
AWS services like Lambda and DynamoDB comes with a free tier, which is fairly easy to reach. There's also a risk you will pay for automatically enabled logging features in AWS and doing mistakes like writing infinite loops in services like lambda can cost you a lot when the bill is sent out.
It's a perfectly valid concern and I acknowledge it. This article was aimed at early stage startup and how they can validate their idea for free. I didn't realized I made a click bait title.
Thank you for pointing this out. I will see how I can rectify it.
Disclaimer Added 😊. Thank you for pointing it out
Great. I get what you mean, to some extent they are free :) But I think for AWS and other serverless providers, it's good to note that they may come with unexpected costs. Not hidden costs, but unexpected.
Thank you for your feedback and taking the time. I just published by second article. It's a smaller one. Your feedback on that would really help me out.
A Developer's Content Writing System
Made a short comment there. Good one, you do a lot of things right already from your first article. Quality before quantity is the way to go :)
I am not a big fan of AWS because its mainly geared for firms, companies etc which can also be startups. But for much much smaller biz like a one-person / two-person digital agencies or solo freelancers etc, backend services like sanity.io for microsites for marketing / promotional purposes are better suited which has 10GB bandwidth + 5GB asset storage in the free tier. If the traffic spikes then the $1 per 5GB additional Bandwidths per month + $1 per 2GB additional Assets per month is so far more economical.
I sort of agree with you. I personally use sanity for my website. Infact it's one of my pick for best tools for SAAS but sanity solves very specific person hence the simpler pricing.
To be honest it depends on ones familiarity with AWS. Using tools like sanity is definitely more convenient as it abstracts a lot things and hence have a predictable pricing.
But the thing to keep in mind is Sanity itself runs on GCP so technically if you can directly configure the source correctly you can have better pricing(that's the whole point of serverless). I have worked with a lot of startups hence have a lot of architectures and processes already made for AWS so personally I prefer directly using IAAS whenever possible