Create slim service(s) that abstracts away getting a new database connection via LoadBalancer/LBFactory.
This service should only handle 1: getting the connection and 2: waiting for replication. And //maybe// handling for some edge cases //iff// there are some in the existing usage.
We want two slightly different services/interfaces/implementations for Repo and Client connections
- So we can use them for type-hinting
- Their public methods should likely be the same, they will only differ in their constructor
- Repo connections will have their domain configured, but otherwise fixed
- Client connections will have to be given the domain dynamically depending on the wiki
- We want to provide the load groups `from-repo` and `from-client` for every connection
- We may want to provide more load-groups in the future
See https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602823 for an initial draft in this direction.
This service should (ultimately) be extracted into a separate package as proposed by ADR-14 (not yet accepted).
NOTE: LBFactory/Loadbalancer have some internal caching -> we need to make sure we understand how that works, otherwise unexpected things may happen. (Ask @Ladsgroup if confused)
See parent task for more context