4 ms·
> Sure but now you need to account for orphaned addresses. So in the scenario described you'd either end up accidentally purging the marketing addresses by clea
by Risord 8y ago
> Sure but now you need to account for orphaned addresses. So in the scenario described you'd either end up accidentally purging the marketing addresses by cleaning up the orphans or you'd send marketing material to old addresses.
I am not sure do I follow correctly but just send marketing to addresses which are linked to actual users. Note that some addresses are orphaned from users but not some other events like orders.
> If an address is to be shared between two people it should probably not include the recipient.
I don't remember details about how recipients were handled. The system was quite simple and just about business addresses. We didn't pretend that address map strictly to single physical place so synonymous addresses were considered distinct. Therefore if a recipient was part of an address that was just another distinction point.
> what do you gain from having addresses as separate entities
> If you just want to be able to say "shipping address is identical to invoice address", why not just have one or two addresses per user and never deduplicate?
In our case customer was always company which may have quite a lot of different addresses for different offices or departments. Addresses also had hight expected reuse and we exposed saved address as a "thing" for a user so that it's easy to browse customers own orders history for different addresses etc.
Uniqueness has been a quite neutral thing. Effectively it just removes case where the same customer has multiple equal addresses... Not much gain nor pain.
Edit:
At the end immutable shared entity is not much different from mutable and copied values. That's just one way of doing it and so far it hasn't back fired.