SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Experienced Rails Developer Opinions...

    hi all, i'm reading agile web development with rails (up to chapter 5 or 6) and i have been very impressed - especially with how fast prototypes can be developed (and this *is* very important). i realize much of the *real* coding is "under the hood", if you will, but getting protos up and running is quickly is still a *huge* advantage.

    beign the skeptic that i am, though, does rails have a limit where it just doesn't perform very well? this may be addressed later in the book, but how well does it handle querying data from three tables and displaying the data?

    i have an app that has a query that literally traverses about 6 tables to get the data required to display to the user. it is written in php. i'm wondering if RoR would work nearly as well for more complex apps.

    i'm sure the agile web development will cover some of these issues, but i'm also sure that developers have additional comments to add that aren't included in the book.

    i'd appreciate input from people with substantial RoR experience - especially if they found something difficult in RoR that might not be so difficult without the Rails framework.

    tia...

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if I qualify as experienced, but anyway:

    If your data is too complex, or if the standard way of querying the DB is too slow, you can always use your own SQL, just like PHP's mysql_query(). RoR is pretty fast, but Ruby is very slow (compared to C), but this will improve with Ruby 2.0. (still not as fast a C, but fast compared to other scripting languages, I think.

    they found something difficult in RoR that might not be so difficult without the Rails framework.
    You don't have to use ALL RoR's features if you're using RoR. So I don't think there are situations where it is harder with RoR. (if it's a web application, if you are doing a file compressor, don't use RoR ;-)).

    If you compare RoR to PHP, there are things which are easier in PHP. Most times this is because there is a library for it in PHP and not in Ruby. Or your app is very simple, and RoR would be an overkill.

    RoR can't make very complex things simple, but it does make them simpler, not harder.

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2005
    Posts
    485
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2
    I don't know if I qualify as experienced, but anyway:

    If your data is too complex, or if the standard way of querying the DB is too slow, you can always use your own SQL, just like PHP's mysql_query(). RoR is pretty fast, but Ruby is very slow (compared to C), but this will improve with Ruby 2.0. (still not as fast a C, but fast compared to other scripting languages, I think.



    You don't have to use ALL RoR's features if you're using RoR. So I don't think there are situations where it is harder with RoR. (if it's a web application, if you are doing a file compressor, don't use RoR ;-)).

    If you compare RoR to PHP, there are things which are easier in PHP. Most times this is because there is a library for it, or your app is very simple, and RoR would be an overkill.

    RoR can't make very complex things simple, but it does make them simpler, not harder.
    speed issues are usually overhyped nowadays. i use postgresql as my db and it is very fast - yet mysql folks like to claim it is slow. it may be slower than some mysql configurations, but is it noticable? not likely. if it is noticeable, it is negligable.

    i also use adob's abstraction layer, with php, which puts another 30% overhead on the db interactions - and it is still fast. from what i can tell, RoR has a db abstraction layer, too, so i'd expect at least a 30% performance hit for that ability alone. it is well worth it.

    most of my apps will be intranet based, anyway. with a good server machine, intranet sites can be much faster than intranet sites.

    i was going to wait and start developing RoR in about a year or so - in order to let it mature more. however, i don't think i can resist its elegance (i don't know ruby, but i can already see it is elegent) and quick prototype ability - even if it isn't as quick when you query 6 tables to display data.

    i guess i need to read agile web development with rails a little more quickly.

  4. #4
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've read the statements about Ruby being slow but that is supposed to be nearly a non factor when you use FCGI instead of CGI.

    I've got a fairly complicated model like you describe that I am porting to Rails from PHP and so far I am finding that the performance is as good if not better. Part of this is probably the framework I was using for PHP wasn't implemented as well. The ease of using Rails in many cases makes it exteremely nice and if you need to use a custom SQL statement then you can so Rails becomes just as flexible. What I like is that even if you break out of ActiveRecord to use find_by_sql you are getting back the model class still without any further finessing. So in a way you can extend the Model with new attributes from other tables with complex sql statements but remain in the specific Model.
    Erh

  5. #5
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP's speed is comparable to Ruby's:

    http://shootout.alioth.debian.org/de...php&lang2=ruby

    Sometimes PHP is better, sometimes Ruby. Ruby's memory use seems to be better, but PHP's speed. They are both slow scripting languages. I expect Ruby 2.0 to be much better than PHP (because of byte code interpreter).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •