5 ms·
> The mistake was that email-user identity is not a true invariant. That's true. I also wonder if there's an issue with lack of modeling experience or strategy
by yowlingcat 6y ago
> The mistake was that email-user identity is not a true invariant.
That's true. I also wonder if there's an issue with lack of modeling experience or strategy. Natural key vs surrogate key is a really important distinction to make when modeling first party data. I've observed a common preference towards the latter (with uniqueness constraints) as a default. I think that's because generally it's more useful (and common) than not to be want to insert new things into your collection with monotonically increasing unique primary key values autogenerated without you having to do any of the accounting. I think natural keys are still useful, just in a RO/projection/ETL based use case.
> you have a huge brittle process for migrating a user between emails, or your entire codebase starts getting littered with statements looking for previous email addresses and copying data on the fly.
It's so unfortunate how easy of an error this is to make and how much it makes any future work on the codebase shittier. Eventually, it all needs to be refactored to regain any measure of sanity. I see so many companies that are bitten by this. Once it gets going, it becomes really awful for the engineers that have to maintain it. Morale takes a hit and attrition amps up. So much net human suffering that could have been avoided by hiring competent people to do the upfront work in the first place when the code was being written.
- prionassembly 6y agoI used to have an Amazon.com account under my@email.com. When Amazon arrived to my country, I was encouraged to migrate, but Amazon.mc didn't have the same selection. After a while I wanted to buy a laptop from Amazon.mc and registered under a phone number. Last week my music keyboard broke and I wanted to buy a digital piano from Amazon.mc but they insisted now that I register an email address. And then my email address is already in use.