What would help you use Server Side Swift with AWS

swift on AWS could always use more documentation. i can’t really think of any topics in particular, since the resources are so sparse to begin with.

we could definitely use more EC2 tutorials; Lambda seems to be a bit more well-trodden.

however most of the issues i am currently dealing with aren’t specific to AWS/EC2, but are more general issues with using swift on linux.

for example, memory/heap profiling swift applications just doesn’t work on linux (1, 2). this affects all swift on linux users, but especially EC2 users, since EC2 is a very memory-constrained environment. my deployment target (a t2 nano instance) has just ~700 MB of memory available for swift, and a lot of that is eaten up by Foundation and the runtime.

because i don’t have access to heap profiling tools, i have to code very defensively for EC2, which hampers my productivity, since i have to preemptively optimize just about everything.

swift doesn’t have a native compression library, so we have to rely on zlib wrappers. it’s worth mentioning that the swift-png library actually has a high-performance LZ77 implementation, but i have not had time to spin that off into a consumable package. (contributors welcome!)

the (poor) state of swift-system is also a major obstacle for server-side swift applications. however the general vibe i am getting is that people in Apple are aware of this, are prioritizing it, and it may improve over the next 1–2 years.

SwiftNIO doesn’t speak async/await. its reliance on ByteBuffer and the low uptake of generics in the library ecosystem also make it hard to integrate SwiftNIO with other packages.

my main issue with Vapor is it evolves rapidly and most of the documentation that Google has indexed is severely out of date. its API reference is also somewhat labyrinthine and hard to navigate.

14 Likes