Kotlin Serverless Landscape

Nick Apperley
3 min readJun 30, 2018

--

There are a few Serverless options available but not all of these options will have official Kotlin support. Much of the official support is experimental. Included below are major FaaS and Open Serverless platforms to consider when doing Serverless development with Kotlin.

FaaS Platforms

When Serverless was first coined the first type of Serverless platforms to appear were FaaS. Many of the FaaS platforms lack official Kotlin support but are usable if you want to use Kotlin JVM (except for Google Cloud Functions).

AWS Lambda

The first FaaS platform to be launched and also the one with the strongest programming language support. Doesn’t officially provide Kotlin support and to make things even more confusing has official Kotlin (via Kotlin JVM) samples (Serverless Photo Recognition and Cognito Proxy REST Service) even though Kotlin isn’t supported. Unofficially Kotlin programs (via Kotlin JVM) can be run by AWS Lambda through the Java runtime.

Google Cloud Functions

Has the weakest programming language support out of all the FaaS platforms (only supports JavaScript), and doesn’t officially support Kotlin. Unofficially Kotlin programs using Kotlin JS can be run on Google Cloud Functions.

Azure Functions

Provides support for multiple programming languages but heavily favours .NET based languages (C#, F#). Doesn’t provide official Kotlin support (at the moment) but a experimental Kotlin runtime is currently under development. Remains unknown which Kotlin platforms will be supported (Kotlin JS, Kotlin JVM, Kotlin Native). Unofficially Kotlin programs (via Kotlin JVM) can be run through the experimental Java runtime.

Open Serverless Platforms

These platforms are more likely to provide Kotlin support (either officially or by the community), especially for Kotlin Native. Often these platforms (Docker based) can be used on more than one proprietary Cloud service making switching between these services very easy.

Open Whisk

Originally developed by IBM before ownership was transferred to the ASF (Apache Software Foundation). Open Whisk is mainly written in Scala and uses the Apache 2 license. Kotlin isn’t officially supported however there is a experimental Kotlin runtime under development (for Kotlin JVM only). Support for Kotlin Native is being considered. Unofficially Kotlin programs (via Kotlin JVM) can be run through the Java runtime.

Fn Project

Developed by a independent company before being bought out by Oracle. The Fn project is mainly written in Go and uses the Apache 2 license. Kotlin is officially supported (Kotlin JVM only) although there isn’t a official code sample.

OpenFaaS

The biggest Open Serverless platform which unlike the other options is developed/owned by the community. OpenFaaS is mainly written in Go and uses the Mit license. Important to note that the project is backed by VMWare who has hired the founder (Alex Ellis) to work on the project fulltime. Kotlin is supported by the community (Kotlin Native only) and there is a code sample; Disclaimer: I work on the Kotlin support for the OpenFaaS project.

Conclusion

Regardless of which Serverless option you might go for keep in mind that Open Serverless platforms are preferable over FaaS platforms for the following reasons:

  • They don’t have vendor lock in
  • Easier to get started with and use
  • Provide a straightforward way to test/debug Serverless Functions
  • Use a Open Source license (can be customised and maintained by a third party)
  • Supports a greater number of programming languages

--

--

No responses yet