Instant Open API with Rails 2.0

Day 2 at the Ruby on Rails conference – after the Keynote.

My main focus is on technology trends that allow us all to make better use of the vast amounts of information that we store in myriad locations and formats across diverse systems. The new standards for database manipulation (SQL); data interchange (XML) and data delivery (RSS) are huge developments in an industry that has traditionally offered hundreds different ways of managing, exporting and delivering data, none of which worked particularly well — if at all — with anybody else’s method. The technology industry has tried to address this with one size fits all options — Oracle, SAP, etc., offering Enterprise Resource Platforms that should be all things to all people. But these are expensive options that require a stable of high-paid programmers on hand to develop. I strongly advocate that we don’t need to have all of our software on one platform, but that all data management systems have to support standardized methods of exchanging information. I boil it all down to this:

It’s your data. Data systems should not restrict you from doing what you want to do with your data, and they should offer powerful and easy methods of accessing the data. You can google the world for free. You shouldn’t have to pay to access your own donor information in meaningful ways.

How can the software developers do this? By including open Application Programming Interfaces (APIs) that support web standards.

So what does this have to do with Ruby on Rails? At the Keynote this morning, David Heinemeier Hannson showed us the improvements coming up in Ruby for Rails 2.0. And he started with a real world example: an address book. Bear with me.

  1. He created the project (one line entered at a command prompt).
  2. He created the database (another line)
  3. He used Rails’ scaffolding feature to create some preliminary HTML and code for working with his address book (one more line).
  4. He added a couple of people to the address book.

At this point, with a line or so of code, he was able to produce HTML, XML, RSS and CSV outputs of his data. The new scaffolding in 2.0 automatically builds the API. I could get a lot more geeky about the myriad ways that Ruby on Rails basically insures that your application will be, out of the box, open, but I think that says it well.

Think of what this means to the average small business or non-profit:

  • You need a database to track, say, web site members, and you want to further integrate that with your CRM system. With rails, you can, very quickly, create a database; generate (via scaffolding) the input forms; easily export all data to CSV or XML, either of which can be imported into a decent CRM.
  • You want to offer newsfeeds on your web site. Create the simple database in Rails. Generate the basic input forms. Give access to the forms to the news editors. Export the news to RSS files on your web server.

This is powerful stuff, and, as I said, an instant API, meaning that it can meet all sorts of data management needs, and even act as an intermediary between incompatible systems. I still have some reservations about Rails as a full-fledged application-development environment, mostly because it’s performance is slow, and, while the keynote mentioned some things that will address speed in 2.0, notably a smart method of combing and compressing CSS and Javascript code, I didn’t hear anything that dramatically addresses that problem. But, as a platform, it’s great to see how it makes actively including data management standards a native output of any project, as opposed to something that the developer must decide whether or not to do. And, as a tool, it might have a real home as a mediator in our data integration disputes.

Comments are closed.