For tech startups there’s never been a better time to build a product. For genuine bootstrapping and the ability to build an infrastructure without spending a dime, the time is now. And while cloud allowed to us rent the pieces to mimic on-premise, serverless now lets us just have code run and not worry about how that happens at all. This is amazingly powerful for startups but many haven’t yet understood why.
Cloud gave us the ability to not own infrastructure. We could rent servers, storage and networking as easily as renting an office, and turn it on or off as needed. This on-demand approach made it fast to test ideas quickly and cheaply and then ‘scale up’ if they were successful. Smart startups were among the first companies to recognize the enormity of this idea. But cloud is still complicated and you really have to know what you’re doing to orchestrate all the moving parts successfully.
Serverless entered the fray 4 years ago and changes this model substantially. It looks at what code and services you need to make an platform work, and runs these on your behalf. In the background, there are still servers running but you no longer need to manage, patch and maintain anything yourself. It’s the next iteration of cloud, allowing you to focus solely on the differentiating parts of your product, not the grunt work of the underlying stack.
For the most part, cloud providers haven’t done a great job in explaining this to the world. The documentation is thin, examples have been scarce, and there’s a shift in the mental model needed to build on these systems. In the first couple of years of serverless, mostly it was used for small-scale specific tasks like resizing images, running reports or performing minor infrastructural processes. But serverless features have come of age in the last 12 months and you can build a surprising amount of your application — sometimes all of it — using a serverless approach.
The benefits of serverless for startups
There are few important things you should care about as a startup. First, cost — running serverless apps is really very cheap. While cloud is definitely inexpensive, you are still paying for virtual servers not running at full capacity, load balancers that might not be doing much, and blocks of storage that aren’t fully used. You also have to pay for someone to manage all of this.
In serverless, you pay for what you use. This means you incur cost when code runs, you pay per byte of storage actually used, and the hidden infrastructural support for scaling all of this is built into these numbers. It’s truly a metered service. For example, on AWS Lambda you pay $0.20 per million requests when code is executed. In practice, I’ve seen this typically means you can pay 70–90% less for your infrastructure compared with even the cloud equivalent.
Scaling is also a gift for startups. Usually the gap between Minimum Viable Product and ‘Production Ready’ can mean rewriting and redesigning the app. This is because you build the absolute minimum in testing an idea, and it’s not sufficient for production. Most MVPs consist of largely throwaway work because of this gap.
In serverless, the design is decomposed into much smaller units connected by functions. This code often doesn’t need any rework as the application receives more traffic since these functions are very small and specific. They might look up a user profile, transcode a video or send an SMS notification — the difference between MVP and production is purely scaling in these cases. The major benefit of serverless is that scaling is handled for you — whether a function is run once a day or a thousands times a minute, the cloud provider makes sure this happens.
Finally, there’s agility. In every startup idea I’ve worked on, the concept changes substantially and functionality changes rapidly. I’ve seen ideas start on the desktop and end up on mobile, while features are added and removed on a daily basis. This tends to cause havoc for traditional applications, which need refactoring along the way as the concept shifts, and can lead to unintended design problems.
In serverless, it’s comparatively simple to keep up with this pace since the app is comprised of dozens of very small units. You can upgrade and change these units without affecting the overall application, and this nimble structure makes it a perfect fit for startups where you are often changing the engines of the plane mid-flight.
Commoditization moves up the stack
The story of technology has always been the steady commoditization of storage, compute and networking, as a by-product of all three becoming exponentially faster or cheaper. Much of this is happening so quickly now it can be easy to dismiss an obvious trend for a fad, or fail to notice when you are working on technology problems that have no real value.
Cloud made it clear that running data centers only made sense at scale, and even large companies choosing to run their own were not allocating their resources well. As these providers have perfected automation and provisioning of virtual machines, there’s now a clear case that even managing these is a task best performed at scale.
For startups, this means you shouldn’t use any of your scarce reasons on technology issues that can be handled for you. The Serverless mindset allows you to dedicate all your engineers to solve business problems and spend 0% of your hours on server management and infrastructure.
While Amazon and other will continue to push up the stack, if you focus on your differentiating features, this process will work in your favor. Put simply, this is a very bad time to work in infrastructure management, but a very good time to build solutions that address business need.
Adopting the serverless mindset
Serverless is evolving quickly — it’s become a federation of different managed services. Usually this comprises Functions-as-a-Service (the code you run), object storage and delivery, databases, networking and security. In the AWS world this equates to Lambda, S3, CloudFront, DynamoDB, Route53 and IAM, but similar services exist in Microsoft Azure and Google Cloud.
These services are like Lego. If you break your technology product into a flowchart, you can then figure out which Lego bricks you need to carry out each step. For example, a very simple service that retrieves user orders and receipts might look like this:
Mapping these steps into AWS tools could be modeled like this:
Identifying the events that cause triggers for things to happen, and where the information is stored or managed, are the first steps into breaking down the tasks. In most early diagrams, the steps tend to be too coarse (e.g. “Find user recommendations”) but subsequent iterations can break down the exact functionality, making it simpler to translate into serverless.
Now there are plenty of naysayers who will throw up the limitations of this model before considering what it brings to the table. For latency-sensitive applications or compute-intensive activities, serverless probably isn’t the answer. But in every startup product I’ve ever seen, even these services have user interfaces, websites and asynchronous elements throughout the design that can be handled perfectly this way.
It’s all about the business benefit
A great startup case study is A Cloud Guru, the popular training site for engineers now with 600,000 customers globally. This platform was developed using serverless tools from the beginning and has scaled to deliver a vast amount of media to a rapidly-growing user base.
The web application consists of 287 Lambda functions with nearly 4 terabytes of data stored in S3. These functions are used over 6 million times daily. In any other system design, this would require a major amount of infrastructure to build, monitor and maintain. Yet in August 2018, A Cloud Guru’s bill for Lambda was just $580 a month.
In this case, the business focuses its effort on where users receive the most value — namely, the quality of the training — not in the delivery infrastructure. In many ways the mechanisms for transcoding and streaming these videos are mundane and commoditized, so the company made the smart move in handing over these processes to AWS.
I’m truly excited about what serverless means for startups. As Rupert Murdoch said, “The world is changing very fast. Big will not beat small anymore. It will be the fast beating the slow.” Serverless gives us the best chance to deliver quickly, use our limited resources to focus on our products, and use speed and agility to our advantage.