Worst Data Engineering Mistake you've seen?
old.reddit.com
old.reddit.com
>...i once had to maintain a codebase that dealt with a variety of data in 2d arrays. the previous author (over a decade prior) wasn't aware that you could simply myArray[x][y] to do lookups, instead they wrote nested loops for all indexes in each array, and would break the loop when the index matched the one they were looking for. they also didn't use helper functions, so this happened inline throughout the app
The loops I don't have an explanation for though.
I think that this is a good reminder, however, that there are few "absolutes" when it comes to programming and that there are always edge cases where some things that look like "code smells" or even look plain wrong have their place.
You can create a simple Matrix type which stores single array, with a subscript operator that gives a 2D facade. It can let you call it with x/y pairs, but just lower that to an index into your single contiguous buffer.
Then they found that you could nest them in one larger query and each could independently return its own node in the XML, cool right?
Then they found out you could correlate the queries, making it oh so easy to extend and build out!
Then they built an entire insurance business on the gigabytes of XML they crapped out every day, which based on their business processes needed to get sent out once a day.
The process took more time, but it was ok, they had plenty of hours to spare in the day.
People kept adding though, feature requests kept coming in, and tech debt came piling in.
A few years later, they called me because their process had started failing, it was taking over 24 hours on the biggest EC2 instance they could afford, and of course this was a single instance commercial database.
I took a look and it was the worst pile of nested SQL I had ever seen, over 300k LOC of pure XML/SQL hell all nested together, the query plan broke the client - over 100MB.
I told them there was nothing I could do, they should _start over_.
The team at the time setup a public Google doc with all the info and a public video stream on YouTube with the devs taking about what to do/what they are doing.
I've never seen anything like that before or after, although I bet lots of prod db get deleted every day:p
This video goes through the timeline of the main points
Absolutely. I have at least three stories from friends who witnessed these sort of events first hand, and so many of posts in the genre online affirm that its a regular occurence.
I've yet to hear of a case where there weren't backups for prod, but I'm sure those exist to.
https://github.blog/2010-11-15-today-s-outage/
These sloppy setups are common even today, where it's fairly easy to allow for a simple config error or a wrong environment variable (env=PROD) to wipe out production from a test suite. These safeguards need to be in place in the first days of your codebase.
So even if you allow for connection to production (sometimes that's allowed for debugging hard-to-reproduce issues), you want to remove any room for human error.
And your code should obviously NEVER be able to connect to anything other than the local test DB when your environment is set to "TEST".
Or maybe that was another story hehe.
Funny thing happened when you pressed both the on and off button at the same time[1], based on empirical observatgions, both the turn-on-lamp and turn-off-lamp processes would spawn, and they'd both race against each other, almost turning the light on, almost turning the light off. So we got flickering disco lighting until someone called a technician to reboot the server. Good times.
[1] of course on and off they were discrete buttons, rocker swiches are so outdated.