06/01/2023
We are pleased to announce the release of Thorium. Thorium is a clean and simple microservices framework that is built on top of Armeria, Scala 3 and Java 17.
Its goal is to allow a developer to create a microservices app easily in Scala 3 and benefit from the awesome features of Armeria and modern Java.
Why was Thorium created? After the announcement by Typesafe of the transition from Scala 2 to Scala 3, our only option was to migrate all our internal libraries to Scala 3 to future-proof our Scala applications. This was especially important as a couple of our core libraries were using Scala 2 macros.
We started our library migration journey during the early days of Dotty. The hardest part was finding solutions to transit from deprecated Scala 2 macros to the new Dotty's macros. This took us a long time with lots of learning, unlearning and relearning, especially for Scala 3 macros.
After our libraries are migrated, we waited for Play Framework to release a Scala 3 version. Not long after, it dawned on us that the Scala 3 version would not be available any time soon.
Without a Scala 3 Play Framework, all our migration efforts would have been wasted. A Play Framework alternative was needed. Our requirement was simple: it had to be compatible with Play Framework, able to support Scala 3 and preferably modern Java.
Our search began and ended with the conclusion that we needed to BYO (Build Your Own).
We have built many libraries, but to build an alternative to Play Framework was a daunting task given the time and resource constraints we were facing. This has to be done fast, as we also realised it would entail much time and effort to port our Play applications to the new framework.
We decided to take the plunge albeit with significant risk.
First, we needed to find a robust and well tested, well documented network layer, and Netty came to mind. It was during the search for Netty that we discovered Armeria. Thanks to this talk by Trustin Lee (Armeria: The Only Thrift/gRPC/REST Microservice Framework You'll Need).
We did some quick prototyping with Armeria, and it seemed possible to build on it to satisfy our requirement. Thus, Thorium was born.
Thanks to Scala 3 awesome macros, we managed to create Thorium and a Form Binding (Data-Mapping) library. In addition, we released another 5 supporting libraries as open-source projects to give developers the option to choose between libraries that best meet their needs.
In all, we took about 7 months to develop Thorium and Data-Mapping and another 2 months to port our 14 Play Framework apps to Thorium. Now, these apps are enjoying the goodness of Armeria, Scala 3 and Java 17.
https://thoriumframework.dev/