search

Home  >  Q&A  >  body text

PHP wants to use queues to export very large data from the database and download it. How to achieve this?

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

阿神阿神2789 days ago873

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-05-24 11:36:20

    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?

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-24 11:36:20

    1. Asynchronous processing, cli mode

    2. Data component

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-24 11:36:20

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

    reply
    0
  • Cancelreply