Abstract
Niconico is a video sharing and a live streaming platform operated by Dwango. Dwango uses Scala widely for foundation systems such as an account system, a billing system and an event bus for inter-services. In this talk, we will introduce how to build web applications by using continuation monads. This approach is mainly used in the Niconico account system.
The Niconico account system has the following requirements:
- Various requests
- Various user registration leads
- OAuth logins (Google, Facebook, Twitter, etc.)
- Multi-factor authentication
- Various responses
- HTML Pages (in Japanese, English and Chinese)
- JSON and XML
- Redirects
- Various filterings
- CSRF check
- Add CORS headers
- User tracking
The Niconico account system is developed with Play framework which is one of the most popular web framework in Scala. Play framework has component technologies for building web applications. But the composition functionality of Play framework is insufficient to our requirements. Therefore, we decided to use components of continuation monads instead of the standard technique of Play framework. We believe that our approach can also be applied to other languages, because a web framework often has similar nested structures such as Java Servlet, Python WSGI, and so on.
This talk will be a detailed explanation of the topic presented at ScalaMatsuri 2016.
Our prototype implementation has been published on GitHub.