WordPress contributors are making progress on officially supporting SQLite in core, a project that would benefit less complex sites (small to medium sites and blogs) that don’t necessarily require WordPress’ standard MySQL database. In a recent update, Yoast-sponsored core contributor Ari Stathopoulos said the SQLite Database Integration feature plugin has been rewritten, with the help of Automattic-sponsored core contributor Adam Zielinski, to be a more future-proof implementation.
“The code has been completely rewritten to use an SQL Lexer and is now stable and able to handle all WordPress queries properly,” Stathopoulos said. “The SQL Lexer is part of the PHPMyAdmin/SQL-Parser project (licensed under the GPL 2.0) and it was adapted for WordPress, effectively implementing a MySQL to SQLite translation engine. This provides improved security, as well as compatibility.”
Stathopoulos contends that the next step is to implement these changes in WordPress core “instead of using a plugin,” because in its current form it can only be tested on pre-existing websites that already have a MySQL database.
“Using the featured plugin is a great way to allow users to test the implementation and iron out any issues etc,” he said. “However, long-term, it doesn’t make sense to use it as a plugin.”
Although the effort has received positive feedback and support from the community and WordPress lead developer Matt Mullenweg, the feature plugin has only 30 active installs and the new implementation has received very little testing.
Multiple participants in the discussion, including core committer Aaron Jorbin and lead developer Andrew Ozz, expressed concerns about the proposal’s call for merging the changes to core as the next step.
“Talk of merging to core feels incredibly premature for a couple of reasons,” Jorbin said. “The plugin now only has around 30 installations. I think there needs to be much higher adoption in order to understand how the near-infinite number of plugins will work with this deep underlying change to WordPress.”
Jorbin also referenced WordPress’ philosophy of building things for end users who don’t want to have to make decisions about the underlying tech but simply want things to work.
“Assuming that a user is going to understand different database engines and the potential tradeoffs feels far stretched to me,” Jorbin said. “Therefore, any implementation really needs to be rock solid and extremely thoroughly tested.”
Jorbin also echoed concerns of other contributors in previous conversations, about SQLite’s bizarre religion-infused “code of ethics.”
Ozz suggested the plugin could be added to WordPress as a mu-plugin or a “drop-in” similar to how caching add-ons are implemented, pushing back on the rigidity of the requirement to fully merge it into core.
“Both of these methods are also better/more suitable for the users as they can be done by the hosting company or the script used for WordPress installation,” Ozz said. “There are some other benefits like independent updates, etc.”
Stathopoulos responded to these concerns, saying that he sees the merge to core as a long-term goal, although the proposal communicated more of an urgency that confused participants in the discussion.
“It is premature,” Stathopoulos admitted. “However, looking at the bigger picture, it is not premature to plan for the future and get ready for it.
“It may be premature now, but it won’t be 2 years from now… The problem is that we won’t be able to do it in the future unless we start working on it now.
SQLite is not something that can – or should – happen in Core now, or even a year from now. It’s a long-term goal, and should be treated as such.”
Stathopoulos agreed that the plugin needs more adoption to see how it works with plugins across the ecosystem. He also responded to concerns about users not fully understanding the implications of the database engine they select on installation.
“The proof-of-concept UI I put in place in the Core PR is just that – a proof of concept,” Stathopoulos said. “Something to trigger discussion and allow us to find solutions. It can be anything, even installation scenarios (do you want to create a blog? A small e-commerce site? A large news outlet? The next Amazon?) That is a discussion that will need to happen when the time is right to discuss UI, but it’s is a bit too early for that, I don’t think we’re there yet.”
Stathopoulos recommends contributors test the new implementation with all the plugins they normally use, via the SQLite Database Integration plugin or by testing the draft pull request in WordPress Core.