Meditations on programming, startups, and technology
New Relic

Rails, DB2 and the Enterprise

The Enterprise :)

Recently Matt Aimonetti wrote an insightful article about Rails and the Enterprise. In it he identifies five core Enterprise application needs:

  • Reliability
  • Support
  • Performance
  • Advantage over the competition
  • Integration and transition path

Matt then proceeds to illustrate how Rails does a good job in regards to most of these points, despite a few existing challenges.

Among these challenges, I can clearly see the following:

  • There isn’t a 1-800-RAILS number; the community may be great, but there are not exactly yearly contracts in place. Furthermore, the author of the Ruby driver for, say, Oracle doesn’t owe you a thing. He may or may not be there for you when you need something to be fixed quickly.

  • XML support is less than ideal (but it is improving).

  • Integration with the Enterprise world is not easy, due in part to less than stellar SOAP support (but that is also improving).

  • If you’re taking advantage of ActiveRecord and an Enterprise database like Oracle, your DBA isn’t likely to be happy that you aren’t using prepared statements.

You may think these are small points, and in the startup world they generally are. However, in the Enterprise world they do make the difference between adoption and niche.

One thing that Matt forgot to mention is DB2, which should be the poster child for how Rails can be Enterprise ready. And as a bonus, you get to throw around IBM’s name (which is synonymous with Enterprise) because Rails is both supported by, and used within, IBM.

Let’s address each point above with DB2 on Rails in mind.

IBM is the only database vendor to provide a Ruby driver and ActiveRecord/Rails adapter for its databases. This means that you have a team that’s accountable when things don’t work as they’re supposed to. This team is accountable, regardless of whether you have a contract with IBM or not; it’s their job, not a hobby. This involvement with Rails dates back to 2006, with continuing releases and improvements ever since. Our IBM’s optional yearly 24/7 support contracts (e.g., for less than $3000 a year per server with DB2 Express-C) include support for DB2 on Rails as well.

DB2 supports native storage and querying of XML documents and data (plus it’s fast). This technology is known as pureXML.

DB2 can both consume and serve SOAP web services. This lets DB2 do the integration for you.

DB2 on Rails supports parameterized queries. (While on the subject of queries, if you are using JRuby you can take advantage of pureQuery, which is an IBM created Enterprise solution that’s aimed at making your queries fast, reliable, manageable and easy to debug.)

If you are trying to introduce Rails into your Enterprise job, chances are that DB2 will already be present within the company infrastructure. If not, you can use DB2 Express-C which is entirely free — thus making it easier to introduce than an expensive solution.

IBM is one of the most trusted brands on the market today, as it has been for decades now. Banks and Enterprise companies the world over trust DB2 with their most critical data. One way for the Rails community to increase the adoption of Rails in the Enterprise, is to acknowledge and embrace the great pair that is Rails and DB2.

If you enjoyed this post, then make sure you subscribe to my Newsletter and/or Feed.

receive my posts by email

18 Responses to “Rails, DB2 and the Enterprise”

  1. renoke says:

    Ho I wish Oracle could do the same… You put the finger on the right point : Entrprise Database & Middleware. Big Entreprise spend huge amounts of money in Storage licences, developper tools, supports, DBA salaries, application servers, consultings, employee certifications, … so they don’t want to hear from MySQL/Rails solution for their core business. The question is not if Rails is ready for Entrerpise but is Entreprise ready of Rails ?

  2. rubyist says:

    “If you’re taking advantage of ActiveRecord and an Enterprise database like Oracle, your DBA isn’t likely to be happy that you aren’t using prepared statements.”

    “DB2 on Rails supports parameterized queries. ”

    Doesn’t pretty much every “enterprise” database support parameterized queries , or am I misreading something ?

    Also, most enterprises have coding standards as well as performance and volume testing etc to catch this kind of thing. Failing that , in Oracle, there is the cursor_sharing parameter which has been around for 10 years or so to dynamically fix this sort of poor coding in the DB server layer without any code change.

    • Yes, rubyist, most databases support parameterized queries. The problem is that the ActiveRecord adapters don’t (exception made for DB2). cursor_sharing helps, but it’s not the same as issuing “good queries” from the get go.

  3. Robert Ferney says:

    I’ve tried to get the DB2 drivers for rails working a couple times..

    The problem being that the DB2 stuff isn’t up to date with libc…

    support could be better…

    • Hi Robert,

      sorry to hear about the issues you encountered. Could you point to a specific instance in which you requested help but didn’t receive it or it was sub-par? We’d love to rectify that.

      For DB2 specific questions you can normally get good assistance from the DB2 Express-C Forum. For Rails specific issues, you can use the RubyForge forum.

      I’m not sure what you mean by “DB2 stuff isn’t up to date with libc”, because I routinely install DB2 Express-C on Windows, Linux, Unix and Mac OS X (technically a Unix too).

  4. Alex Rod says:

    IBM also offers ruby drivers and ActiveRecord/Rails for Informix ?

  5. John says:

    Just try to use IBM’s DB2 adapter for the iSeries. It will cost you large dollars for the IBM ‘Connect’ component required by the Ruby DB2 adapter. Oh yeah, it also requires a server to track your IBM Connect license.

    Stay away from this unless you like to spend thousands in simple connection components!

    • John, DB2 Connect is only needed if you are running a mainframe server (e.g., System i and z) as your backend and you’re running your web server on a different, non-mainframe server. Also, most companies who have System i or z deployed, have already purchased DB2 Connect licenses. We are talking Enterprise after all. It’s a very specific case, so your generalization and scare tactics are unnecessary.

      • Brandon says:


        Are you suggesting that no license would be necessary if the iseries was the database and the web server?

        • That is correct, Brandon. DB2 Connect is only needed when you are trying to connect from LUW (Linux, Unix, Windows) to System i or z. If your database and web server are running on a mainframe, DB2 Connect is not needed.

          • Brandon says:

            I would guess for development purposes from my Windows box I would need it though? Or can that somehow use Client Access? I have the Windows Client Access for iSeries, allowing me to push or pull data from the iSeries.

    • Mike says:

      I don’t think the licensing claim is valid either. Granted IBM is turning into MS when it comes to going after licensing revenue in existing shops. IBM gives you the choice of doing the licensing tracking manually or using their automated method. We track it manually – a good business partnet can make this relatively easy. This is a problem with IBM and not specificallhy with IBM Connect. However, I will admit that the IBM audit process (performed by a 3rd party who gets commision like $ for finding previously unlicensed products) is not pleasant.

  6. Jens Norrgrann says:

    You don’t need to purchase db2 connect to access db2 from Linux to iseries. I’m using the open source jtopen with jruby and it works. Haven’t tried it with activerecord though…

  7. John says:


    I also have Client Access and MS SQL Server. SQL Server lets you connect to the iSeries DB2 database using the Client Access ODBC interface without any additional software. So naturally I though that the IBM Ruby & ActiveRecord drivers would work similarly. This is not the case.

    Antonio claims most customers who own the iSeries also own DB2 connect. This is not the case and I find this to be an unfair assumption. If IBM wants to help Ruby make more inroads into the enterprise, then IBM should make things easier, not more difficult, for developers trying to bring IBM’s own ‘enterprise’ iron into the Ruby ecosystem.

    It’s hard to justify purchasing expensive licenses for development when building proof of concept or prototypes to show management examples of Ruby’s power. Microsoft’s .NET connects to iSeries DB2 out of the box with Client Access installed on any PC. Just try an get management to buy into Ruby under these circumstances.

    IBM has an opportunity here, but it’s midrange/mainframe group is shooting itself in the foot.

  8. I am constantly surprised how a simple post on a simple subject can bring out everyone pet peeves.
    Antonio post makes some very important points that I would have thought would be viewed as very positive:
    1. IBM makes a free DB2 database available
    2. IBM is the ONLY database vendor that invests its resources to develop Ruby on Rails driver/adapter.
    3. These drivers/adapters are more functional and of higher performance that others that are out there
    4. IBM is the ONLY database vendor that provides formal support for these drivers/adapters.

    But apparently a free database, free drivers and full support is not enough. This post is about RoR in the Enterprise i.e. large scale commercial organizations. We are not talking about non-profits or students here. This is about companies that run midrange/mainframe systems. Is your point that these enterprises somehow should be getting everything free of charge?

    Btw, IBM does make DB2 Connect available to developers free of charge. So, if you are a developer of a commercial application, you do not have to pay anything.

Leave a Reply

I sincerely welcome and appreciate your comments, whether in agreement or dissenting with my article. However, trolling will not be tolerated. Comments are automatically closed 15 days after the publication of each article.

Copyright © 2005-2014 Antonio Cangiano. All rights reserved.