The MediaWiki default is to store localisation cache in the database.
At WMF production, it's been the case for many years that these are stored as a file on disk instead, in a private cache directory. MediaWiki offers two well-tested formats for this: php array files, and CDB files. CDB files is what WMF currently uses in production. PHP-array files is what we're moving toward (T99740), which are faster to generate and faster to read than CDB files.
For third parties, this means:
* More scalableperformant by default. We'd no longer require db-master connections on web requests when repopulating the localisation cache.
* Better recache performance.
This seems like a fairly easy thing to enable by default. Should we do that? Are there reasons we haven't already?#### Benchmark
### Later>>! From T218207#5138303
>
> | Test case / LCStore | Database table (current MW default) | Static array files (proposed)
> | |--|--|--
> | 1 (Populate 1 language) | 3.782s, 4.000s, 3.981s | 3.118s, 3.161s, 3.041s {icon arrow-circle-o-down color=green}
> |--
> | 2 (Populate all languages) | 1m51s, 1m47s, 1m33s | 1m13s, 1m13s, 1m10s {icon arrow-circle-o-down color=green}
> |--
> | 3 (Page load time) | 2013 ms, 2049 ms, 2049 ms | 1771 ms, 1628 ms, 1809 ms {icon arrow-circle-o-down color=green}
> |--
This seems like a fairly easy thing to enable by default. Should we do that? Are there reasons we haven't already?
For core, if we later remove the db option (because why would we keep it?), then after the next release it would mean:#### Sub tasks
* Lower complexity in database management. MediaWiki currently has dedicated db-related logic that carefully establishes multiple connections to the same database,{icon check-square-o} Benchmark the different static file formats (php vs cdb). so that localisation-cache queries are not blocked behind regular database queries.
* Fewer LCStore implementations to maintain and test– T218207#5138303.
* One less database table in our schema (yay)* {icon square-o} Decide where to store them on disk. Some options discussed at T218207#5160934.