Talk:Requests for comment/DataStore/LQT Archive 1

Currrent state
There is no generic persistent key-value store in MediaWiki. This results in creation of multiple tables even when underlying data doesn't need joins with other tables or lookups by various fields.

Examples of such tables that are never going to have more than 1 row:
 * site_stats (core)
 * geo_updates (Extension:GeoData)

Another example is external storage that can use a generic key-value store rather than implement a custom version of it.

Proposal
A few design points:
 * Key-value storage.
 * Generic, allowing numerous implementations with different backends, possibly including NoSQL in the future.
 * Only simple, atomic operations.
 * Records are searchable by key prefix.
 * Keys shouldn't be mangled to allow prefix search and transfer from one storage engine to another.
 * To facilitate transfer, maximum key length should be enforced across all implementations.
 * Basically, I (MaxSem) want something like BagOStuff but with persistence.
 * Ability to have more than one store, using different engines/servers.

Proposed implementation skeleton is at . It's not an actual, functional code but just a demo of how it could look.

Example usage: