Serverless Handbook

Student Login

Serverless Pros & Cons – when should you go serverless?

Okay you've heard of serverless, tried it out, and you think it's neat. But should you really go serverless for your next project?

Yes!

Most of the time ...

Serverless is a great option for most projects most of the time. You save configuration and maintenance time, gain flexibility, and in extreme cases spend more $$ per request than building your own servers.

Large apps can reach the cost curve limits of serverless. Bank of America, for example, announced $2B in savings from building their own data centers.

You won't hit those issues. And if you do, I hope there's a business model to back it up and you can afford DevOps professionals. 😛

Large orgs tend to provide a cloud or serverless-like environment internally. If you have access to that, use it.

Serverless is an ecosystem

When I say serverless, I don't mean just throwing up code on a function-as-a-service platform like AWS Lambda. I'm talking about the whole ecosystem.

The core idea is this:

  1. Backend does as little as possible
  2. Clients tie everything together
  3. Static files come from fast content delivery networks
  4. Database handles data consistency
  5. As much work as possible happens at compile and deploy time

Users' and developers' machines do the hard work.

Is part of your app the same for every user? Package it up at deploy time. No need to bother the server or the client with that work.

Is part of your app specific to individual users? Let the client handle it. Every phone is a powerful computer these days.

Got dynamic data that needs to synchronize across multiple sessions or users? Background processes that aren't tied to a specific session? Perfect fit for your server and database.

We go in depth about this architecture in the chapter on Serverless Architecture Principles.

Serverless pros

The main benefit of serverless is that you don't deal with servers. They're somebody else's problem.

You save time

You focus on application code. No more tedious maintenance tasks that aren't specific to your problem.

Bye bye yak shaving. 👋

"I need an API. That means I have to run a server. Which means I need Apache or Nginx to map HTTP requests to my app server. I need a computer to run all that. Which means I have to set up a whole operating system. Then I have to make sure everything runs at boot. And if a process goes down, it needs to restart. And ..."

After all that work you get to build your application.

With serverless you save time otherwise spent managing servers. Whether that's you personally or a DevOps team in your organization.

Programming productivity

You write backend code more productively.

Hello! 👋

Are you a frontend engineer diving into backend? Do you have just that one bit of code that can't run in the browser? Something that deals with secrets and APIs?

That's what cloud functions are for my friend. You take a JavaScript function, run it on serverless, get a URL, and voila.

But that's easy mode. Any tutorial can teach you that.

What happens when you wanna build a real backend? When you want to understand what's going on? Have opinions on REST vs GraphQL, NoSQL vs. SQL, databases, queues, talk about performance, cost, data processing, deployment strategies, developer experience?

🤯

Unlock your free chapter!

Access to this chapter immediately, extra free chapter and Serverless crash course in your email ✌️

I like privacy too. No spam, no selling your data.


buy now amazon

Dive into modern backend. Understand any backend

Serverless Handbook shows you how with 360 pages for people like you getting into backend programming.

With digital + paperback content Serverless Handbook has been more than 1 year in development. Lessons learned from 14 years of building production grade websites and webapps.

With Serverless Handbook, Swiz teaches the truths of distributed systems – things will fail – but he also gives you insight on how to architect projects using reliability and resilience perspectives so you can monitor and recover.

~ Thai Wood, author of Resilience Roundup

If you want to understand backends, grok serverless, or just get a feel for modern backend development, this is the book for you.

Serverless Handbook full of color illustrations, code you can try, and insights you can learn. But it's not a cookbook and it's not a tutorial.

Serverless Handbook on your bookshelf
Serverless Handbook on your bookshelf

Yes, there's a couple tutorials to get you started, to show you how it fits together, but the focus is on high-level concepts.

Ideas, tactics, and mindsets that you need. Because every project is different.

The Serverless Handbook takes you from your very first cloud function to modern backend mastery. In the words of an early reader:

Serverless Handbook taught me high-leveled topics. I don't like recipe courses and these chapters helped me to feel like I'm not a total noob anymore.

The hand-drawn diagrams and high-leveled descriptions gave me the feeling that I don't have any critical "knowledge gaps" anymore.

~ Marek C, engineer

If you can JavaScript, you can backend.

Plus it looks great on your bookshelf 😉

buy now amazon

Cheers,
~Swizec

Previous:
Getting Started
Next:
AWS, Azure, Vercel, Netlify, or Firebase?
Created bySwizecwith ❤️