|
|
|
|
|
by sam_bishop
742 days ago
|
|
> If you’re storing doubly linked lists in a DB you’re doing it wrong. Assuming that the database uses B+ trees (like most do), then the database records themselves are very likely to be in a doubly linked list. Not every doubly linked list is the kind you see in an introductory data structures class. |
|
The developers had been writing messy heuristic workarounds for database low-level corruption in application code for over a decade, instead of figuring out the cause and fixing that.
For example, application code had special routines to attempt to detect and ignore duplicate records in some queries (but not others), in response to customer bug reports, but of course that didn't fix missing records or make the data correct. It just patched over an observed symptom. It also didn't fix all the places it could happen, so much of the application still had occasional flaky behaviour, but not consistently enough to be reported in detail and get the (bad) workarounds to hide it.
Correctly implemented transactions are very helpful for database internals and on-disk structures too, not just for the API level presented to applications.