title: Best practice for rate limiting users of a REST API?
body: <p>I am putting together a REST API and as I'm unsure how it will scale or what the demand for it will be, I'd like to be able to rate limit uses of it as well as to be able to temporarily refuse requests when the box is over capacity or if there is some kind of slashdotted scenario.</p>
  
  <p>I'd also like to be able to gracefully bring the service down temporarily (while giving clients results that indicate the main service is offline for a bit) when/if I need to scale the service by adding more capacity.</p>
  
  <p>Are there any best practices for this kind of thing? Implementation is Rails with mysql.</p>