4 ms·
> In what context would a primary key change, even when sharding? If you're using natural keys, and one of them is displayable text, and then the business says
by chiph 9y ago
> In what context would a primary key change, even when sharding?
If you're using natural keys, and one of them is displayable text, and then the business says "We decided to rename the 8th sales district. Can you change it for us?"
Was this a good design? Maybe not. But legacy happens.
We're dealing with a vendor right now that has references to look-up tables based on display text. They should have used surrogate keys of some kind. Or at the least, code columns so that the database is mostly unaffected when values shown to the users get renamed. (Also useful for I18N work)