WordPress’ Performance Team contributors have merged a new experimental SQLite integration module that is on track to be included in the upcoming version 1.8.0 of the Performance Lab plugin. (This is the plugin that contains a collection of feature plugins with performance-related modules the team hopes to land in WordPress core.) The new module allows the adventurous to test the new SQLite implementation, with the understanding that the overall user experience will still be rough.
In a proposal titled Let’s make WordPress officially support SQLite, Yoast-sponsored core contributor Ari Stathopoulos contends that less complex sites (small to medium sites and blogs) don’t necessarily benefit from the requirement of using WordPress’ standard MySQL database:
On the lower end of the spectrum, there are small and simple sites. These are numerous and consist of all the blogs, company pages, and sites that don’t have thousands of users or thousands of posts, etc. These websites don’t always need the complexities of a MySQL/MariaDB database. The requirement of a dedicated MySQL server increases their hosting cost and the complexity of installation. On lower-end servers, it also decreases performance since the same “box” needs to cater to both a PHP and a MySQL/MariaDB server.
In an ideal world, users could select their database type during installation. Stathopoulos said this would require WordPress to have a database abstraction layer, which other platforms like Drupal have had more 10+ years.
“Building a database abstraction layer for WordPress would be a colossal task – though it might be one that, at some point in the future, we may have to undertake to ensure the project’s continued evolution and longevity,” he said.
As an alternative, Stathopoulos sees SQLite as a “perfect fit” and cited the benefits of using it for smaller websites:
- It is the most widely used database worldwide
- It is cross-platform and can run on any device
- It is included by default on all PHP installations (unless explicitly disabled)
- WordPress’s minimum requirements would be a simple PHP server, without the need for a separate database server.
- SQLite support enables lower hosting costs, decreases energy consumption, and lowers performance costs on lower-end servers.
This new SQLite integration module is based on the wp-db-sqlite plugin, a SQLite database driver drop-in that is also used by the WordPress Sandbox project, as WASM doesn’t support MySQL. The wp-db-sqlite plugin was based on the original work of Kojima Toshiyasu in his eight-year-old SQLite Integration plugin, which is no longer available for download on WordPress.org. Stathopoulos said these solutions have evolved over the years, have been thoroughly tested, and proven to work seamlessly, although they are not well known among users.
Matt Mullenweg commented in support of the proposal so the implementation moving into the Performance Lab plugin may have a decent shot at landing in core someday in the future. Most participants in the discussion on the proposal were supportive of the idea but also discussed a few of the potential drawbacks. These include poorer support for things like multi-author editing and search.
“MySQL is and should continue to be the default because if you have aspirations to be the next big thing, then MySQL can scale better,” Stathopoulos said.” If on the other hand you just want a blog, a company site with your about page and a contact form to have an online presence, or any type of small site (which is arguably the majority of sites on WordPress) then SQLite is all you’ll ever need and it will perform a lot better.”
A few participants in the discussion also bristled at the controversial, religious code of ethics SQLite holds for its contributors. Stathopoulos sees it as a non-issue because the project is open source and the technology is widely used.
“Its popularity speaks volumes regarding what it can do and where it can be used,” he said in response to criticism of the idea of tying WordPress to a project with an objectionable code of ethics.
If you have used WordPress from the early days, you have witnessed it become more complicated over the years. Discussions around the idea of a “WordPress Lite” have popped up every few years, but the platform’s specific selection of features seems to have been a major factor in WordPress powering 43% of the web (according to W3Techs). NerdPress founder Andrew Wilder suggested that a SQLite implementation might benefit from being branded as “WordPress Lite.”
“Reading the comments and potential issues above, if this does move forward, perhaps the way to implement this in a way that makes sense to users would be to brand it simultaneously as ‘WordPress Lite,’” Wilder said. “So if a site is using SQLite, there could be features that are simply no longer available (such as multiple authors, or perhaps plugins that have certain database requirements can’t be installed).”
Those who are interested in testing the new SQLite integration module should be able to test drive it next week. Google-sponsored Performance Team contributor Felix Arntz gave a few notes on testing in yesterday’s team meeting:
For the SQLite implementation, other than the SQLite DB working correctly by itself, another crucial aspect to test is the user experience on module activation. You’ll get an entirely new database, but we’ve added some logic to make the transition as seamless as possible: On a typical WordPress setup, you should not need to reinstall WordPress yourself when you enable the module, and you shouldn’t even be needed to log in again.
Basically the PR has logic to install WordPress automatically in the new database, using the same basic setup data that is present in the regular database.
Just keep in mind that it is by no means a migration. It’s only the install you’ll get; no content will be migrated.
The 1.8.0 release of the Performance Lab plugin is expected on Monday, December 19, and is set to include the new module.