Why you should go Serverless

Posted on Sep 29, 2017

Why you should go Serverless

Serverless is the hot topic these days. Everyone is exploring it, in hope to reduce the effort for server management. And why shouldn’t they, Uber, Instagram, Airbnb are just a few of the many tech giants which used it to their advantage. Other than server management, serverless also takes care of scaling. What I mean from auto-scaling is can be understood from this:

Your application can be scaled automatically or by adjusting its capacity through toggling the units of consumption (e.g. throughput, memory) rather than units of individual servers. – AWS Serverless Docs

Though I wanted to restrict this blog to only serverless, there is no way we can talk about it, without mentioning AWS. AWS has a complete platform for serverless, with more services than you can count on fingers. And all of them are fully handled and scalable. Check here for the AWS serverless platform docs.

However, it’s just not AWS which gives you options to make serverless apps, IBM openwhisk, Azure and Google cloud are also giving this architecture, but I can’t comment on those as I’ve never used them thus far.

So, let’s do a small FAQ on serverless.

What is Serverless?

Serverless is a way to create apps, where you don’t have to monitor, provision and manage your server, your third-party service provider will do it for you. It can be AWS, Azure or something else.

Wait, it means, there is no server, where is my code running then?

No no no! There is a server, there will always be a server (I think so). It’s just that you don’t have to worry about it. Your code is running in AWS cloud.

Is it going to cost more than usual server flow?

If something reduced your efforts, it should cost more. Well, not necessarily. I’ve used the lambda functions in many of apps and it doesn’t cost much. If your code is just “sitting idly” in the cloud, then you won’t be charged a penny. There’s a nice tool for checking how much it will cost based on the number of requests, the time it took and memory used, called ServerlessCalc.

These are the 3 questions I could think of at the time of writing this blog, but if you have more questions, feel free to ask in comments.

So far, we know these advantages of serverless architecture:

  • No server management
  • Auto-scaling
  • Pay for what are you using now

Now, let’s say you have decided to make a serverless app, the first question which should come in your mind, how? How do I make a serverless app?

Fortunately, for you and me, there are many services which provide functionality for creating serverless apps. A simple google search should give you more options than you need.

But here I will talk about AWS Serverless platform here. AWS serverless is a combination of many of it’s services, which only lets you focus on building a product rather than servers and clouds.

Let’s tick off some of those services

  • Database
    That’s the most basic need a developer can have and AWS provides a NoSQL, fully managed, cloud database, known as DynamoDb.
  • Service for computing logic
    “Less servers, more services”
    How about if you can have just a service which does some specific task, only runs when needed and scales when needed. AWS Lambda is what you’re looking for. It is, arguably, one of the most revolutionary services in cloud-history.
  • Object-based storage
    AWS S3 is a great service for saving files on the cloud as an object. Even Dropbox uses S3 to save its files. And you don’t even have to be a developer to use it, its web UI is so simple that anyone can use it just like any web tool. It’s highly secure and scalable and provided advanced features like versioning, caching, but that is not in the scope of this blog.

And the list doesn’t end here, there are many more services like Kinesis, Step Functions, Aurora, etc.

I am gonna end by saying that “serverless is not the future, it’s the present”.