from Hacker News

Diaspora re-writes its front to Backbone: why and what it means

by plunchete on 1/10/12, 7:10 PM with 58 comments

  • by jashkenas on 1/10/12, 8:23 PM

    The way that this post describes porting and existing interface from server-side/ajax rendering to client-side rendering is particularly interesting -- I imagine that there aren't many apps that have made that jump after first being built around server-side templates.

    The speed benefits that Diaspora is seeing from distributing their HTML rendering is probably only the first step. There are so many more interesting interactions you can accomplish once your data is being modeled in the browser.

  • by AznHisoka on 1/11/12, 1:25 AM

    This is the biggest win for Diaspora? Really? Sounds like they've been deluded by all those NYU CS professors who think knowing how to add 32 bit floating point numbers is the key to success.

    Just dump everything, spend 1% of your time rewriting everything in PHP, and the rest actually doing some marketing, not imaginary work.

  • by tripzilch on 1/10/12, 10:14 PM

    Maybe this is a really stupid question, but wasn't Diaspora supposed to be decentralized? In the sense that anybody could set up their own hub? (so people would not have to accept features pushed by some big corporation and things like that)

    Then what is this whole database backend for? Is it like the "main" Diaspora hub? And could anyone set up their own secondary one? Would they run into the same difficulties they're trying to solve here?

    Though I get the feeling I'm probably misunderstanding the entire Diaspora project, here.

  • by ferrofluid on 1/10/12, 9:29 PM

    Sorry, I don't know what "Backbone" is. I see links to New Relic and Pivotal Labs, but no links to anything called "Backbone".

    I guess this blog post was maybe not meant for purely technical people, but it would be nice to understand what "Backbone" is, and exactly why it would solve their problems.

  • by JoachimSchipper on 1/11/12, 5:40 AM

    500ms+ for rendering a template seems ridiculous. Were they just Doing It Wrong, Ruby-wise?
  • by charliesome on 1/10/12, 10:40 PM

    It sounds like they were jumping to conclusions regarding the templating being responsible for creating a large number of objects.

    ERB, Haml (which is what Diaspora uses), and any other templating engine I've seen use either concat or << when rendering a template. These never create a new object, they mutate (and perhaps resize) the original string.

    Maybe next time they should profile better before following their gut feeling and rewriting their front end ;)

  • by peterhunt on 1/11/12, 4:52 AM

    I'm coming from a Python perspective; no idea if this is easy/possible in Ruby.

    Maybe this is a really stupid idea, but what if we gasp disabled the GC during the course of each request and did a collection run after the request is completed and before the next one is accepted? With a sufficient number of workers, wouldn't this solve some of the problems they were having?

  • by memoryfault on 1/11/12, 7:24 AM

    This post made me curious to learn more about new relic and their architecture. I found this post pretty interesting: http://highscalability.com/blog/2011/7/18/new-relic-architec...
  • by gaius on 1/10/12, 10:09 PM

    Does it mean they won't blow away all their user accounts when they get bored and start again? No? Well that is why Diaspora is a joke.
  • by charlesju on 1/10/12, 10:01 PM

    Is there a main deployment of Diaspora somewhere? Or is this a purely academic project?
  • by emehrkay on 1/11/12, 5:16 AM

    okay http://i.imgur.com/jHu1N.png

    this is from webkit nightly after I clicked a user name and got a "you messed up" 404 page and went back

  • by marcosvm on 1/10/12, 9:35 PM

    Rewriting the front-end using Javascript and Backbone won't fix the backend problems necessarily. How about reducing the objects creation and tuning the backend too?
  • by bionicbrian on 1/11/12, 1:10 AM

    Rad! That graph is awesome!

    Also cool that the source is public on Github. thanks for that. Always fun to peek in on source.