I need to query almost 300k items from a database in backend. The most straightforward way of retrieving data 1000-by-1000 (using skip) works, but is really slow. It’s no option to use the .hasNext of a query in back-end, since then the site can only be populated with the data after all data has been retrieved. (Takes at least a minute, and users of course do not want to wait that long). I have tried using the google sheets api as well as googleapis modules, but both don’t seem to work (anymore).
Question thus boils down to: are there any other ways of querying data from a database that are significantly faster than the way I am doing it right now*, using wix/corvid api/code? Does anyone know of other (node_)modules that could be helpful in this instance, with proven, or self-experienced executability?
Thank you for your input.
*As described earlier, I have tried 2 ways: querying in front-end 1000-by-1000 using skip in backend (database has restricted access), or use the query .hasNext method until all data has been retrieved. Both take way too long compared to modern-day UX standards.