DEV Community

Alex Spinov
Alex Spinov

Posted on

SST v3 Has Free Serverless Infrastructure — Here's Why It's Replacing Serverless Framework

Serverless Framework lost its way. SST v3 is what it should have become — full-stack serverless with live Lambda debugging.

What is SST v3?

SST (Serverless Stack) is an open-source framework for building full-stack apps on AWS. v3 was rewritten from scratch using Pulumi and Terraform under the hood.

Quick Start

npx sst@latest init
bun install
npx sst dev
Enter fullscreen mode Exit fullscreen mode

Define Infrastructure in TypeScript

// sst.config.ts
export default $config({
  app(input) {
    return {
      name: "my-app",
      removal: input.stage === "production" ? "retain" : "remove",
    };
  },
  async run() {
    // Create an API
    const api = new sst.aws.ApiGatewayV2("MyApi");
    api.route("GET /", "packages/functions/src/hello.handler");
    api.route("GET /users", "packages/functions/src/users.list");
    api.route("POST /users", "packages/functions/src/users.create");

    // Create a database
    const db = new sst.aws.Dynamo("MyTable", {
      fields: { pk: "string", sk: "string" },
      primaryIndex: { hashKey: "pk", rangeKey: "sk" },
    });

    // Create a bucket
    const bucket = new sst.aws.Bucket("MyBucket");

    // Link resources to functions
    api.route("POST /upload", {
      handler: "packages/functions/src/upload.handler",
      link: [bucket, db],
    });

    // Deploy a Next.js frontend
    new sst.aws.Nextjs("MyWeb", {
      link: [api],
    });
  },
});
Enter fullscreen mode Exit fullscreen mode

Live Lambda Development

The killer feature — sst dev connects your local code to AWS Lambda in real-time:

npx sst dev
Enter fullscreen mode Exit fullscreen mode

Your Lambda functions run locally but are triggered by real AWS events. Change code, save, see results instantly. No deploy cycle.

Using Linked Resources

// packages/functions/src/upload.ts
import { Resource } from "sst";
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

const s3 = new S3Client({});

export async function handler(event: APIGatewayProxyEventV2) {
  await s3.send(new PutObjectCommand({
    Bucket: Resource.MyBucket.name, // Type-safe resource access
    Key: "uploads/file.txt",
    Body: event.body,
  }));

  return { statusCode: 200, body: "Uploaded" };
}
Enter fullscreen mode Exit fullscreen mode

Full-Stack Frameworks Support

// Next.js
new sst.aws.Nextjs("Web");

// Remix
new sst.aws.Remix("Web");

// Astro
new sst.aws.Astro("Web");

// SvelteKit
new sst.aws.SvelteKit("Web");
Enter fullscreen mode Exit fullscreen mode

Cron Jobs

new sst.aws.Cron("DailyReport", {
  schedule: "rate(1 day)",
  job: "packages/functions/src/report.handler",
  link: [db],
});
Enter fullscreen mode Exit fullscreen mode

SST v3 vs Alternatives

Feature SST v3 Serverless Framework CDK SAM
Language TypeScript YAML TypeScript YAML
Live Debug Yes No No Local only
Full-Stack Yes Functions only Yes Functions only
Next.js Deploy Built-in No Manual No
Type Safety Full No Full No
Speed Fast Slow Medium Medium

Building serverless scraping pipelines? Check out my web scraping actors on Apify Store — scalable data extraction without infrastructure. For custom solutions, email spinov001@gmail.com.

Top comments (0)