5 ms·
Yes, and I don't understand why Wordpress does not support it officially and we need to use MySQL instead.
by wslh 14y ago
Yes, and I don't understand why Wordpress does not support it officially and we need to use MySQL instead.
- techtalsky 14y agoI think WordPress just tries to cut complexity by using MySQL only so it doesn't have to deal with support for arbitrary RDBMS's.
- TazeTSchnitzel 14y agoMore likely, the code is poorly written and heavily reliant on MySQL.
- jacques_chester 14y agoThis is more or less the correct answer for Wordpress-the-ecosystem. Wordpress-the-base-install has a thin abstraction layer over the database in the $wpdb object. But plugins and themes can, and regularly do, use PHP's MySQL functions to access and manipulate the DB directly.
- glurgh 14y agoThe theoretical answer is because SQLite is not the right tool for the sort of things Wordpress does. SQLite supports more concurrency than one might expect from an embedded db - it's still an embedded db, though. Writing, for instance involves a database-global lock. The practical answer is - Wordpress is written in a MySQL-specific way. It doesn't officially support, say, Postgres or Oracle either.
- masklinn 14y ago> The theoretical answer is because SQLite is not the right tool for the sort of things Wordpress does. Which probably isn't true. SQLite is bad at concurrent writes. Your average wordpress install is almost only reads. And with 3.7.0's WAL, readers and writers don't block one another anymore.
- glurgh 14y agoThe trouble is that there are many, many Wordpress sites out there that are not an average Wordpress install. People (disturbingly) write e-commerce sites on top of Wordpress. SQLite is not the right tool for the sort of things Wordpress does not because you couldn't write a blogging tool using SQLite but because Wordpress is crazy.
- jeltz 14y agoIf one could write blogs and ecommerce sites using MyISAM (shrudders) then why wouldn't SQLite work? MyISAM had -- at least in theory, I have not done any benchmarks -- even worse concurrency than SQLite.
- glurgh 14y agoI hope I've completely forgotten any details of the convoluted locking behaviours and tuning options of MyISAM (which, in my head at least, is read as 'miasma') but they were there to at least attempt to support certain types of concurrency. And they were table-level whereas the SQLite write lock is db-wide. Could you reasonably write blogging software that uses SQLite? Sure. It's just that Wordpress isn't that blogging software - it's written to be paired with MySQL, for good or ill.
- jeltz 14y agoMyISAM has reader/writer table locks[1] which meant that nobody could read while someone was writing to a table. SQLite can be ran in two modes 1) database reader/writer lock or 2) in WAL mode[2] where readers do not block writers and writers do not block readers. Writers block each other though so there can only be one concurrent writer. WAL mode provides concurrency superior to what MyISAM did. 1. The locks could sometimes be bypassed by inserts, but not reliably so. 2. http://www.sqlite.org/wal.html
- glurgh 14y agoSure but WAL in SQLite is 3 years old. Wordpress is 10 years old. MySQL with MyISAM is a lot older than that. I personally happen to think almost everything about Wordpress is wrong. It's just hard to blame them they didn't start or subsequently adopt SQLite. I doubt it's ever been as much as on their radar.
- rmccue 14y agoWordPress doesn't support anything except MySQL because all the queries are specifically written for it. Developing for a single database enables the queries to be optimized for that database. (That's the official WP line anyway, I'd love Postgres support myself.)