From Three Days to 15 Minutes
by snoofle
in Feature Articles
on 2013-06-05
The Abstractor, as Greg and his team liked to call him, was a contractor at their company. The Abstractor had built a C# framework architecture (affectionately called Big Momma) that quickly went from being the company's framework, to being his personal baby. At the heart of Big Momma were abstract "Values" collections that wrapped the normal microsoft.net collections. This was so that any time The Abstractor decided that using arrays, XML or List<T> was bad, he could easily change "Values" to store data in some other data structure, and the code using it would be none-the-wiser. After all, enlightened developers use encapsulation, right?
While The Abstractor tended to stay away from any code that involved business logic due to his time being too valuable to be spent researching anything, he was eventually forced into creating a service that populated a database table for the new e-commerce website. The table would be used as a quick "real time" check for determining if a product was available at a location for in-store pickup. The records for each and every product needed to be updated every 30 minutes. Using Big Momma and armed with his "Values" collections, The Abstractor quickly had a solution in place. Unfortunately, it took 3 days to process 500,000 rows in the database - once. Greg was amazed that it could run that slowly. That was until Greg saw this error exception: