I starting to investigate whether Ruby-on-Rails will help solve my problem in some way?
In short, I have a legacy application which is reading and writing a collection of images. This application also uses a sqlite database to help refer to correct image files when required.
What I’d like to do is have an iPhone and/or iPad application browse the images, but also be able to see updates and additional images without hitting a refresh button; or using a periodic timer say.
This brought me to investigate Ruby-on-Rails as a solution?
I made the following diagram to think about whether I’m on the right path:

To date I obviously have the (legacy) in-place linux app, which generates images and updates the database. I have also embedded a bonjour service inside the linux app to allow an iPhone application to connect and to-date browse thumbnails that are inside the sqlite database. The tricky part is that I’ve realised that the iPhone app needed to be kicked to update its images when the database is changed remotely.
Actually I thought that with a ruby-on-rails app it could provide a RESTful service to access fullsize (plus, thumbnail) images allowing the thumbnail images to be removed from the sqlite database – it’s likely the database could have 10000+ entries, so didn’t want the db to grow unnecessarily.
Any tips or resources would be great.
Thanks.
Update: I had a think about the wording of my question again. I guess I was trying to figure out if I could get something like Rails to monitor changes to a database without polling in some way.
The simplest solutions I can think of is to have an action on your RESTful service which pulls the most recently modified date from the database. Periodically query this from your iPhone app, and then refresh the list.
For example, if you create scaffolding for images:
NOTE: You will have to sync your legacy DB to this Rails table
Then each image object is automatically created with an “updated_at” attribute.
and you’ll have to add the following match line to your routes.rb
Now, from the iPhone app you can pull an XML file describing your most recent image with this URL
Parse out the most recently updated time, and compare it to your last refresh date.