Thursday, May 30, 2019

Yii2 Queue with Redis on Docker Swarm is a game changer

I don't know why I haven't utilized this before, but the yiisoft/yii2-queue is a fantastic way to quickly and easily split some of your application processing out to asynchronous workers.

Getting it set up with a redis storage engine on a docker stack is super simple -- we just add a persistent redis service to the docker stack, configure the application to include the queue component, and move our slow process(es) into a queue job.

Since we're using a Docker Swarm stack we don't need to worry about setting up a cron or systemd service, we set up the queue listener as it's own service in the stack, which also gives us the ability to scale the queue workers dynamically as the need arises.

Tuesday, May 7, 2019

DockerCon Hallway Track - Logging to a NFS mounted Docker Volume

Recently at DockerCon I decided to check out the whole 'Hallway Track' concept and share a sticky situation we ran into at work. If you've never been, the Hallway Track is a coordinated effort to get conference attendees talking to one another and sharing knowledge. You post your topic or peruse the posted topics and they facilitate connecting people together to discuss face to face. I was amazed at the number of people who requested to talk to me about our experiences with the complications of writing application logs to a NFS mounted docker volume. The official title was "Lessons learned: Why writing to flat file logs in an NFS mounted docker volume is unwise".

Wednesday, February 13, 2019

Code Analysis with Exakat on Docker

One of the neatest things I learned about last week at SunshinePHP, was how Exakat can be used to perform static analysis of a codebase to help formalize your code review processes.  It's a great tool for determining how consistent you and your team are being with your code, and has indicators to show you how closely your code base aligns to each of the major PHP versions -- an excellent way to check backward compatibility and/or whether you're ready for a PHP upgrade or not. 

With Docker, it's extremely easy to get things running!

Monday, February 11, 2019

Notes from SunshinePHP 2019

This conference blows me away every year! There is always so much to learn and to share.  This year every attendee was able to receive their very own ElePHPant - so my herd continues to grow (ok, so I actually have a menagerie, since it includes a few Docker whales as well!)

Some of my biggest take aways from this year's conference:

  • MySQL 8 and x shell via docker
  • Security testing technique
  • Swoole! (Async. PHP!!!)

Once again, I'm renewing my determination to pick the blogging back up - it may not have as many Yii specific examples, since I tend not to run into quite as many road blocks there as I used to (9 years with a framework will do that) but I'm constantly running into IaaS challenges that others may value insight into.  If only there were more hours in a day ...