This RFC proposes adding a data mapper facility to core. Hopefully, this will promote domain-driven design and help isolate database access. It seems compatible with the recently approved move to a service-oriented architecture. An implementation with tests and examples is provided.
Implemented and merged on a WIP branch of the Campaigns extension for the Editor campaigns project
Details: https://www.mediawiki.org/wiki/Requests_for_comment/Data_mapper
Has overlap and should be coordinated with: https://www.mediawiki.org/wiki/Requests_for_comment/SQL_framework