Live data from Hacker News

Rails is just an API

blog.alexmaccaw.com

51–60 of 114 posts

Re: Rails is just an API

#51
post #45

I tried this approach and it's clearly attractive, but it also has some disadvantages. I decided to switch back to rendering static HTML in Django (not a Rails guy), with just a little JS on top for now. These are my main reasons: - Debugging on every browser was quite painful. I tried to support IE7+ as well. If a server-side code works, it works for everyone. - Frameworks on the client-side are not as developed as…

Twitter is a perfect example of a "thick client". It's slow, bloated and buggy. When one typo is made in the JavaScript "bundle", the whole site implodes, leaving the user with simply the navigation bar. When JavaScript is turned off, most functionality is lost. I couldn't even log out after disabling JavaScript because "/logout" pointed to a hash.

JavaScript being enabled is not an axiom. The client is a very unstable platform when juxtaposed with the server. A lightweight client facilitates flexibility.

Re: Rails is just an API

#52
post #46

Let's say you have a website and let's say that website serves a lot of traffic. Now let's say you relegate Rails to act as just your API because clients are fast now and you want to do some new cool stuff with Javascript also, you're convinced your site is more like an "application". So you build this system and it works really well, except for one thing. The first time you load the page it takes a second or two min…

Twitter did not think Rails was particularly adequate at serving up anything (for their extreme needs), so they dumped it for the JVM. Charles Nutter is doing genius work with JRuby, btw, that's where Ruby has a future with the enterprise, on the JVM. Twitter dumping Rails for Scala was a major win for Odersky & friends, and a big hit to Rails (though Ruby/Rails continues to innovate, nothing has changed there) Not s…

Twitter didn't dump Rails, or Ruby.

Re: Rails is just an API

#53
post #43

Earlier quoted context omitted.

Rails isn't even participating in the fight It never did and it shouldn't. Rails became popular because with it developers had the ability to cut down on soul-sucking activities in their day to day jobs, like building yet another authorization system, or yet another admin. That some people ran with it and scaled it to its limits, that's only because they felt in love with its ease of getting things done. That's its m…

"Every big website on the web right now" Can you define big? I've worked on some big sites that used MRI ruby for APIs and we served a ton of traffic with strict SLAs for a max of 250ms at the 99th percentile and things like that.

oh, Twitter (Scala/Java), American Airlines (Java), Facebook (on HipHop in C++), Stackoverflow (C#), ESPN (Java)

I think by big that's a code word for enterprise.

The big sites you have worked on are comparatively small if Ruby is backing the show. That's not to take away from the ton of traffic that you guys were able to serve; it's just that there are few enterprise level Ruby backed sites running these days.

Github, I believe is one, but lately I've been getting the "unicorn is angry" icon when viewing repositories, so I wonder about scalability issues. For the record, I have never, ever seen a "unicorn is angry" icon on Twitter. Maybe switching to the JVM got rid of all the magic ;-)

Re: Rails is just an API

#54
post #52

Earlier quoted context omitted.

Twitter did not think Rails was particularly adequate at serving up anything (for their extreme needs), so they dumped it for the JVM. Charles Nutter is doing genius work with JRuby, btw, that's where Ruby has a future with the enterprise, on the JVM. Twitter dumping Rails for Scala was a major win for Odersky & friends, and a big hit to Rails (though Ruby/Rails continues to innovate, nothing has changed there) Not s…

Twitter didn't dump Rails, or Ruby.

Yes, you're correct, it was not an either-or proposition, I'm sorry, they dropped them both.

Seriously, I'm curious, what public facing, or any facing, components does Twitter use that is written in Ruby and/or Rails?

A Google search for "twitter rails" brings up the usual got dumped threads. A similar search, but this time, "twitter scala" brings up, as a first result "Scala School" for Twitter engineers, followed by a bunch of threads on the Twitter + Scala marriage.

Don't worry, Scala has its own issues (Yammer, for example, ditched Scala for Java due to, ironically enough, scalability issues).

Re: Rails is just an API

#55

This feels very conciliatory towards Rails, like that of a boss praising the employee he just demoted. I'm bearish on Rails because its maintainers don't want it to just be an API . The fight to become the best backend API is much different than the fight to become the best html server. Rails isn't even participating in the fight. Rails has a lot of cruft not needed in an API, Sinatra or Express feel much better for…

Rails isn't even participating in the fight It never did and it shouldn't. Rails became popular because with it developers had the ability to cut down on soul-sucking activities in their day to day jobs, like building yet another authorization system, or yet another admin. That some people ran with it and scaled it to its limits, that's only because they felt in love with its ease of getting things done. That's its m…

Every big website on the web right now (except Microsoft-stuff), runs either on top of the JVM or with custom-baked solutions written in C/C++.

What does that make Wikipedia (PHP), Craiglist (Perl), Wordpress (PHP) and Youtube (Python[1]) ?

[1]: http://www.quora.com/Is-YouTube-still-written-in-Python

Re: Rails is just an API

#56

Earlier quoted context omitted.

Rails isn't even participating in the fight It never did and it shouldn't. Rails became popular because with it developers had the ability to cut down on soul-sucking activities in their day to day jobs, like building yet another authorization system, or yet another admin. That some people ran with it and scaled it to its limits, that's only because they felt in love with its ease of getting things done. That's its m…

Every big website on the web right now (except Microsoft-stuff), runs either on top of the JVM or with custom-baked solutions written in C/C++. What does that make Wikipedia (PHP), Craiglist (Perl), Wordpress (PHP) and Youtube (Python[1]) ? [1]: http://www.quora.com/Is-YouTube-still-written-in-Python

Wikipedia and CL largely serve static files, so no biggie there what the application server is, front end proxy (httpd, nginx, lighthttpd, etc.) does the heavy lifting.

Wordpress is an interesting one, I wonder if they aren't doing some C++ pre-compilation a la Facebook's HipHop? Maybe not, WP is pretty light code-wise (compared to the slow, bloated dog that is Drupal), and for the most part personal blogging sites are not handling Twitter level bandwidth last I checked.

@bad_user is a cool thinker @icebraining, no hot headedness to be found, he's just stating the facts in regard to industry trends for enterprise level applications: it's an M$ and JVM world.

Re: Rails is just an API

#58
post #6

The caveats in moving state to the client is that it's a huge perceptual shift for developers, with a steep learning curve. From my perspective we're coming full circle back to client/server desktop apps... only instead of C++, we're doing it with js inside a browser container... I've done ActiveX controls and Flash components... It's not that much of a stretch.

Agree, althought I'm not fully convinced the web is fit for "web apps", or that even "web apps" make sense. At least not with current technology. Developing apps to run on the browser still implies a lot of redundancy: you are forced to work with solutions that weren't created for interactive applications in the first place (HTTP, DOM), limited to one language designed by comitee (Javascript) and code reuse is minima…

It's a shame that your post is disappearing into the gray background - I feel something similar every time I have to use Javascript & HTML for a rich interface. Every time that happens, I wish I was using GTK or QT instead.

Re: Rails is just an API

#59
post #20
post #6

The caveats in moving state to the client is that it's a huge perceptual shift for developers, with a steep learning curve. From my perspective we're coming full circle back to client/server desktop apps... only instead of C++, we're doing it with js inside a browser container... I've done ActiveX controls and Flash components... It's not that much of a stretch.

This is a recurring cycle in application development. We've gone from mainframes and minicomputers serving plain text to dumb terminals, to programs running on personal computers accessing applications and data on servers, to web servers serving structured text to 'dumb' browsers, to powerful in-browser runtime engines accessing applications and data over the web. There's no magic bullet.

For usability response time is everything. So for the moment if people want to build richer apps then they will have to be asynchronous. But do you think there will ever come a day when you can assume the network is always fast and we will be able to go back around the circle to the mainframe again?

Re: Rails is just an API

#60
post #4

This is how I feel about Flask. I've been using it with Backbone.js and they make a great combo: Flask API serving JSON, and the rest of the logic on the client.

You might find these demoes of Flask with pjax interesting then: http://flaskpjax.herokuapp.com/automobiles https://bitbucket.org/a2c/pjax_flask/overview

If you go down the API route, Flask-Restless[0] and simpleapi[1] are also worth a look.

[0] http://readthedocs.org/docs/flask-restless/en/latest/ [1] https://github.com/flosch/simpleapi

Post reply on HN