Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a reverse proxy

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

like image 557
Mark Avatar asked Jul 08 '26 16:07

Mark


1 Answers

Personally I'd try out the Scala Finagle library 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)
     }
   }
  1. When you're ready for it, a continuations plugin, which lets you write code that looks synchronous, but can be asynchronous under the covers.
like image 187
Alex Cruise Avatar answered Jul 11 '26 11:07

Alex Cruise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!