How I built a serverless SaaS product on Alibaba Cloud

Posted on 11 July 2019 by Alberto Roura.
alibaba cloudaliyunawscirrus auditclouddigitaloceanproduct developmentserverless

Cirrus Audit Panel is a multicloud resource optimisation SaaS platform targeted to SME businesses (investors welcomed). It aims to help IT professionals deal with multiple cloud providers and accounts at the same time, all without worrying too much about the technical jargon. You can see how a Virtual Machine performs and costs within seconds, no matter the provider or account.

Currently supporting Alibaba Cloud, Amazon Web Services and DigitalOcean (with many others to follow), this tool is specially useful for APAC companies, as supports the 2 biggest providers in the area, specially Alibaba Cloud as the main player.

Cirrus Audit LOGO

What problem am I trying to solve?

Traditionally, this type of cloud tools supports one provider only and becomes very slow if a couple of users are using it at the same time, as the same back-end needs to deal with multiple API calls simultaneously. The solution usually comes by throwing a load balancer with multiple ECS instances in it to deal with the growing demand. Expensive, but an easy fix. Of course, this path makes the final subscription price quite high due to the resource footprint. This was never an issue as, at the end of the day, only big companies were dealing with cloud computing extensively.

Size of the cloud computing and hosting market worldwide from 2010 to 2020

Well, welcome to 2019! The market is not only experiencing a huge growth, there are also new players in the field and millions of on-premises servers are being migrated to the cloud.

The promise of managed resources and the lack of O&M tasks is specially tempting for small companies, so SME are jumping on it as well, but at a cost. SME companies usually can’t afford qualified employees capable of efficiently identifying and optimising its usage and they end up paying more than what they should. This, added to the high prices of the mentioned optimisation tools, makes them unable to really achieve efficiently at all.

So right there is where I was sitting, I needed to develop a platform capable of dealing with thousands of requests but at the same time affordable for small and medium companies. Heck, I even wanted to offer a Free plan! That, essentially, meant that the underlying infrastructure capacity needed to adapt precisely and instantly to the demand.

Not an easy task all of a sudden.

What Alibaba Cloud products is Cirrus Audit using?

Alibaba Cloud to the rescue! Cirrus Audit is leveraging a range of products from this cloud provider such as OSS, API Gateway, Function Compute, Log Store and Table Store. It makes a really nice serverless ecosystem altogether.

If you are unaware of what serverless is, keep reading. Serverless is a new computing paradigm in which you can build applications composed of microservices running as a response to events. Under this model the services automatically scales according to the usage. This means that you only get charged when they are executed in 100ms billing blocks, becoming the most “Pay-As-You-Go” model ever. This reduces the overall cost of maintenance for your apps, enabling you to focus more on the logic and deploying faster. Read more about serverless and Alibaba Cloud in this special article I wrote.

The following diagram exposes how pieces are connected.

Architecture diagram of Cirrus Audit Panel

Were other solutions considered?

With the above mentioned, you see how a classic ECS instance under a Load Balancer wasn’t an option, as that would make the platform as any other out there, as expensive as any other out there. My goal was to better serve small companies, so only a serverless approach was feasible.

How big is the team at Cirrus Audit?

This is a platform I’m entirely developing by myself, both front-end and back-end. Being able to focus 100% on the business logic and then rely in Alibaba Cloud to manage all the scaling and maintenance was very helpful, as is virtually like you have your own DevOps department ready 24h for you.

Took it very long to develop the first public beta?

It took me 4 months and a half to publish a half-polished public BETA. Given the fact that I have a full time job and I don’t have much spare time, is not that bad. I had, in average, about 5~7 spare hours available per week, that equates to about 3 full-time weeks. Time I spent coding, not planning or provisioning virtual machines.

Tell me about logging

To check when something does not look right, I fully rely on Log Store, Alibaba Cloud provides this amazing tool that supports plenty of options to export the data. The search function works perfectly and you have fast access to any event occurred. To log, since I use node, is as easy as placing a console.log().

What challenges did I faced the most?

If I need to choose the top 1 frustration of developing fully serverless, that is the one to do with cold functions. Because cloud providers keep function inside containerised environments, when the function doesn’t get called in a while, takes 2~3 seconds to make it work again. After the initial call, it works instantly until again is left with no use for another while. This is important to have in mind if you really need speed. Another factor in quicker cloud functions is if you are attaching it to a VCP or not, as the creation of the environment would be more complex and will take more time, sometimes up to 10 seconds or more.

Wrapping up

Special thanks to the team at Alibaba Sydney. Their help made possible the use of the latest and most efficient backend technology I could imagine. Bringing this platform to life is been extremely hard and laborious for me, as I kept challenging myself and my software development notions to make something new and unique.

I would ask anyone reading this post to give it a try and/or like/share it on your social media. Any of that 2 actions would help me a lot to keep going.


Original article: How I built a serverless SaaS product on Alibaba Cloud.

✉️ Contact

Ready to take the next step? Don't wait any longer! If you're interested in learning more about Guztia products and services, or if you have any questions or concerns, book a meeting today.

Book a Meeting

Our team of experts is standing by, ready to assist you with anything you need. Book a Meeting, and Guztia will take care of the rest.