Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What actor based web frameworks are available for Scala?

I need to build very concurrent web service which will expose REST based API for JavaScript (front end) and Rails (back end). Web service will be suiting data access API to MongoDB.

I already wrote an initial implementation using NodeJS and would like to try Scala based solution. I'm also considering Erlang, for which every web framework is actor based.

So I'm looking for web framework explicitly build using Actors in order to support massive load of requests I'm very new to Scala and I don't quite understand how Actor might work if almost all frameworks for Scala are based on Java servlets which creates a thread on each request which will just exhaust all resources in my scenario.

like image 915
sha1dy Avatar asked Nov 17 '10 20:11

sha1dy


People also ask

What is Scala web framework?

Scalatra is a simple, accessible and free web micro-framework. It combines the power of the JVM with the beauty and brevity of Scala, helping you quickly build high-performance web sites and APIs.

Which framework is developed using Scala?

Lift. Web framework. Written in Scala. Built with sbt (formerly with Maven).

Can you use Scala for Web development?

Any developer can easily learn Scala, which is the best programming language in the market. They can also make use of the existing OOP knowledge. Scala consists of clear syntax, the best libraries along with the best online documentation. Many industry people are using it at present.

Why Scala is better than Python?

When it comes to performance, Scala is the clear winner over Python. One reason Scala wins on performance is that it is a statically typed programming language and Python is a dynamically typed programming language. With statically typed languages, the compiler knows each variable or expression at runtime.


2 Answers

  1. If you're really going to have 10k+ long active connections at a time, then any standard Java application server/framework (maybe, except for Netty) will not work for you - all of them are consuming lots of memory (even if any kind of smart NIO is used). You'd better stick to a clustered event-loop based solution (like node.js that you've already tried), mongrel backed with zeroMQ, nginx with the mode for writing into MQ polled by Scala Actors, etc.

  2. Among the Scala/Java frameworks, Lift has a good async support for REST (though it's not directly tied to actors). OTOH, LinkedIn uses Scalatra + stdlib actors for their REST services behind Signal ,and feels just fine.

like image 94
Vasil Remeniuk Avatar answered Oct 13 '22 21:10

Vasil Remeniuk


Another option is Play framework. The latest 1.1 release supports Scala. It also supports akka as a module.

like image 42
Andrew Dyster Avatar answered Oct 13 '22 20:10

Andrew Dyster