OnlineDB request failed with: Too Many Requests

I ran into a “OnlineDB request failed with: Too Many Requests” error. What steps can I take to mitigate this issue?

My first suggestion would be to make sure you are on RVM 4.77+. There were OnlineDB optimizations and automatic retry logic introduced in 4.77.

My second suggestion would be to open the network console in the chrome dev tools to identify where OnlineDB calls might be made in the view where you hit this limit. There may be additional OnlineDB calls in the view that are not obvious. For example, any belongs-to relationships called on an object that was queried using OnlineDB will be an additional call. This may cause problems if you have, for example, an object table that is populated with an OnlineDB query and displays many belongs-to relationships in the table as each of those belongs-to columns for each row will be an additional OnlineDB call. To optimize your code to avoid hitting the rate limit, you could:

  • Use .include()
  • Check if there is a way to reduce the number of queries required to do the work
  • Add a small delay between queries
  • Add retries with a delay when encountering this error

If you continue to run into these issues after reviewing these suggestions, you can request an increase in rate limits. Please provide us the following information to do so:

  • App & Deployments
  • The expected number of requests (individual network requests) the app would make in the worst case scenario (e.g. 200 requests when view X is opened)
  • How often that is expected to happen (e.g. every time the user presses button Y, which could happen every 10 seconds, for a duration of Z minutes)

Read more about API Limits in our documentation here.

1 Like