I'm looking at the scouchdb Scala view server and trying to write my own version that doesn't compile arbitrary Scala code but simply links to existing, pre-compiled classes. I have a question about the way view servers work, though:
Does each view create its own command process (and thus JVM)? I started down a garden path of using Akka remote actors to link the view server calls to objects that actually perform the work but I'm noticing that an "add_fun" call doesn't say what view its associated with, so I have to assume that each view instantiates its own JVM, helper objects, etc... Does it call the command-line I give it (right now a Bash script that calls my Scala class) for every request of the view or does it reuse processes already started (like pooling)? The more I get into this, the less feasible it seems to tie some JVM-based view language to Couch and still keep it performant. What about the Erlang to Java bridge (JInterface)? Could this be used instead of the command-line style view server to hook into a long-running JVM process (like Akka remote Actors)? Thanks! J. Brisbin http://jbrisbin.com/
