Reputation: 3321
Hi I need suggestions for my research project.
I'm building a database that read RSS feeds produced by google alerts and saves the results in a database for latter categorization. I'm using Wordpress and pods framework to handle the database and UI.
I have 4 objects (pods) with their own tables:
The program flow is shortly this:
This way I will have a bunch of resources with linked feeds and topics, and the relative sources with their topics.
The problem is that the data goes up to the hundreds very fast and in one month I already reached more than 1500 records for resources.
So now every time I run the script, since for every new entry it has to compare it with all the previous ones, the script sistematically hangs.
So I need a way to make it more efficient or to avoid the problem splitting the process.
Since the script is called via Ajax, I thought this flow would work:
Of course the drawback is that I will got plenty of calls.
Another technique I heard about is to flush the data during the server process, since I understood this should trick the server time limit to reset. But I'm not sure I understood well.
Of course the best solution would be to rebuild everything using more specific code instead than two general purpose abstraction layers. But I'm really short in time!
Edit: code here https://github.com/bakaburg1/overseer
Upvotes: 0
Views: 156
Reputation: 4592
I think you're loading too much data at once. The whole point of AJAX is to load data a bit at a time, on-demand as you need it. It doesn't really matter that you have a lot of HTTP calls to the server as long as the scripts you're running to return data don't hang like yours is doing.
I would suggest questioning whether you really need to return all this data at once. If you think you do, a front-end redesign is probably in order. Don't load so much data at once on a single page that it takes forever to load. If you do, caching and other things will help, but it will never truly fix the problem.
Upvotes: 2