How I nuked an entire production database
Last year, I worked at Prime Wholesale, an e-commerce startup. Prime was looking to shift from a local store to an online platform, with the mission of bringing authentic goods worldwide.
Prime’s previous attempt to build an online presence had fallen short for various reasons. As a result, they assembled an in-house engineering team to rebuild the platform. This was my first exposure to e-commerce, and I was excited to explore this new space.
Our choice of Shopify seemed ideal for Prime’s needs, as not only provided streamlined development, but also managed processes for shipping and payments. While I helped with front-end elements, working with Shopify’s “Liquid” templating engine, my focus was backend work — handling database migrations and third-party integrations. During this, I got lots of technical and business insights regarding e-commerce.
The main challenge was working around Shopify’s API limitations — especially because of our extensive product catalog. I got creative, using Selenium automation and Node.js scripts to scrape and transfer data. However, about 90% of the way smooth-sailing through this migration, we encountered a major setback just a week before the anticipated launch.
An issue with product categories forced us to export all of our products, make modifications, and reimport them into the Shopify database. After deleting these exported products on Shopify, I noticed that all of the product images were completed wiped from Shopify servers, breaking all of the image URLs in the CSV file. With launch day on its way, I started panicking. Did we just lose all of our product images?
I didn’t let this panic get the best of me. Collaborating with the team, as well as product managers, I managed to match things up after a lot of hustle. Using backups and various other sources, I was able to salvage 95% of the product images in time, which was enough to ensure a successful website launch.
I learned a very valuable lesson from this experience: the importance of attention to detail. Assuming that image URLs would persist after deleting the products proved to be costly. I learned to never make such assumptions, and instead do extensive testing along each step of the way — especially when deleting an entire database.