What is the "worst" code base you worked on?
retained text
<!-- SC_OFF --><div class="md"><p>Around five years ago I joined a hyped startup as a contractor. I was doing too much architectural work at my current job and wanted to do more coding. They needed someone to do smaller features 10-15 hours a week.</p> <p>Typical CRUD SaaS. Started out as a .NET MVC monolith. Architectural decisions were documented in a JIRA board, so you could kind of read up on the history leading to the current state of the application.</p> <p>So the main source of problems started with the database:</p> <ul> <li>Extreme normalization. They pretty much normalized everything that you could possibly normalize.</li> <li>Naming conventions. Three-letter acronyms for tables and columns. Some acronyms were obvious but there were so many that were hard to understand and figure out.</li> <li>Enums stored as an integers. This is fine, but with an extreme amount of states/flags, and in combination with the normalization and acronyms, it just made the database so unnecessary hard to use.</li> <li>They figured that the database design was broken and changed the design principles. The problem now being that they went too far with denormalization. The new tables ended up with index bloat, inconsistent data and state conflicts when denormalized to multiple tables etc etc. Now half the database was broken due to normalization and the other half broken due to denormalization, never hitting that sweet spot.</li> </ul> <p>Consequences:</p> <ul> <li> A pull request would often have massive changes to the data access layer and complex migrations. There was no strategy. Often features would not get released because no one knew how to avoid or handle the large merge conflicts. You often had to start over on the latest master branch, sometimes more than once.</li> <li> Ugly workarounds/hacks were introduced. Table A, B and C had super slow inserts, a new database was created with a set of identical tables, 50% of the inserts now goes to the new database, and there are scheduled tasks to move data from db2 to db1 during the night. All reads must now read from two databases, and updates needs to go to the correct database.</li> <li> More ugly hacks. A lot of queries were too slow. They decided to create scheduled tasks to pre-populate a redis cache with the results. No one thought of cache invalidation. This caused massive issues with state conflicts all over the place. They started to work on cache invalidation when it became obvious, but it was just too complex to make it work.</li> <li> Logging started to become an issue with the growing database. They wanted logs to have a reference to data in its state when the log was created. So the logging utility would fetch a ton of data from the db and store as a json blob with the log. The logging utility would generate more db queries than the application itself.</li> <li> The application was so broken that any feature was really hard to ship. They decide that all new features should be built on a new micro service architecture, a 3rd database was also introduced. The problem was that new features could not be isolated to the new microservices and database, this just made everything worse with new complex dependencies between the monolith and the micro services.</li> </ul> <p>This has been the only time in my career where i just couldn't figure out solutions. I was literally looking at the requirements and could not figure out a solution on how to ship this without just breaking things left and right.</p> <p>Have you worked on something similar?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/vismbr1"> /u/vismbr1 </a> <br /> <span><a href="https://www.reddit.com/r/ExperiencedDevs/comments/1tuwocl/what_is_the_worst_code_base_you_worked_on/">[link]</a></span>   <span><a href="https://www.reddit.com/r/ExperiencedDevs/comments/1tuwocl/what_is_the_worst_code_base_you_worked_on/">[comments]</a></span>
document fetched 2026-06-03 10:48