Important: #102960 - TCA and system tables on one DB connection

See forge#102960

Description

TYPO3 v13 expects all database core system tables and especially all tables from extensions that have TCA attached to be configured for the main Default connection.

The TYPO3 core historically allowed configuration of any database table to point to additional configured database connections. This technically allows "ripping off" any table from the default connection table set, and have it on a different database.

TYPO3 now needs to restrict this a bit more to unblock further development and performance improvements: The core now declares that all "main" core tables (especially sys_*, pages, tt_content and in general all tables that have TCA) must not be declared for any connection other than the configured Default connection.

The reasons for this are actually pretty obvious: When looking at performance issues of bigger instances, the sheer amount of queries is usually the top-one bottleneck. The core aims to reduce this mid-term using more clever queries that join and prepare more data in fewer queries. Cross database joins are pretty much impossible.

This restriction has practically been the case with earlier core versions already: For instance when a TCA table configured "categories" and used them, the core already uses various joins to find categories attached to a record. Other places have been adapted with TYPO3 v13 already, for instance the ReferenceIndex. The core will try to additionally simplify the current API by avoiding getConnectionForTable() with further patches.

Apart from this, instances can still configure additional database connections. One target is directly querying data from some third party application in some custom extension. Another use case are database based caches: Those will of course never execute queries to join non-cache related data. A typical use is configuring a special database server for speed over integrity and persistence (for instance RAM driven) to power the "page" cache tables. This will continue to work, but might be turned into a dedicated feature of specific database backends, later.