>
> I'm trying to decide which path to go down for developing a new web
> app. Scalability in the long run is a huge requirement, but without
> sacrificing the development time.
>
> The rails community is huge, there's support everywhere, documentation
> is fantastic, but I keep hearing things from others about how if we
> use rails we're not going to be able to scale.
>
> Some have said Rails is great for prototyping, but going to production
> it's going to fail. The largest sites out there never use Rails. I
> believe Twitter tried and failed. I'm not sure what they ended up
> doing though.
Twitter is still using rails.
Fred
Usually people writing these articles never had any real application to
scale themselves.
Sure, some applications might have better performance on a single box
with Java in a micro-benchmark because they are CPU bound and Java is
much faster than Ruby (now) for CPU intensive processing but this has
nothing to do with scaling as most people mean it which usually is : "go
beyond the point where your application can fit on a single server and
get more performance by adding pizza boxes".
So saying that an application framework scales more than another is pure
bulls**t. Every modern web framework uses a "share-nothing" approach to
solve scalability problems so about anyone can scale by adding
application servers today.
When anybody comes to the point where the only shared component becomes
a bottleneck (usually the relational database but might be filesystems,
LDAP servers, network, whatever) scaling is a matter of architecture and
solving the bottleneck is specific to the application not a problem the
framework can come with a solution for.
The problem is that the "share-nothing" term is misleading: you always
share something and this is what comes back to bite you when your
application is under stress. You'll need one(/several) good
specialist(s) to find the bottlenecks and re-architecture your
application when the problem arises.
For example, I recently had to spend some time optimizing some parts of
one Ruby process that was getting slower. After I finished, on the same
hardware the application was 10 times faster. Turns out that some
database queries weren't optimal, the database lacked some indexes and
PostgreSQL 8.0 was much slower than 8.2. Ruby didn't have anything to do
with it. I'm pretty confident that even if I spent the rest of my life
recoding this application from Ruby to raw assembler I wouldn't get more
than a 10% speedup and a ton of bugs.
In the software industry believing that software in a shiny box will
solve your problems is amateurism: people solve your high-level problems
using tools, the tools are only meant to low-level ones like minimizing
the time spent coding simple tasks and providing easy access to lots of
libraries from which to extend your application as quickly as possible
(in fact most of them probably create more problems than they solve :-)
). So if you have problems to solve, I suggest you look for bright
people who know how to solve them, not bright software, as bright
software is only a marketing myth...
Whow, looking at what I just typed it seems I was tired of coding and
needed to vent a bit :-)
Lionel
http://www.littlehart.net/atthekeyboard/2007/01/02/just-build-it-damnit/
- Carsten
It need right now? Or you think it will need? There is a big difference here.
Some wisdom from the 37 signals:
http://gettingreal.37signals.com/ch04_Scale_Later.php
Regards,
Rimantas
--
http://rimantas.com/
That's not really a useful question. For example... my site has 10
million users (it doesn't but let's pretend :) but they only visit once a
month. Or, perhaps I have 10,000 and they visit my site 5-6 times a
minute each.
You need to look at how many requests you are going to get over a day, or
an hour, what your peaks are, how much *traffic* you have to be able to
sustain during those times.
That all said... I agree with everyone else... just build it :)
RoR is a LAMP system. The P stands for an interPreted language, and the M
stands for MySQL.
Write developer-friendly code with the P, and put the M on another server.
If the P gets slow, put more servers under it. This system allows you to
optimize developer time, while keeping the potentially slowest part of the
system - MySQL - on a dedicated server.
--
Phlip
>
>> I've read a ton of articles this afternoon, and they all say how much
>> more processing power Ruby uses, and that scaling is seemingly more
>> complicated.
>
> RoR is a LAMP system. The P stands for an interPreted language, and
> the M
> stands for MySQL.
>
Um, LAMP actually stands for something more along the lines of Linux,
Apache, MySQL, and Perl/PHP. RoR can run on Windows, Linux, or Mac
and can use any of quite a few databases. Some (maybe many) choose
MySQL. I don't. I use PostgreSQL.
Peace,
Phillip
http://blog.caboo.se/articles/2007/7/29/scale-rails-from-one-box-to-three-four-and-five
Basically covers how to scale and the steps to take.
--
Posted via http://www.ruby-forum.com/.
That post is good advice, in general, but it starts from a premise that is
never explicitly mentioned -- that the site you are building is new.
While it's refreshing when clients ask for something brand-spanking-new,
the work is more likely to be "do exactly what my site already does, plus
this set of additional features."
In that case, the traffic is already coming to the site. If you're lucky,
the traffic is light enough that you can still ignore scaling issues while
you're developing the new Rails app to replace the existing whatever app.
On the other hand, the client may be coming to you to reimplement their
site because it is getting slow and they want you to create the new one so
you can be responsible for scaling it.
This may not be the most common Rails project, but such work is definitely
out there. It means that, yes, you need to think about scaling from the
start. You don't have the luxury of a gradual user uptake to see where the
bottlenecks are, because the moment your new site goes live you have a full
user base (see below for a way around that). You need to address problems
before they happen, because downtime and slowness are not just growing
pains but regressions that the client will be justifiably screaming about.
I'd be interested in some thoughts toward handling the situation starting
from that premise, where "just build it, damnit (sic)" doesn't apply.
As an example, one can play tricks with a frontend server to put some
segment of the user base on the new system while leaving the majority on
the old to simulate a gradual user uptake. Of course, that may not be
feasible depending on the particular site's functionality. Consider
Twitter, for example, where the users' interaction with one another is
central to the site.
> - Carsten
--Greg
No difference: just build it, damnit; scale to meet traffic demands; launch.
You're going to have more trouble with integration and compatibility, anyway.
Iteratively,
jeremy
In my view all this talk of scalability is premature. People plan for a million users from start and that is a premature optimization. It's much easier to do the site in Rails and when bottlenecks become a pain scale like this
If it is getting slow you can check out the whole architecture to find
out where the bottlenecks are and rebuild it accordingly. As I already
said, when you have performance problems you need people knowledgeable
enough to find out why, the framework itself is only a tool that might
need some tuning (or not).
Lionel
You may find this useful...
I'm quite sure Google architects knew these pitfalls and worked out by
themselves how to avoid them... As they simply *coded* their own
framework (and probably several times along their path).
If you really believe you can throw a "scaling" framework into the hands
of "novice programmers" and expect them to code something that scales
anything like the Google underlying architecture, just wait a minute,
I'll fetch a good seat and popcorn to watch the show. I'm sure I'll find
it either quite instructive or good laughing material :-)
Good luck,
Lionel