Sensitive Data in MongoDB At KoanHealth, we work with healthcare data and use Ruby and MongoDB as our primary database to store patient data. This means that is has to be secure at rest and over the network. We looked at a few gems for storing encrypted data, but they: Weren’t specific to MongoDB, and felt clunky Made transitioning between raw and encrypted data difficult Existing solutions There are some solutions, but we really just needed a gem that: Encrypts data at a field level Makes it easy to access the raw and encrypted value Allows developers to use their existing encryption gem Encrypted fields So we’ve built mongoid-encrypted-fields.