Note: There are going to be things in this post which are less-than-best-practices. Be warned 🙂
- I’m working on an admin dashboard which connects to a micro-instance AWS server.
- The DB has tens of millions of records.
- Most queries come back within a few seconds but some take up to a minute or two to return, based on a few things outside of my control.
Due to Heroku’s 30-second limit (https://devcenter.heroku.com/articles/request-timeout), I need to find some way to buy time to keep the connection open until the query returns. Heroku does say that you can buy time by sending bytes to the client in the meantime, which buys you another 55 seconds.
Anyways, just curious if you guys have a solution to stall time for Heroku. Thanks!
You could break down the thing into multiple queries.
You may send a query, have your AWS server respond immediately just saying that it received query and then once it pulls the data, have it send that data via a POST request to your Heroku instance.