Foursquare が Scala + Lift で書き直された件 00:48

Posted at 2010/02/18 00:48, Modified at 2010/02/18 01:09

Foursquare は位置情報系のサービスで、Google に買収されて

It's no real secret that Google wasn't supporting dodgeball the way we expected. The whole experience was incredibly frustrating for us - especially as we couldn't convince them that dodgeball was worth engineering resources, leaving us to watch as other startups got to innovate in the mobile + social space.

Flickr に写真をのこして 去っていった ex-Dodgeball の Dennis Crowley がやっている。それが最近 Scala + Lift で書き直されたというので、主導した Harry Heymann (彼も Dodgeball -> Google -> Foursquare) の foursquare.com & scala/lift というスライドを読んでみた。

Foursquare はもともと Apache + MySQL + PHP で書かれていたのだけど、彼いわくそれは

Written by someone who wasn't an engineer. Poor code quality.

だったらしい。スライドは短いので要約は無し。

Lift

Scala が良いのはわかっているけど Lift は

Lift doesn't play very well with MySQL. We switched to PostgreSQL, and had a disastrous downtime filled weekend fixing various bugs (mostly on the PHP side of things) that cropped up because of differences. If you're starting a Lift project go with PostgreSQL from day 1

とか

Lift has stateful servers. Ultimately this will lead to challenges in production, though it hasn't been too bad so far.

とか、まだちょっと微妙に思った。状態を持ってしまうことについて Harry Heymann の The Lift Web Framework というスライド (前述のスライドより古い) には

Foursquare currently using nginx to route requests based on the session cookie.

ともあった。スケーラビリティへの不安と「REST っぽいのがいけてる」という個人的な好みはあるんだけど、毛嫌いするほどのものではないんだろうか。

3 comments
morita : Servlet の state というか Session って実装によってはプロセス外に押し出せるんじゃ...とおもったらなぜか servlet の session を使わず lift 内に連想配列をもってますね(LiftSession.scala)。ショックです。Servlet の session を使わないのには事情がありそうですが、なんとかこいつをプロセス外に追いだせるよう pluggable に直すのは web+scala プログラマとしてちょうどいい挑戦なんじゃないでしょうか。Actor はさておき。REST ぽさは悩ましいけど、なんとか頑張れないのかなー。 (2010/02/20 00:41)
kzys : さすが読むの速い。Java で実績あるフレームワーク + glue としての Scala って構成に逃げようかと思ってたんだけど、ちょっと見てみます。 (2010/02/20 01:56)
morita : なるほど。Java のフレームワークを使うのはそれはそれで面白いのかも。 (2010/02/20 07:38)
riddle for guest comment authorization:
Where is the capital city of Japan? ...

blog.8-p.info加藤和良 の個人的なブログで、プログラミングのはなしが多めです。