Slashdot Mirror


Ruby on Rails for DB2 Developers

An anonymous reader writes "Ruby on Rails seems to be the new hotness in the world of web development, right up there with Ajax. IBM DeveloperWorks has a helpful howto on how to bring the worlds of Ruby on Rails and your DB2 framework together. From the article: 'Because Rails emerged from the open source world, until recently you had to use MySQL or PostgreSQL to work with it. Now that IBM has released a DB2 adapter for Rails, it's possible to write efficient Web applications on top of your existing DB2 database investment.'"

13 of 128 comments (clear)

  1. Really good news. by marcello_dl · · Score: 5, Interesting

    Getting the likes of IBM to recognize the usefulness of the Rails framework is a little more than just another DBMS supported: rails used to be bashed, especially by java people, for not being "enterprise ready". They criticised the limitations of the active record ORM (but it's open source, you can either extend it or make your custom sql calls), or the relative immaturity of ruby and libraries.

    Now such claims will sound less credible so more dubious people might give it a try.

    --
    ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  2. Re:RoR vs Django? by amaupin · · Score: 3, Interesting

    Haven't tried Django, but while Ruby on Rails is making progress, it's still no match for the power and flexibility of Zope.

  3. Re:RoR vs Django? by teg · · Score: 2, Interesting

    Haven't tried Django, but while Ruby on Rails is making progress, it's still no match for the power and flexibility of Zope.

    I've been programming python for many years now - I've not used Django, but after reading the docs etc. it looks like yet another "Ruby on rails is popular, let's make something!" which is nowhere near finished. One nice thing about Ruby on Rails is focus - the entire ruby community seems to be on the bandwagon, driving it forward and integrating nicely with it. This means that docs, libraries etc are there for you.

    Zope is way too complex... when you know easily how to get most of what you want to do in python scripts from straight database tables, you'll hit your head against the wall for ages converting this from python code to Zope and its evil ZoDB[1]

    [1] The one good reason for using ZopeDB is that Python's database libraries need a large overhaul. Consistency is badly needed (making things like quoting etc. driver dependent... which sick mind thought that was a good idea?), and why are there so many drivers? There shouldn't be a need for much more than one for each database - and e.g. in the case of PostgreSQL, that should be the bundled one. pyPgSQL, PyGreSQL, Psycopg, PoPy, Proboscis.... and I'm sure I forgot some. The perl DBI interface was more pleasant to use almost 10 years ago than the python DB interface is today. JDBC also got it right. A de-facto standard python ORM would be nice too.

  4. Re:RoR vs Django? by masklinn · · Score: 2, Interesting

    after reading the docs etc. it looks like yet another "Ruby on rails is popular, let's make something!" which is nowhere near finished

    It's not, both are extremely different from one another (and even more since the Django guys went the magic_removal route). And while Django is not finished (nor is rails) it's very much production ready.

    why are there so many drivers? There shouldn't be a need for much more than one for each database - and e.g. in the case of PostgreSQL, that should be the bundled one. pyPgSQL, PyGreSQL, Psycopg, PoPy, Proboscis.... and I'm sure I forgot some. The perl DBI interface was more pleasant to use almost 10 years ago than the python DB interface is today. JDBC also got it right. A de-facto standard python ORM would be nice too.

    I hear you, that's probably the biggest issue with the Python community, this "No tool does exactly what I want, so I'll just build a new one, no point in extending an existing one" attitude.

    Brings some interresting stuff to the table though (have you tried SQL Alchemy in your Quest For An ORM?)

    Another Python issue is that the community can hardly bring itself to standardize things, and even then people usually try to build even more tools (sometimes better though, see py.test versus STL's unittest, or effbot's ElementTree which will finally be part of the STL with Python 2.5 versus the whole xml package crapfest)

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  5. Re:Ruby could be packaged better by Cryp2Nite · · Score: 2, Interesting
  6. Re:Not as hot by SilentBob0727 · · Score: 2, Interesting

    As an example of the hype machine in action, I recently interviewed for a web developer position. When the subject of my AJAX experience came up, I said that I had extensive experience. He then asked about my Ruby experience, which I said was limited. He then laughed -- LAUGHED -- and said "What are you talking about? AJAX is a *part* of Ruby!" Clearly I had no experience in either technology and was lying "because otherwise I would know this", and the interview went downhill from there.

    --
    Life would be easier if I had the source code.
  7. Re:DB2... The only change? by kpharmer · · Score: 2, Interesting

    > There is good reason why you may not want it to be. The Java/J2EE/Websphere approach often uses clustering and cacheing to give
    > high performance and scalability. You would not want to let a small RoR application (or any other type of application) loose on such such a system.

    It depends:
      - I'd bet that 9 out of 10 websphere/weblogic implementations don't use clustering
      - many massive databases have relatively modest websites, ie the heavy-lifting is all backend not presentation
      - many massive databases have small related "helper" applications that also need presentation layers
      - even clustering & caching applications should be able to handle changes to reference data through simple cache-refresh methods.

    Fortunately for me, most of my massive databases get php front-ends these days. And hopefully RoR soon.

  8. Re:RoR Question from JAVA newbie... by mr_rattles · · Score: 3, Interesting

    The API is designed for Java/.Net and you think it's a good excuse to learn Ruby? Wouldn't it be a better excuse to learn Java or .Net? Also, you said it yourself that it's a simple app so I don't think you need to bend over backwards "designing" a "full-fledged" Java app either. Just write the simple app using whichever API makes most sense for whatever you're interfacing with. On one side you say you have a Java/.Net API but what do you need to interface that with, another Java/.Net app? If that's the case your decision should be obvious.

  9. Unicode? by jopet · · Score: 2, Interesting

    Does it already properly support Unicode? Not everyone uses just English texts and the best and most common way to use characters of other languages is UTF-8.

    1. Re:Unicode? by RegularFry · · Score: 2, Interesting

      Which? DB2 or Rails? I'm assuming that DB2's got multilingual wrapped up pretty well. As far as Rails goes, there are a couple of handshakes to perform (set headers, set $KCODE, prod the DB in the right way if necessary), but once they're done, everything's just a bunch of bytes. Ruby's Unicode support isn't great (there's an active discussion about the best way to fix it up on ruby-lang right now), but 95 times out of 100 it doesn't cause a problem.

      By the way, one of the sticking points about the Unicode issue with Ruby is that the opinion that "the best and most common way to use characters of other languages is UTF-8" is not universally held. It might be the most common, but many learned and respected individuals think it's not the best.

      --
      Reality is the ultimate Rorschach.
    2. Re:Unicode? by jopet · · Score: 2, Interesting

      Since this was essentially about Rails getting DB2 support I implicitly addressed Rails/Ruby - sorry for

      In the meantime I did some research myself and found the sobering fact that Ruby/Rails essentially does NOT support Unicode in any usable way.

      A string of Unicode characters is NOT just a bunch of bytes: take the simple operation of finding the length of a word or reversing it: both string functions return nonsense in Ruby, if there is any character encoded in more than one byte in the string.
      That Ruby does not know anything about the encoding of its strings is causing lots of other problems, especially in context where one has to work with strings in different encodings (e.g. multilingual applications, applications based on texts derived from web sites).
      Ruby makes it unnecessarily difficult to do things in those cases.

      I have the impression that people tend to highly *underrate* this problem: for many of those applications I have written yet, support for Unicode and encodings like UTF-8 were quite essential.

      Regarding your statement about whether UTF-8 is the best way to encode characters I have to say: it depends - on the language and the source of your data. E.g. when your data comes from UTF-8 encoded database fields, it is not very pretty to re-code it into some one-byte encodig just to work around the Ruby shortcoming -- and in some cases this is not even possible.

      I really love the design of Ruby, but this is one of the biggest shortcomings in a modern programming language (unfortunately shared by several other more current languages).

      As much as I hate Java, at least they made it possible to do these things right from the start.

  10. Re:Not as hot by I+Like+Pudding · · Score: 2, Interesting

    I would actually consider this a good thing. This guy let on that he didn't know what the hell he was talking about right up front at the interview, on top of demonstrating a lack of professionalism - a great time to walk, assuming you weren't hurting for the money. I wish every company were so forthcoming about their flaws.

  11. Re:Not as hot by domukun367 · · Score: 2, Interesting

    It sounds like you were saved from having to work with morons there SilentBob.

    I view a job interview as a chance not just for them to find out about me, but a chance to find out whether they are a group of people worth working for.

    --
    Please don't send a Word document when a text file will do the job.