Live data from Hacker News

Is this how news.ycombinator.com runs? (Ctrl+F for "Closures Simulate Subroutines")

lib.store.yahoo.net

21–23 of 23 posts

Re: Is this how news.ycombinator.com runs? (Ctrl+F for "Closures Simulate Subroutines")

#21
post #17

Paul, could you enlighten us how well does this type of development (Lisp macro/closure based) integrate with JS and Ajax? I'm interested in asynchronicity of the Ajax... Ruby and Python with Protoype and Scriptaculous make this very easy indeed...

In my experience with Seaside (which uses roughly the same technique), extremely well. There's a demo site at http://scriptaculous.seasidehosting.st/, fwiw.

Re: Is this how news.ycombinator.com runs? (Ctrl+F for "Closures Simulate Subroutines")

#22
post #19
post #6

Earlier quoted context omitted.

For calls that don't need to know about more state than their arguments, we just use an ordinary url with arguments. Otherwise we make a closure and store it in a hash table in memory, and make the url be x?fnid= where the argument is the hash key. When an http request comes in, we call the corresponding closure. Sometimes what to do next after following a link generated by the closure (e.g. what to do after logging…

What extra data is in the closure for "reply" that means it isn't a simple URL? Is it just what to do after the reply is complete, i.e. what post to return to viewing? Is there a reason this isn't taken from the Referer instead? I guess this technique doesn't scale too well unless the hash table is either shared across servers or a user is kept on one server, which then causes problems of its own. I'm guessing 20,000…

What particular problems are caused by the user being kept on one server?

Re: Is this how news.ycombinator.com runs? (Ctrl+F for "Closures Simulate Subroutines")

#23
post #19

Earlier quoted context omitted.

What extra data is in the closure for "reply" that means it isn't a simple URL? Is it just what to do after the reply is complete, i.e. what post to return to viewing? Is there a reason this isn't taken from the Referer instead? I guess this technique doesn't scale too well unless the hash table is either shared across servers or a user is kept on one server, which then causes problems of its own. I'm guessing 20,000…

What particular problems are caused by the user being kept on one server?

The redundancy of having five servers isn't helping if I'm always served by server #3, whereas an alternate method where any one of the five can answer my current request allows a machine to fail, or be taken down for upgrading, and the load on the other four just increases by 25% each.
Post reply on HN