PHP wants to use queues to export very large data from the database and download it. How to achieve this?
阿神
阿神 2017-05-24 11:34:20
0
3
813

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

阿神
阿神

闭关修行中......

reply all(3)
巴扎黑

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?

我想大声告诉你
  1. Asynchronous processing, cli mode

  2. Data component

仅有的幸福

If the processing logic is not complex, it is recommended to use ETL tools, informatica or kettle.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!