Want to explore "what if"?

Swift Backend Development

Written by NicRole: Principal Consultant - Mobile

Swift and AWS Lambda logos

I have been developing software for a while starting with industrial control systems and real-time C, moving through Java and .Net full stack solutions and then to mobile app development. I have now spent the last few years building iOS/iPadOS/TVOS apps starting with Objective C and then moving to Swift.
Many of the solutions that we work with have an experience API that is built using serverless technologies, like AWS lambdas. Having worked on back end solutions in the past it would be great to go further down the stack, creating mobile optimised API's. But without having to jump into with a loosely typed language or jump back to using Java or .Net.

From a purely selfish point of view I would like to use the same language for my app and experience api development, reducing context switching. So here comes the The Swift AWS Lambda Runtime.

Swift AWS Lambda Runtime was designed to make building Lambda functions in Swift simple and safe. The library is an implementation of the AWS Lambda Runtime API and uses an embedded asynchronous HTTP Client based on SwiftNIO that is fine-tuned for performance in the AWS Runtime context.

The benefits for a swift developer are:

  • A familiar language
  • Less context switching
  • Potential for shared code
  • Swift is a type safe language
  • Swift cold starts and performance in Lambdas is really fast.

There are a surprisingly small number of dependencies for a basic Lambda, and these can be managed through Swift Package Manager which is familiar to all swift developers. Starting with MacOS 26, Apple Containers have been released which should also simplify containerisation and reduce the need for installing Docker, making it even easier.

The drawbacks are being a relatively new option the AWS swift support relies on a custom runtime, this is currently at version 2.0 and still considered a beta. There is currently a small development community meaning there are less examples and options to gain support, and there is a smaller pool of supporting libraries, compared to other options.

Overall as an iOS developer using Swift on the backend appeals to me. It looks like the technology is maturing and adopting it right now might be a bit too bleeding edge. This is definitely something that I think has great potential and I will be keeping an eye on for the future.

Written by NicRole: Principal Consultant - Mobile