> Markdown version of [/videos/133-server-side-serverless-in-swift?t=2719](https://www.wearedevelopers.com/videos/133-server-side-serverless-in-swift?t=2719). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Server Side Serverless in Swift You don't need to switch languages to build robust cloud infrastructure. Discover how to build, cross-compile, and deploy fast, type-safe serverless AWS Lambda backends natively in Swift. - **Speakers:** [Sebastien Stormacq](https://www.wearedevelopers.com/@sebastien-stormacq) - **Event:** WeAreDevelopers LIVE - **Published:** April 28, 2021 - **Duration:** 48:07 - **URL:** https://www.wearedevelopers.com/videos/133-server-side-serverless-in-swift ## Summary Modern connected applications natively depend on active backend services like identity management and object storage, yet managing traditional virtual servers remains costly and complex. Serverless architectures, particularly AWS Lambda, remove this operational overhead by providing automatic scalability, robust fault tolerance, and a strict pay-per-usage pricing model. For Apple ecosystem developers, writing serverless backends natively in Swift brings powerful advantages, including strong type safety, exceptional memory management, and C-level execution speeds to cloud infrastructure. Because Swift is not a default AWS runtime, developers can utilize the AWS Custom Runtime API alongside the `swift-aws-lambda-runtime` library built by the Swift Server Working Group. This package supplies a necessary bootstrap daemon to poll for incoming service events and supports configuring code handlers via simple high-level closures or the deeply performant Swift NIO event loop. Since lambda functions execute securely within Amazon Linux microVMs, code authored on macOS inevitably requires cross-compilation. Relying on containerization workflows orchestrated by Docker or utilities such as the Swift Lambda Maker (Slam) enables streamlined project scaffolding, Linux-targeted compilation, and automated dependency bundling directly into production-ready deployment archives. Transitioning from local execution to distributed cloud environments ultimately demands reliable deployment strategies. Leveraging the AWS Serverless Application Model (SAM) allows engineering teams to define their infrastructure as code (IaC), structurally connecting Swift computing hooks to HTTP API Gateways or storage buckets via templated YAML. To complete the ecosystem, developers can adopt the Soto project—a community-driven, non-blocking Swift SDK—which securely abstracts away low-level HTTP signature constraints and allows seamless, idiomatic interactions with external AWS systems. **Keywords:** serverless architecture benefits, AWS lambda custom runtimes, server-side swift, swift-aws-lambda-runtime, docker cross-compilation, swift NIO event loop, amazon linux microvms, infrastructure as code, AWS SAM templates, soto project SDK, HTTP API gateway integration, custom backend provisioning, swift lambda maker ## Chapters 1. **Evolution of backend services and mobile applications** (00:40) — Shifting functionalities to modern connected backends enables rapid updates without application store delays. 1. **Understanding the four core principles of serverless computing** (03:02) — Eliminating infrastructure management while enabling automatic high availability and a pay-per-usage pricing model. 1. **Executing event-driven code using AWS Lambda functions** (05:19) — Using managed compute environments to run isolated functions triggered by external services like API gateways or message queues. 1. **Creating and testing a basic Lambda function** (08:04) — Implementing a basic event handler and simulating direct invocations within the cloud management console. 1. **Running Swift code with custom Lambda runtimes** (11:29) — Leveraging loops to periodically fetch execution events inside Amazon Linux micro virtual machine environments. 1. **Managing AWS events using the Swift Lambda runtime** (14:47) — Importing official server-side packages to process strongly-typed cloud API requests and execution context metadata. 1. **Optimizing function performance with Swift NIO event loops** (18:46) — Bypassing thread creation by implementing custom interfaces that execute logic directly on non-blocking IO event loops. 1. **Packaging Swift binaries for Amazon Linux via Docker** (21:36) — Using containerized compiler toolchains to generate target-compatible executables and package shared libraries into zip deployment archives. 1. **Scaffolding local Lambda projects with the Slam utility** (25:18) — Automating directory creation, docker configuration, and target builds via an open-source scaffold terminal command. 1. **Defining serverless architectures with Serverless Application Model** (30:41) — Automating repeatable deployments of connected resources by declaring serverless functions and routing configurations as code templates. 1. **Testing Serverless APIs locally and via AWS environments** (35:59) — Invoking containerized logic using curl terminal commands against both local handler servers and cloud-provisioned gateways. 1. **Integrating other cloud services using the Soto project** (39:41) — Incorporating community-driven software development kits to securely query separate storage buckets directly from custom handlers. 1. **Recapping serverless architectures and Swift cloud integrations** (45:19) — Reviewing core platform benefits and the developer toolchains required to correctly implement production serverless workflows. ## Related Moments - [Executing traditional web frameworks inside serverless environments](https://www.wearedevelopers.com/videos/1624-30-powerful-aws-hacks-in-just-30-minutes-boost-your-developer-productivity) (from "30 powerful AWS hacks in just 30 minutes: Boost your developer productivity") - [Real-world challenges in adopting serverless architectures](https://www.wearedevelopers.com/videos/56-end-the-monolith-lessons-learned-adopting-serverless) (from "End the Monolith! Lessons learned adopting Serverless") - [Discussing history and enterprise adoption of serverless](https://www.wearedevelopers.com/videos/34-serverless-past-present-and-future) (from "Serverless: Past, Present and Future") - [Comparing serverless functions against traditional monolithic architectures](https://www.wearedevelopers.com/videos/590-building-your-way-to-a-serverless-powered-iot-buzzwire-game) (from "Building your way to a serverless powered IOT Buzzwire game") - [Exploring hybrid models, monoliths, and serverless computing](https://www.wearedevelopers.com/videos/261-why-you-shouldn-t-build-a-microservice-architecture) (from "Why you shouldn’t build a microservice architecture ") - [Introduction to going serverless with Spring Framework](https://www.wearedevelopers.com/videos/443-going-serverless-using-the-spring-framework-ecosystem) (from "Going serverless using the Spring Framework ecosystem") ## Related Articles - [Web Development Best Practices: What The Data Tells us](https://www.wearedevelopers.com/magazine/84-web-development-best-practices-what-the-data-tells-us) - [Dev Digest 120 - Apple and peers](https://www.wearedevelopers.com/magazine/455-dev-digest-120-apple-and-peers) - [Dev Digest 138 - Are you secure about this?](https://www.wearedevelopers.com/magazine/486-dev-digest-138-are-you-secure-about-this) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) ## Related Jobs - [Software Engineer L2 - Cloud Infrastructure](https://www.wearedevelopers.com/jobs/ext/1293339-software-engineer-l2-cloud-infrastructure) at **Twilio** - [Software Engineer L2 - Cloud Infrastructure](https://www.wearedevelopers.com/jobs/ext/1282024-software-engineer-l2-cloud-infrastructure) at **Twilio** - [Software Engineer, Platform Engineering (L2)](https://www.wearedevelopers.com/jobs/ext/1956829-software-engineer-platform-engineering-l2) at **Twilio** - [Software Engineer L2 - Cloud Infrastructure](https://www.wearedevelopers.com/jobs/ext/1644423-software-engineer-l2-cloud-infrastructure) at **Twilio** - [Software Engineer, Identity](https://www.wearedevelopers.com/jobs/ext/1713561-software-engineer-identity) at **Twilio** - [Software Engineer (L2) Segment Team](https://www.wearedevelopers.com/jobs/ext/238794-software-engineer-l2-segment-team) at **Twilio**