ProcessWire Weekly #223

In the 223rd issue of ProcessWire Weekly we're going to dive into the world of database storage engines, introduce a new third party utility module called RandomPageName, and visit a really neat site of the week. Read on!

Welcome to the 223rd issue of ProcessWire Weekly. In this issue we're going to talk a bit about Ryan's latest blog post, focusing on the differences of database storage engines InnoDB and MyISAM, and the reasons why they matter when using ProcessWire.

In other news we're going to introduce a new module called RandomPageName, built and released by Bernhard Baumrock, and our latest site of the week belongs to an US based healthcare company HealthCARE Express. This particular site of the week comes with a rather extensive forum post, so for once we're given the chance to peek behind the scenes as well.

As always, a big thank you to all of you for being here with us, and please don't hesitate to drop us a note if there's anything in your mind that you'd like to share. Your feedback helps us focus on the things that you folks want to hear more about.

On the processwire.com blog this week: using InnoDB with ProcessWire

While there's no new core release to introduce this week, we do have a new post at the processwire.com blog. In his post Ryan walks us through some of the reasons we might want to use the InnoDB database engine (instead of the default engine, which is called MyISAM) with ProcessWire.

InnoDB in a nutshell

According to Wikipedia, InnoDB is "a storage engine for the database management system MySQL". As of MySQL version 5.5 released in December 2010 they have used InnoDB by default, replacing MyISAM as the default storage engine.

As of ProcessWire 3.0.15 we've been able to choose whether ProcessWire should use InnoDB or MyISAM during the installation step. At least for the time being we're still defaulting to MyISAM, because it's known to work very well on a wide range of hosts.

InnoDB or MyISAM, why should I care?

There are some notable differences between InnoDB and MyISAM, and in his post Ryan focuses on two benefits that InnoDB has over MyISAM: row locking vs table locking, and transactions:

  • InnoDB supports row locking, which makes concurrent write or update operations notably faster than on MyISAM, which only supports table locking. In other words switching to InnoDB can improve performance drastically especially when you've got a lot of frequently updated data.
  • Transactions are essentially a feature that allows you to bundle multiple database operations together, so that they get performed together, and either they all succeed – or none of them succeeds. Ryan has a really good example of this in his blog post, so check out his post for details on why and how this really matters.

Depending on your use case the features mentioned above may or may not be hugely important, but either way there are no major benefits in choosing MyISAM these days, obviously apart from your web host not supporting it.

For more details and some code examples showcasing the use of a couple of somewhat lesser known $database API variable features (beginTransaction and rollBack), don't forget to check out Ryan's weekly post at the processwire.com blog. Thanks!

New module: RandomPageName by Bernhard Baumrock

RandomPageName is a new module developed by Bernhard Baumrock. This module adds two new options to Page objects:

  • $page->getRandomPageName() returns a new, randomized name for the page. When called, this method creates the name on the fly using the core Password implementation as a randomizer, and make sure that it's valid and unique.
  • $page->setRandomPageName() does the same thing, except this time it also saves the page with the newly created random name.

Behind the scenes this module makes use of the randomPass() method of the core Password class, and the methods mentioned above also support custom configuration settings providing as an array param:

$page->setRandomPageName("has_parent={$page->parent}", [
    'minLength' => 5,
    'maxLength' => 5,
]);

The first param displayed above is an optional selector string defining in which context the name has to be unique – by default it is made unique site-wide, but you can easily limit that behaviour to a specific branch or template etc. See Password.php for an up to date list of the available configuration settings for the randomization process.

Big thanks to Bernhard for this handy utility module – this is definitely a handy feature for a number of different use cases and projects out there!

Site of the week: HealthCARE Express

Our latest site of the week belongs to a company called HealthCARE Express. This US healthcare company hosts urgent care, dermatology, and pain management clinics in Texas, Arkansas, Oklahoma, and Louisiana. The focus of the company is on providing their customers best possible service – or, in their own words, a “WOWZA” customer service experience.

The HealthCARE Express website was first introduced in a showcase forum thread by the developer of the site, Joe Regan of WebProJoe.com. In addition to regular content pages the site's features also include a blog section and a locations search feature built with the jQuery Store Locator plugin. Some of the third party plugins in use include Hanna code, Google Map Marker, Inputfield Ace Extended, MarkInPageTree, and Video Embed for YouTube/Vimeo.

Perhaps the most unique aspect of this site is still the build process itself. You can find a rather in-depth introduction to that at the showcase thread mentioned earlier, but to summarize: pretty much everything you see on this site – including markup, scripts, and styles – is managed via the Admin. Suffice to say we've never seen anything quite like this before. On this site everything really is a page.

Our congratulations to HealthCARE Express for their splendid new website, and thanks to Joe for sharing this site with us, especially in so much detail. It's always great to see ProcessWire being used for something unique, and this site definitely fits the bill!

Stay tuned for our next issue

That's it for the 223rd issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 25th of August. As always, ProcessWire newsletter subscribers will get our updates a few days later.

Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!

This post has 1 comment:

Patrick on Monday 20th of August 2018 10:53 am

great site - I'm currently building one with UIKit and wondering how the menu with the 3 columns dropdown was created - I'm trying to get it working with ProcessMenuBuilder. Any tips from @WebProJoe would be greatly appreciated.

Post a comment