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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners