If Wordpress is switching from PHP to Node.js, how should they do it?

By: (plus.google.com) +David Herron; Date: 2015-12-17 08:54

Tags: Wordpress » Node.JS » Drupal

Supposedly the Wordpress team is migrating Wordpress from PHP to Node.js.

Supposedly the Wordpress team is migrating Wordpress from PHP to Node.js. That astonishing bit of news (news.sys-con.com) comes from news.sys-con.com, but the evidence presented isn't exactly compelling. He refers to a recent blog post by Matt Mullenweg, CEO of Automattic, praising Node.js and how the Automattic team had used Node.js in developing Calypso. He also refers to (davidherron.com) the architectural gains I discussed yesterday - microservice architecture can make for a cleaner overall system, and more. While the prospect of completely switching Wordpress from PHP to Node.js seems extremely daunting, it's possible the Wordpress team will approach this in piecemeal fashion (if they do it at all).

Wordpress has seen years of successful use by zillions of websites. Wordpress is perhaps the most popular website platform. You might think "Why mess with success?"

In Mullenweg's blog post he makes the case that Wordpress is being bogged down by years of baggage due to the need to maintain compatibility. Perhaps part of that baggage is PHP itself, but the rest is the architecture of Wordpress. The rapid move towards mobile devices, highly interactive services, etc etc, the architecture of systems like Wordpress must drastically change in order to keep up.

The inclusion of support for REST API's in Wordpress 4.4 is a big step in that direction. But, the basic architectural paradigm doesn't suit itself well to mobile oriented web services, because such mobile apps require a highly transactionally oriented service architecture.


First you have to ask "Why" - because the task of recasting the years of knowledge baked into Wordpress is not something to be undertaken lightly.

I'd suggest these points:

  • Node.js architecture is more suited to the modern web than most any other language.
  • While the PHP team is redesigning/modernizing PHP, JavaScript and Node.js don't carry the sort of baggage that PHP carries
  • JavaScript on both server and client finally implements the long time dream of the same language at all layers of the application stack
  • Node.js shines brightly when presented with highly transactional workloads.

Big hurdle - Node.js hosting is rare

The big advantage of PHP is you can get PHP hosting from zillions of web hosting companies. That makes the Wordpress 5-minute install a piece of cake. Node.js hosting is rare ... meaning the mom-and-pop self-hosted Wordpress websites (like my own (longtailpipe.com) LongTailPipe blog) would be incredibly harder to self-host like we currently do.

Of course if Wordpress were to switch to Node.js, the hosting companies would be highly encouraged as a result to develop simple easy-to-use Node.js hosting support.

Did Mullenweg really promise a switch to Node.js?

His blog post (linked above) does not make an explicit promise of this sort. Instead the entire post spends its time praising the approach used in Calypso, to split the administrative screens out to a separate application that talks with (wordpress.com) Wordpress.com (Jetpack) via a REST API.

He talked about how the administrative backend of Wordpress hasn't changed much in years -- "The basic paradigms of wp-admin are largely the same as they were five years ago."

He talked about how the current design of Wordpress and the inability to make major changes are holding it back -- "that an incremental approach wouldn’t give us the improvements we needed, and that two of the things that helped make WordPress the strong, stable, powerful tool it is — backward compatibility and working without JavaScript — were actually holding it back."

The Calypso project grew out of the idea to experiment with this question -- "What would we build if we were starting from scratch today, knowing all we’ve learned over the past 13 years of building WordPress? "

Therefore, it seems that Mullenweg is implying that Wordpress will sooner-or-later switch to Node.js on the server -- maybe -- but it won't be a wholesale change done all at once. That's good, because there's too much institutional knowledge baked into Wordpress Core to switch in any kind of stable manner.

My recommendation for how the Wordpress community should approach this idea

I'm a long-time Drupaler (this blog runs on Drupal), who has written a book about Node.js application development (see book cover image in sidebar), who has developed (akashacms.com) a pseudo-CMS written in Node.js, and who has done a significant amount of work with Wordpress this year, that includes getting a Wordpress plugin into the Wordpress.org repository. Ergo, I have some background with which to make some reasonable suggestions.

The key thing is to not do this all at once. Instead the team should do it one piece at a time.

For each piece of Wordpress do something like this:

  • In the PHP version of Wordpress: for a given functional segment, wall it off the code into a separable module
  • Make a well defined API for the module
  • Strictly enforce rules that all other code within Wordpress only use that API
  • Extend the API as needed to support the use-cases existing in Wordpress code
  • Have a configuration mechanism so that this separable code module can be replaced with an external module which implements the same API
  • Implement in Node.js such a module

This way Wordpress Core can organically move towards a modular structure, and the Wordpress team can continue experimenting with the best way to break up Wordpress while maintaining the institutional knowledge baked into the existing code. Additionally, as pieces of Wordpress become separable modules, the Wordpress team should be able to reap some efficiency benefits.

An example that might be interesting is the user account management system. If that were a separable service, the same user accounts could be shared among multiple websites. The default for Wordpress would be to use a local user account management system. For more complex Wordpress sites spanning multiple Wordpress instances, a "remote" user account management service could be used.

Another thing to consider is one of the big changes made by the Drupal team in Drupal 8. That is to separate out configuration data from the database, and instead store it as YAML files in the file system. They recognized that putting configuration data into the database made it much harder to treat a website as buildable code, and for example have separate easily managed development and staging and live websites.

« Big Brother touched Juniper Networks - backdoor allowed anyone to eavesdrop on communications Republican Presidential Candidates want massive violation of First Amendment and other American legal freedoms »
2016 Election 2018 Elections Acer C720 Ad block Affiliate marketing Air Filters Air Quality Air Quality Monitoring AkashaCMS Amazon Amazon Kindle Amazon Web Services America Amiga and Jon Pertwee Android Anti-Fascism AntiVirus Software Apple Apple Flexgate Apple Hardware History Apple Hardware Mistakes Apple iPhone Apple iPhone Hardware April 1st Arduino ARM Compilation Artificial Intelligence Astronomy Astrophotography Asynchronous Programming Authoritarianism Automated Social Posting AWS DynamoDB AWS Lambda Ayo.JS Bells Law Big Brother Big Data Big Finish Big Science Bitcoin Mining Black Holes Blade Runner Blockchain Blogger Blogging Books Botnets Cassette Tapes Cellphones China China Manufacturing Christopher Eccleston Chrome Chrome Apps Chromebook Chromebox ChromeOS CIA CitiCards Citizen Journalism Civil Liberties Climate Change Clinton Cluster Computing Command Line Tools Comment Systems Computer Accessories Computer Hardware Computer Repair Computers Conservatives Cross Compilation Crouton Cryptocurrency Curiosity Rover Currencies Cyber Security Cybermen Cybersecurity Daleks Darth Vader Data backup Data Formats Data Storage Database Database Backup Databases David Tenant DDoS Botnet Department of Defense Department of Justice Detect Adblocker Developers Editors Digital audio Digital Nomad Digital Photography Direct Attach Storage Diskless Booting Disqus DIY DIY Repair DNP3 Do it yourself Docker Docker MAMP Docker Swarm Doctor Who Doctor Who Paradox Doctor Who Review Drobo Drupal Drupal Themes DuckDuckGo DVD E-Books E-Readers Early Computers eGPU Election Hacks Electric Bicycles Electric Vehicles Electron Eliminating Jobs for Human Emdebian Encabulators Energy Efficiency Enterprise Node EPUB ESP8266 Ethical Curation Eurovision Event Driven Asynchronous Express Face Recognition Facebook Fake Advertising Fake News Fedora VirtualBox Fifth Doctor File transfer without iTunes FireFly Flash Flickr Fraud Freedom of Speech Front-end Development G Suite Gallifrey Gig Economy git Github GitKraken Gitlab GMAIL Google Google Adsense Google Chrome Google Gnome Google+ Government Spying Great Britain Green Transportation Hate Speech Heat Loss Hibernate High Technology Hoax Science Home Automation HTTP Security HTTPS Human ID I2C Protocol Image Analysis Image Conversion Image Processing ImageMagick In-memory Computing Incognito Mode InfluxDB Infrared Thermometers Insulation Internet Internet Advertising Internet Law Internet of Things Internet Policy Internet Privacy iOS iOS Devices iPad iPhone iPhone hacking Iron Man iShowU Audio Capture iTunes Janet Fielding Java JavaFX JavaScript JavaScript Injection JDBC John Simms Journalism Joyent jQuery Kaspersky Labs Kext Kindle Kindle Marketplace Large Hadron Collider Lets Encrypt LibreOffice Linux Linux Hints Linux Single Board Computers Logging Mac Mini Mac OS Mac OS X Mac Pro MacBook Pro Machine Learning Machine Readable ID Macintosh macOS macOS High Sierra macOS Kext MacOS X setup Make Money Online Make Money with Gigs March For Our Lives MariaDB Mars Mass Violence Matt Lucas MEADS Anti-Missile Mercurial MERN Stack Michele Gomez Micro Apartments Microsoft Military AI Military Hardware Minification Minimized CSS Minimized HTML Minimized JavaScript Missy Mobile Applications Mobile Computers MODBUS Mondas Monetary System MongoDB Mongoose Monty Python MQTT Music Player Music Streaming MySQL NanoPi Nardole NASA Net Neutrality Network Attached Storage Node Web Development Node.js Node.js Database Node.js Performance Node.js Testing Node.JS Web Development Node.x North Korea npm NSA NVIDIA NY Times Online advertising Online Community Online Fraud Online Journalism Online News Online Photography Online Video Open Media Vault Open Source Open Source and Patents Open Source Governance Open Source Licenses Open Source Software OpenAPI OpenJDK OpenVPN Palmtop PDA Patrick Troughton PayPal Paywalls Personal Flight Peter Capaldi Peter Davison Phishing Photography PHP Plex Plex Media Server Political Protest Politics Postal Service Power Control President Trump Privacy Private E-mail server Production use Public Violence Raspberry Pi Raspberry Pi 3 Raspberry Pi Zero ReactJS Recaptcha Recycling Refurbished Computers Remote Desktop Removable Storage Renewable Energy Republicans Retro Computing Retro-Technology Reviews RFID Rich Internet Applications Right to Repair River Song Robotics Robots Rocket Ships RSS News Readers rsync Russia Russia Troll Factory Russian Hacking Rust SCADA Scheme Science Fiction SD Cards Search Engine Ranking Search Engines Season 1 Season 10 Season 11 Security Security Cameras Server-side JavaScript Serverless Framework Servers Shell Scripts Silence Simsimi Skype SmugMug Social Media Social Media Networks Social Media Warfare Social Network Management Social Networks Software Development Software Patents Space Flight Space Ship Reuse Space Ships SpaceX Spear Phishing Spring Spring Boot Spy Satellites SQLite3 SSD Drives SSD upgrade SSH SSH Key SSL Stand For Truth Strange Parts Swagger Synchronizing Files Tegan Jovanka Telescopes Terrorism The Cybermen The Daleks The Master Time-Series Database Tom Baker Torchwood Total Information Awareness Trump Trump Administration Trump Campaign Twitter Ubuntu Udemy UDOO US Department of Defense Video editing Virtual Private Networks VirtualBox VLC VNC VOIP Vue.js Walmart Weapons Systems Web Applications Web Developer Resources Web Development Web Development Tools Web Marketing Webpack Website Advertising Website Business Models Website Security Weeping Angels WhatsApp William Hartnell Window Insulation Windows Windows Alternatives Wordpress World Wide Web Yahoo YouTube YouTube Adpocalypse YouTube Monetization