3

I'm building a reverse proxy from scratch. The requirements are:

1) Super scalable. It must handle a lot of concurrent requests (also streaming, 1000 request/second would be a good performance in my case)
2) Super fast (non blocking).
3) No C/C++ or Erlang
4) Easy to mantain - even if it was, Assembly is not an option :)

After some research, most of people suggests using node.js or Scala - what do you think is the best solution for this kind of job? Which technologies would you use to build this kind of proxy?

Thanks

Mark
  • 62,540
  • 45
  • 115
  • 156
  • 1
    Super scalable and fast is not a very clear requirement. Do you have a more quantifiable use case? – Tobu Jun 23 '11 at 23:00
  • node.js can handle it. I don't really know the advantages of node.js vs Scala but I like node so that's got my vote ;) – Raynos Jun 23 '11 at 23:04
  • 4
    There are some pretty good high-performance reverse proxies out there all ready... Nginx, HAProxy etc. What does yours need to do that they don't? – nicolaskruchten Jun 24 '11 at 01:55

3 Answers3

4

Personally I'd try out this guy first.

Just to expound a bit, people who said "try node.js or Scala" are slightly misguided in that Scala—like Java—is just a programming language, whereas node.js is most of a platform. Apart from its general advantages, the main things Scala brings to the table for this kind of project are:

  1. A juicy bit of syntax that makes it easier to write actor systems as libraries, namely PartialFunction "literals":

    trait NeedsAPF {
      def pf: PartialFunction[Any,Unit]
    }
    
    object PFHaver extends NeedsAPF {
      def pf = {
        case i: Int => println("I got an int and it was " + i)
      }
    }
    
  2. When you're ready for it, a continuations plugin, which lets you write code that looks synchronous, but can be asynchronous under the covers.

Community
  • 1
  • 1
Alex Cruise
  • 7,789
  • 1
  • 25
  • 38
0

I'd take a look at: https://github.com/nodejitsu/node-http-proxy as it satisfies all of your requirements. I'm not sure why there's a need to build it from scratch, but I suppose if you decide to build it in node, you can certainly at least take inspiration from this.

ctide
  • 5,137
  • 1
  • 28
  • 26
-1

Scala should be good enough, but you'll need to use NIO a lot, which means you'll probably be in close contact with Java's NIO library. I don't know if any of the libraries available in Scala will help you in this, but, then again, it's your job to look it up, not mine. :-)

Daniel C. Sobral
  • 290,652
  • 84
  • 491
  • 673