best approach to keys, if data from separate DBs to be presented in same UI Suppose we are creating databases containing information about monkeys, and a user interface to present monkey information to users.

We have two separate databases. The schemas are identical (and are at least intended to remain so) but they are on different machines and have information on different monkeys. This is inconvenient but unavoidable.

The user interface we're building queries both databases and presents all the monkeys in the same filterable HTML table to the user.

What's the best approach to generating IDs for monkeys? Is it acceptable to prefix the ID according to which database the monkeys are in?
I'd consider composite PK instead of prefixing values in one column. It seems a bit more clear to me, and it should help avoiding potential problems if you switch to single server (or cluster) in the future (then this column can be used as partition key).