A few more thoughts—

It's always handy to harden your applications against potential downtime
with any third-party service. Here's how you can accomplish that if you're
using Websolr:

1. Queue your writes

Elijah Miller has a module to use with DelayedJob:
https://gist.github.com/392468
Mat Brown (author of Sunspot) uses the following with Resque:
http://gist.github.com/659188
My own version is simple but less comprehensive:
http://gist.github.com/530800

Queuing your writes is important lest the Sunspot ActiveRecord callbacks
prevent your object from creating or saving successfully. Also, writes to
Solr can typically take anywhere from 20–200ms, and there is generally no
point in waiting for that to finish before rendering your response.

2. Rescue exceptions for your reads

In your controllers, use "rescue_from RSolr::RequestError" to render a
custom action, so your users can see something a bit less disorienting than
a 500 message, and you can report the exception in a more controlled
fashion.

We try to stay on top of announcing outages on our Twitter account, so it's
worth checking http://twitter.com/websolr if you notice anything funky going
on. If you don't see anything posted up there, you can always feel free to
open a ticket and let us know what you're seeing.

-- 
Nick Zadrozny

http://websolr.com — hassle-free hosted search, powered by Apache Solr

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to