Need advice about which tool to choose?Ask the StackShare community!

Serverless

971
880
+ 1
21
Terraform

8.3K
6.3K
+ 1
293
Add tool

Serverless vs Terraform: What are the differences?

What is Serverless? The most widely-adopted toolkit for building serverless applications. Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster. The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more.

What is Terraform? Describe your complete infrastructure as code and build resources across providers. With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.

Serverless can be classified as a tool in the "Serverless / Task Processing" category, while Terraform is grouped under "Infrastructure Build Tools".

"API integration " is the top reason why over 10 developers like Serverless, while over 81 developers mention "Infrastructure as code" as the leading cause for choosing Terraform.

Serverless and Terraform are both open source tools. Serverless with 31.3K GitHub stars and 3.53K forks on GitHub appears to be more popular than Terraform with 18.2K GitHub stars and 4.92K GitHub forks.

Uber Technologies, Instacart, and Slack are some of the popular companies that use Terraform, whereas Serverless is used by Plista GmbH, Hammerhead, and Droplr. Terraform has a broader approval, being mentioned in 667 company stacks & 1273 developers stacks; compared to Serverless, which is listed in 165 company stacks and 236 developer stacks.

Decisions about Serverless and Terraform

Because Pulumi uses real programming languages, you can actually write abstractions for your infrastructure code, which is incredibly empowering. You still 'describe' your desired state, but by having a programming language at your fingers, you can factor out patterns, and package it up for easier consumption.

See more
Sergey Ivanov
Overview

We use Terraform to manage AWS cloud environment for the project. It is pretty complex, largely static, security-focused, and constantly evolving.

Terraform provides descriptive (declarative) way of defining the target configuration, where it can work out the dependencies between configuration elements and apply differences without re-provisioning the entire cloud stack.

Advantages

Terraform is vendor-neutral in a way that it is using a common configuration language (HCL) with plugins (providers) for multiple cloud and service providers.

Terraform keeps track of the previous state of the deployment and applies incremental changes, resulting in faster deployment times.

Terraform allows us to share reusable modules between projects. We have built an impressive library of modules internally, which makes it very easy to assemble a new project from pre-fabricated building blocks.

Disadvantages

Software is imperfect, and Terraform is no exception. Occasionally we hit annoying bugs that we have to work around. The interaction with any underlying APIs is encapsulated inside 3rd party Terraform providers, and any bug fixes or new features require a provider release. Some providers have very poor coverage of the underlying APIs.

Terraform is not great for managing highly dynamic parts of cloud environments. That part is better delegated to other tools or scripts.

Terraform state may go out of sync with the target environment or with the source configuration, which often results in painful reconciliation.

See more

I personally am not a huge fan of vendor lock in for multiple reasons:

  • I've seen cost saving moves to the cloud end up costing a fortune and trapping companies due to over utilization of cloud specific features.
  • I've seen S3 failures nearly take down half the internet.
  • I've seen companies get stuck in the cloud because they aren't built cloud agnostic.

I choose to use terraform for my cloud provisioning for these reasons:

  • It's cloud agnostic so I can use it no matter where I am.
  • It isn't difficult to use and uses a relatively easy to read language.
  • It tests infrastructure before running it, and enables me to see and keep changes up to date.
  • It runs from the same CLI I do most of my CM work from.
See more
Pros of Serverless
Pros of Terraform
  • 12
    API integration
  • 6
    Supports cloud functions for Google, Azure, and IBM
  • 2
    Lower cost
  • 1
    Auto scale
  • 0
    Openwhisk
  • 100
    Infrastructure as code
  • 68
    Declarative syntax
  • 43
    Planning
  • 26
    Simple
  • 23
    Parallelism
  • 6
    Cloud agnostic
  • 5
    It's like coding your infrastructure in simple English
  • 4
    Well-documented
  • 3
    Automates infrastructure deployments
  • 3
    Platform agnostic
  • 3
    Immutable infrastructure
  • 2
    Automation
  • 2
    Scales to hundreds of hosts
  • 2
    Extendable
  • 2
    Portability
  • 1
    Lightweight

Sign up to add or upvote prosMake informed product decisions

Cons of Serverless
Cons of Terraform
    Be the first to leave a con
    • 1
      Doesn't have full support to GKE

    Sign up to add or upvote consMake informed product decisions

    What is Serverless?

    Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster. The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more.

    What is Terraform?

    With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use Serverless?
    What companies use Terraform?

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Serverless?
    What tools integrate with Terraform?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    GitHubPythonGit+22
    17
    13036
    JavaScriptGitHubPython+42
    52
    19246
    What are some alternatives to Serverless and Terraform?
    AWS Lambda
    AWS Lambda is a compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security.
    Zappa
    Zappa makes it super easy to deploy all Python WSGI applications on AWS Lambda + API Gateway. Think of it as "serverless" web hosting for your Python web apps. That means infinite scaling, zero downtime, zero maintenance - and at a fraction of the cost of your current deployments!
    Kubernetes
    Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions.
    Azure Functions
    Azure Functions is an event driven, compute-on-demand experience that extends the existing Azure application platform with capabilities to implement code triggered by events occurring in virtually any Azure or 3rd party service as well as on-premises systems.
    Cloud Functions for Firebase
    Cloud Functions for Firebase lets you create functions that are triggered by Firebase products, such as changes to data in the Realtime Database, uploads to Cloud Storage, new user sign ups via Authentication, and conversion events in Analytics.
    See all alternatives
    Interest over time
    News about Serverless
    More news