Source: www.eloquentarchitecture.com

Solving PHP Scaling Issues
We have an export feature that can build an Excel file over the course of many background jobs. We have an export feature in one of our PHP projects.

Once the file is complete, a final job will be kicked off to email the user a tokenized link for download.

Export Job Chain: A background job chain is kicked off where each job is responsible for opening an Excel file, appending a chunk of records to the file, and then closing the file.

Bus::chain([ new ExportRecords(1, 500), new ExportRecords(501, 1000), new ExportRecords(1001, 1500), //..., ])->dispatch(); Each job opened the Excel file, appended a chunk of records, and then closed the file.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners