Xitrum @ Scala Conference in Japan 2013

Embed Size (px)

Citation preview

Xitrum - a Scala framework inspired by Rails

Scala Conference in Japan 2013Ngoc ()

Slides are in English,but because there are many Japanesein the audience,I will try talk in Japanese

Self introduction

Ngoc (), from Vietnam

Working in Tokyo, at Mobilus:
http://mobilus.co.jp

Creating chat systems for smartphones using Scala

What is Xitrum

Scala web framework + standalone HTTP(S) server

Inspired by Rails, not a Rails clone

Main features: async and clustered

Clustering is in-process:
- Very fast
- You don't need a separate server, e.g. Redis, memcached

Based on Netty, Hazelcast, and Akka:
- Netty => async IO
- Hazelcast => clustered data
(may be removed when Akka's clustering feature is mature)
- Akka => remote code (not clustered code yet)

Clustering feature in Akka 2.1 is still experimental, hope Akka 2.2 will be released soon

One instance

Cluster

Akka

Why I created Xitrum

I came to Scala in 2010, from Ruby

In 2010, Play did not support Scala

There was Scalatra and Lift, but:
- Scalatra did not have many features
- Lift was not easy to use (from a Rubyist perspective)

=> I decided to create something in between:
- More featureful than Scalatra
- Easier to use than Lift

Scalatra Lift

I have used used Xitrum in most of my projects: chat systems, API server for smartphones, realtime web sites etc.

Xitrum features

Async and clustered

WebSocket, SockJS (like Socket.IO, but easier)

Routes are collected automatically, like JAX-RS

Scalate template engine

i18n based on GNU gettext

Standalone HTTP(S) server: serves static files very fast
- Small files are cached in memory
- Big files are sent using NIOs zero copy

Many more, see:
http://ngocdaothanh.github.com/xitrum/

Demo

Online demo:
http://ngocdaothanh.github.com/xitrum/

Source code:
https://github.com/ngocdaothanh/xitrum-demos

I will show you:

Routes collecting

Clustering