Over a million developers have joined DZone.

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

· Database Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

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.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:

Published at DZone with permission of Daniel Doubrovkine. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}