August 7th, 2008

Fleeble the… webserver?

I had a flash of insight 2 days ago. Fleeble might make for a very interesting webserver. Fleeble is an agent framework I developed for my thesis. The basics are: Backend is java but agents can be a number of languages (in theory), all agents have separate threads and memory spaces. Communication between agents occurs by way of channels (You send or receive from a channel, never from another agent). All communications are copies, which complicates communication a lot, but it allows a lot of flexibility in where agents run. Agents can seamlessly truck across networks and computers.

Some of the things a Fleeble-based webserver could easily pull off:

Use a limited (single digits, never going up, no matter how many clients) amount of threads to handle any number of continuous connections (COMET jokes and such). Think Digg Spy. Serving the entirety of digg spy requests using 4 threads. Simply. No fuss. Very readable, very short code. What web framework, pray tell, pulls that off nicely?

Use multiple different languages to serve parts of the same request. This is an extreme example, but in general, you can mix and match programming languages to your hearts content. Anytime you let communications go across channels, your app no longer cares about what, or where, the other side is. You can do 99% of the gruntwork in Groovy or Python or some such, with some complicated hook someplace else. The key here is that you don’t have to jump through hoops to make it happen. It’s no more difficult than sticking to the same language.

‘Hook’ into the system. Anywhere. You could for example track your traffic without requiring participating pages to insert some sort of link to counting code, like in the case of slimstat. Makes it very easy to hack on some temporary solutions.

Update running systems. You can load, unload, reload and otherwise mess with agents in a very flexible manner. Anytime your dataflow crosses a channel path, it’ll swap to the updated code. Provided that your communication structure doesn’t change, or is capable of handling the ‘old’ standard, it’ll work.

Continuity. Boot up one agent to handle the entirety of the session for a single user. Think wizards - where your application no longer ‘exits’ when the data’s been served. It just goes to sleep until the user clicks something, or some sort of event occurs. Also extremely nice when serving up a game or chat or other 2+-interaction scheme through your webserver.

There are a lot of embarrassing problems I still have to hash out. For example, right now I have no easy way of realizing that no agents whatsoever are going to handle a request, which means I can’t generate a 404… it would just time out. Possibly a novel approach to foil URL guessing schemes, but that would be an excuse.

Still, it’s a sufficiently different way of writing webservers that it would actually be adding something to the world at large even if it ends up not working very well. Unfortunately some competition to the tipjar idea is beginning to take form (Alper spotted it) so that obviously has priority, but I’ll be working more on Fleeble during my off-hours again.

With some luck both will take off :-P

3 Responses to 'Fleeble the… webserver?'

  1. 1Robbert Jan
    May 7th, 2006 at 12:03

    Remember that during our research into agent frameworks, that we came across a handfull of agent frameworks that implemented a ’service library’? Essentially you could treat every request as a simple agent that requests a service from this library. A miss in the ‘library-cache’ would result in the agent returning a 404. In addition, an agent/service library happens to be a part of most ‘theoretical’ framework-interaction schemes, such as MAF and the FIPA agent standard… by jove… it amazes me I still remember this stuff…


  2. 2Cristiano Betta
    May 7th, 2006 at 12:49

    it realy sounds promising, but I have to see how it will turn out…. Can this maybe also solve some tipjar issues we had (security related)?


  3. 3rzwitserloot
    May 7th, 2006 at 15:32

    Definitely. Hell, if I find some way to run PHP inside JVMs, I can offload any parts I dislike PHP for (like random number generation) to a java-based agent, if it comes to that. It also makes it very easy to replace parts the codebase to another language one at a time. While the system never goes down.


Leave a Response

(Note: if you use a new name from an unknown ip address, your comment won't appear until I approve it. Anti-spam measure only, I don't censor).

Imhotep theme designed by Chris Lin. Proudly powered by Wordpress.
XHTML | CSS | RSS | Comments RSS