Background Processing for Faster Batches

Background Processing for Faster Batches

We had a client approach us with a specific functionality request. They wanted to capture news articles from around the Internet that mentioned members of their staff. Then, they would display these articles on their site. We came up with a great solution that leveraged two technologies in an efficient combination.

Setting the Stage

First of all, we utilized an extension of Google’s search engine, Google Alerts, to repeatedly search for and gather the kinds of articles we wanted to see on the site. Next, within WordPress, we created a custom post type to store and format that data for inclusion on the site. With that piece created, we could see that there could be a considerable amount of entries created daily. Imagine searching for someone like “David Jones”. There could be thousands of mentions a day for a common name like that.

Leveraging Background Processing

We needed a way to quickly process the large volume of incoming without waiting for the normal cron job triggers. Our biggest concern was that the volume of data we would be processing would cause server timeouts during the normal cron process. This would leave us with an ever-growing pile of data that we couldn’t process. Ashley Rich of Delicious Brains recently created an open source background processing code library for WordPress that would allow us to batch process the Google Alerts results without fear of overloading the server. With our implementation of this library, we could have these alerts streaming in. The background processing moved them smoothly into the right position and was able to keep up with the volume.

The Human Element

The last hurdle was  to create an approval system for the custom post type. Due to this, the right mentions show for the right user. Using the example above, if the wrong “David Jones” was mentioned we didn’t want to see that show up for our David Jones. The article doesn’t display on the front end without an approval.

All together, the Google Alerts, background processing, and approvals make this automated content generation feature a streamlined process. Even without using Google Alerts, the background processing library can be a great tool when large amounts of data need to be handled. We love web development challenges like these and were able to build a complete system.

Written by the Team at Pixel Jar

We hope you got something useful out of that post. If you'd like to read more we have an active blog with topics across the spectrum of website development. If you're researching information for a project we'd love to talk to you about it.

Maintaining Your Website

Maintaining Your Website Can Save You Thousands

At Pixel Jar, we love working with our clients to build their websites from the ground up. There’s always a certain excitement involved with taking their vision and creating a custom WordPress solution that brings it to life.  It’s not just us, though. Our clients feel the same level of excitement that comes with the…
Read More
WP Engine for Developers

WP Engine for Developers

We’ve written about WP Engine before. As we have been partners with WP Engine for over 12 years, we thought it would be useful to our readers to break down some reasons we continue to work with them. We’ll highlight some of the tools they provide to make that relationship valuable to us and, more…
Read More
how-to-perform-a-website-audit_sidebar

Maximize your website's appeal and keep everything working for the best conversions.

How Can We Help You?

We want to build your next project.

Connect with Pixel Jar

Our Community

Subscribe to learn more about the goings on at Pixel Jar.

  • Note: Your email will be added to our CRM and be used to receive emails from Pixel Jar. You can unsubscribe at any time.

  • This field is for validation purposes and should be left unchanged.