
Death by Database: a short story of how a bad schema can hurt you company - Ovid
https://ovid.github.io/articles/death-by-database.html
======
Sujan
Is that really "bad database design"? Sounds a lot more like "perfectly fine
design for the original use case".

Re/Abusing a customer database based mass mailing tool to send non-customer
mass mailings is a new use case, so requires changes either a) on the database
side - or b) in the mass mailing tool (to use another database table that is
not connected to the customer side of things). I would have preferred b) for
many reasons.

~~~
Ovid
Did you catch the part about duplicate/misspelled addresses? The design wasn't
even fit for the original use case.

~~~
Sujan
Yes, but that is an unrelated mess (and another reason not to reuse anything
of that db for non customer mailings).

The simplest fix for the "duplicate/misspelled addresses" indeed was to remove
the "unique address" requirement and just let each customer have its own set
of addresses that are only connected to that customer.

Letting an address be connected to multiple customers (many to many) sounds
great in theory, but is a disaster waiting to happen in practice.

Also, is a couple actually one customer or two separate customers? What about
the customer's "friend"'s address in the system?

Of course this is all from the outside, knowing nothing about anything on the
inside - so there might have been good reasons for why it all was how it was.

