NoSQL Zone is brought to you in partnership with:

Daniel Doubrovkine (aka dB.) is one of the tallest engineers at Art.sy. He founded and exited a successful Swiss start-up in the 90s, worked for Microsoft Corp. in Redmond, specializing in security and authentication, dabbled in large scale social networking and ran a big team that developed an expensive Enterprise product in NYC. After turning open-source cheerleader a few years ago in the worlds of C++, Java and .NET, he converted himself to Ruby and has been slowly unlearning everything he learned in the last 15 years of software practice. Daniel has posted 46 posts at DZone. You can read more from them at their website. View Full User Profile

Data Corruption: It's the Code, Not the Database

02.13.2013
| 1608 views |
  • submit to reddit

I am increasingly convinced that those who blame MongoDB for any kind of data corruption are waving hands out of desperation. Every single time I had an issue with data I ended up finding code that I’ve written or code that was written in a library that I used. The hardest bugs involve some kind of concurrent operation, including one I’ve described in a new post on the Artsy Engineering blog: Data Corruption and Concurrent Updates to Embedded Objects w/ MongoDB. Read it, especially if you are using an ODM to manipulate embedded objects.

I also want to point out two magical lines of code that I use all the time.

    Moped.logger = Logger.new($stdout)
    Moped.logger.level = Logger::DEBUG

Knowing what Mongoid is doing is half the battle.

Published at DZone with permission of its author, Daniel Doubrovkine. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)