Slashdot Mirror


Collaborative Map-Reduce In the Browser

igrigorik writes "The generality and simplicity of Google's Map-Reduce is what makes it such a powerful tool. However, what if instead of using proprietary protocols we could crowd-source the CPU power of millions of users online every day? Javascript is the most widely deployed language — every browser can run it — and we could use it to push the job to the client. Then, all we would need is a browser and an HTTP server to power our self-assembling supercomputer (proof of concept + code). Imagine if all it took to join a compute job was to open a URL."

16 of 188 comments (clear)

  1. Random Thoughts by AKAImBatman · · Score: 5, Interesting

    Two comments:

    1. He places the map/emit/reduce functions in the page itself. This is unnecessary. Since Javascript can easily be passed around in text form, the packet that initializes the job can pass a map/emit/reduce function to run. e.g.:

    var myfunc = eval("(function() { /*do stuff*/ })");

    In fact, the entire architecture would work more smoothly using AJAX with either JSON or XML rather than passing the data around as HTML content. As a bonus, new types of jobs can be injected into the compute cluster at any time.

    2. Both Gears and HTML5 have background threads for this sort of thing. Since abusing the primary thread tends to lock the browser, it's much better to make use of one of these facilities whenever possible. Especially since multithreading appears to be well supported by the next batch of browser releases.

    (As an aside, I realize this is just a proof of concept. I'm merely adding my 2 cents worth on a realistic implementation. ;-))

  2. Join compute cloud by Imagix · · Score: 4, Insightful

    We already have that. See botnets.

  3. BOINC by Chabo · · Score: 4, Insightful

    If you were really interested enough to donate your CPU cycles, is it really that much harder to install BOINC, and get a job running?

    Plus then you can run native code instead of having to run in [shudder]Javascript[/shudder].

    --
    Convert FLACs to a portable format with FlacSquisher
  4. Noscript by sakdoctor · · Score: 4, Informative

    Progress is running less JavaScript, not more.

    1. Re:Noscript by OzPeter · · Score: 5, Funny

      Sir, I have the '80s on hold on the phone at the moment. They want to know if you want to by some stuff called .. umm .. hang on .. yes here it is .. "static HTML pages" ..

      --
      I am Slashdot. Are you Slashdot as well?
    2. Re:Noscript by wirelessbuzzers · · Score: 4, Insightful

      Actually it was the '90s, but whatever. The thing is, non-DHTML web pages are actually pretty good for most things... what made those early '90s web pages so awful was no CSS, slow connections, and the fact that people really didn't know how to design for this new medium.

      Probably 99% of the web still shouldn't need Javascript or flash, though pages usually do need to be dynamic on the server side.

      --
      I hereby place the above post in the public domain.
  5. Would this work for music? by Anonymous Coward · · Score: 4, Funny

    You could also use this to index the MP3 files on everybody's hard drives, then share the music just by visiting a URL!! ... oh wait...

  6. Re:Botnet by MonoSynth · · Score: 5, Insightful

    With ever-increasing JavaScript performance, there's a lot of cpu power available for cracking passwords and captcha's... Just include the code in an ad and you're done. No tricky installs needed, just the idletime of the user's web browser.

  7. Why? Why? WHYWHYWHYWHY??? by wirelessbuzzers · · Score: 5, Insightful

    Javascript really isn't suited for this kind of thing, even with worker threads, for two reasons I can think of. First, web clients are transient... they'd have to report back often in case the user clicks away.

    But more importantly, Javascript just isn't a good language for massive computation. It only supports one kind of number (double), has no vectorization or multicore capabilities, has no unboxed arrays, and even for basically scalar code is some 40x slower than C, let alone optimized ASM compute kernels. (This is for crypto on Google Chrome. Other browsers are considerably slower on this benchmark. YMMV.)

    --
    I hereby place the above post in the public domain.
  8. Link by Jamamala · · Score: 5, Informative

    for those like myself that had no idea what MapReduce was:
    http://en.wikipedia.org/wiki/MapReduce

    1. Re:Link by MarkGriz · · Score: 5, Insightful

      Thank you. Nice that we have "volunteer" editors, since slashdot doesn't seem to employ them any longer.

      --
      Beauty is in the eye of the beerholder.
    2. Re:Link by Anonymous Coward · · Score: 4, Funny

      So had I; here's a link: http://www.google.com

  9. MapReduce fanboyism by Estanislao+Mart�nez · · Score: 5, Insightful

    Oh, please, make the MapReduce fanboyism stop.

    Yes, it's a neat technique. It's also very old and obvious. Google's implementation is also good, but this stuff is just not rocket surgery. It's just a simple pattern of how to massively parallelize some types of computational tasks.

    But somehow, just because some dudes at Google wrote a paper about it, it's become the second coming of Alan Turing or something among some silly folks. Hell, a couple of weeks ago somebody was saying on the comments here that MapReduce was a good alternative to relational databases. Now that is silly.

  10. Pay Me by Doc+Ruby · · Score: 4, Interesting

    If there were a couple-few or more orgs competing to use my extra cycles, outbidding each other with money in my account buying my cycles, I might trust them to control those extra cycles. If they sold time on their distributed supercomputer, they'd have money to pay me.

    As a variation, I wouldn't be surprised to see Google distribute its own computing load onto the browsers creating that load.

    Though both models raise the question of how to protect that distributed computing from being attacked by someone hostile, poisoning the results to damage the central controller's value from it (or its core business).

    --

    --
    make install -not war

  11. Scripts taking too long by Anonymous Coward · · Score: 4, Funny

    Is this why my browser keeps telling me scripts on the slashdot main page are taking too long and do I want to stop them for the last few months?

  12. Re:Why? Why? WHYWHYWHYWHY??? by Instine · · Score: 4, Insightful

    and you don't think you could get 100 times more users to visit your web app than you could convince to download and install an exe?

    --
    Because you can - or because you should?