The different database tables should understand which database the query originated from; however, it gets complicated with sharded databases because each shard should have an identical schema and be part of a whole.
If we base the UID on the exact name of the database, each shard will have a different calculated UUID, and this becomes an issue when trying to group by the database when we want an aggregate of all shards.
Possible solutions could be to use a database prefix such as "shard_1", "shard_2" would have a prefix of "shard."
The different database tables should understand which database the query originated from; however, it gets complicated with sharded databases because each shard should have an identical schema and be part of a whole.
If we base the UID on the exact name of the database, each shard will have a different calculated UUID, and this becomes an issue when trying to group by the database when we want an aggregate of all shards.
Possible solutions could be to use a database prefix such as "shard_1", "shard_2" would have a prefix of "shard."