JMS053: How to Use a Queue To Speedup PHP Processing Tasks

In this episode of the John Morris Show we cover: how to use a queue to speedup the processing of tasks in PHP, the advice an ex-Microsoft engineer has for developers, what this year’s holiday means for web developers, the little-talked-about secret to success on Upwork and answers to your questions:

An Ex-Microsoft Engineer’s Advice to Programmers

I would advise folks in software to do one thing, and that’s write. Learn how to write … It’s actually useful. You need to know how to express yourself. And it’s really tough for a lot of engineers to step up and do public speaking… Once you create a successful piece of software, you’re probably going to be writing English as much as you’re going to be writing Java or Objective C. I’ve created multiple pieces of software at DocuSign that went viral, and people liked them and wanted to use more of them. And I probably wrote 10 times the documentation and explanation, and answered questions in paragraph form.

A comment on this post summarized it best:

You may be the best engineer in the building but if others else sell their ideas better than you, their designs will make it into the product.

Read the full article here

Thanksgiving/Black Friday Online Sales Hit $4.5B, 34% Of Purchases Made On Mobile

The first two days of the holiday sales period have netted $4.45 billion in U.S. online purchases, with mobile devices — led by smartphones — accounting for a record $1.5 billion of that amount, with $2.72 billion spent on BlackFriday and $1.73 billion on Thanksgiving. The figures come from Adobe, which has been tracking some 4,500 sites, including 80% of the top 100 retailers.

Mobile is still not as popular as desktop for buying things, but it’s definitely growing, especially as a place to browse. Mobile accounted for 60% of all online traffic on Thanksgiving, IBM said, up 14.8% on a year ago; and it took 54.4% of traffic on Black Friday, up 16.6%. On Thanksgiving, 40% of all sales were completed on mobile devices, another rise compared to last year, when one-third of sales were made on smartphones and tablets. Black Friday saw 35.3% of sales on mobile, IBM said.

Not necessarily a big shock or moral to the story here, but more evidence of what we know. Mobile is continuing to grow. Important to remember for web developers as you consider your path forward career-wise. Prob a good idea to be diving into mobile development.

Also important for site builders. If you’re making the shift to mobile-first… you’re playing an ever smaller game. You may not be tracking a ton of mobile traffic yet but I’m convinced that’s because your site isn’t optimized for mobile. So, people see it and click away. Stats show people browse and make decisions on mobile then pop over to the desktop to buy.

You’re losing before you start if you’re not going mobile-first.

A Destructive Mindset

I have NO coding experience and no extra $$$ to take any classes. I am a semi-retired female, unmarried, with SS income of too little. I MUST HAVE EXTRA SOURCE OF INCOME JUST TO LIVE.

A very dangerous way to think. You’ll likely have the money… it’s simply a matter of priorities. At some point, you just have to decide to go for it.

How to Use Queue To Speedup PHP Processing Tasks Part 1: Queueing Slow Tasks

Basic concept: Offload resource-intensive tasks to be performed after the initial script call. Store the necessary data in a database. Run a scheduled task to execute through queue at an interval. Clean up queue as you execute.

Example: Email Queue

Create a database table to store queued emails. Instead of sending emails immediately in scripts, send them to the queue. Every hour process 100 queue items. Delete or move to different storage as you send each email.

Here’s the full tutorial

The Little-Talked-About Secret to Success on Upwork

The secret is building your own audience outside of it.

  • You gain exposure not controlled by Upwork so not a slave to their algorithms
  • You build trust BEFORE they see your profile which makes you easier to hire
  • You set pricing expectations outside of the competitive enviro of Upwork

Here’s what I suggest you do right now:

  1. Decide video or written (video is better)
    Decide on a niche (membership sites)
    Create DIY tutorials for your potential clients

Always include a blurb at the end about: “Don’t want to do this yourself? Let me do it for you. Check out my profile here…”

Post once a week. Create a 3-month calendar of upcoming tutorials. Set time aside each week to knock it out.

Questions & Answers

I’m looking for tutorials courses to help me: 1) build a simple form to collect data (like a registrations page) and 2) send automated emails from a form submitted.

  1. Consider WordPress or an existing solution. Standard issues like this are handled much more easily. Doesn’t all have to be custom.
  2. How to create a custom PHP contact form with validation: http://www.inmotionhosting.com/support/edu/website-design/using-php-and-mysql/how-to-create-a-custom-php-contact-form
  3. How to Insert Form Data Into a MySQL Database Using PHP: https://www.youtube.com/watch?v=n35Jn2nP9iU
  4. JavaScript AJAX PHP mySQL create a Dynamic web Form project: https://www.udemy.com/javascript-ajax-php-mysql-create-a-comment-submission-form/

Is PDO the definitive method to connect to MySQL?

Not necessarily, MySQLi has some advantages and PDO has its own:

MySQLi

  • seems to be slightly faster
  • OOP and procedural

PDO

  • 12 different drivers
  • named parameters

Most important is the environment you’re working in and what you’re comfortable with. Both can do the job effectively.

Wrap-Up

Thanks for listening! If you have a question, comment or suggestion for the show shoot me an email at john@johnmorrisonline.com.

If you liked the show, give it a like and share with the communities and people you think will benefit.

Finally, you can always find all my tutorials, podcast episodes and more on johnmorrisonline.com, @jpmorris on Twitter and youtube.com/johnmorrisvideo.

Do you want more freelance clients?

I’ll show you what I learned over the last 15 years to grind out (from absolute scratch) a backlog of new clients wanting to hire you. Who your best client prospect are, what services you should be offering them, where to find them and more. Just enter your email address in the box below and let’s get started:

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit
Share on pinterest
Pinterest
John Morris

JOHN MORRIS

I’m a 15-year veteran of freelance web development. I’ve worked with bestselling authors and average Joe’s next door. These days, I focus on helping other freelancers build their freelance business and their lifestyles.

You might also like

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do you want more freelance clients?

Enter your email below to get started building your system for consistently bringing in new freelance clients:

WHAT OTHERS ARE SAYING

Bob Patterson

Not only is John a very talented programmer and developer, he is also an excellent communicator. He has a talent for taking complex subjects and communicating them in terms that anyone can understand. This is a rare combination. This ability has enabled me to take my skills and knowledge to the next level. Thank you John for for all that you do.

Thabo Motsoahae

John is one of the best instructors I have come across, I learned a lot from his online tutorials.

Daniel Mohlendick

On the Freelancing on Upwork course: “This is by far the best course i have watched on Skillshare!! Thank you so much.”

Sukh Plaha

John is a fantastic and patient tutor, who is not just able to share knowledge and communicate it very effectively – but able to support one in applying it. However, I believe that John has a very rare ability to go further than just imparting knowledge and showing one how to apply it. He is able to innately provoke one’s curiosity when explaining and demonstrating concepts, to the extent that one can explore and unravel their own learning journey. Thanks very much John!

Lewis Howes

John is amazing at building membership sites. He converted one of my sites over from it’s existing (hardly working) platform over to the clean and simple to use WishList membership platform. I highly recommend using John and WishList for any of your membership site needs.

Ray Edwards

I recommend John every chance I get. If every person I worked with were as committed to excellence, punctuality, value, and unquestionable integrity… the world would be a better place. Highest recommendation.

Close Menu