Using PHP, there are millions of data in the database, but it is not enough to check it out directly. It also needs to perform complex calculations and export it after the calculation. So I want to use queues to solve this problem, or there are other ideas. And you can use ajax to monitor queue execution.
Note: It doesn’t have to be asynchronous, synchronous is also fine.
Note: MySQL has no room for optimization, and data processing must be performed after querying.
Note: I don’t want to use the usual ajax loop to call PHP to complete the method. I just want to use ajax to simply monitor the execution of the queue
Just write a php script to calculate and export, write the processing progress to the cache synchronously during processing, write a controller to query the corresponding cache, and you will know the processing progress. . . After the processing is completed, wouldn't it be nice to use the exported file path as the download address?
Asynchronous processing, cli mode
Data component
If the processing logic is not complex, it is recommended to use ETL tools, informatica or kettle.