MongoDB for Custom Data Fields

Rick HerrmannWe have an application that contains a mix of relational data and dynamically structured data. All of the data is currently stored in SQL Server, with the dynamic portion of the data models being stored in string columns as json data. If all we needed to do with the non-relational data was to display it on various screens, SQL Server would work great.

The trouble however, is that we need to search and filter on the json data.  This is something SQL Server cannot help with, because it treats the json data as one big string and has no knowledge of the underlying structure of the json data.

The json data has structure, but the structure can vary for each data element. There is a class of databases commonly referred to as “No-SQL” which are built to handle exactly this kind of fluid data structure.

We decided to use MongoDb because:

  1. It can solve our problem
  2. We have used MongoDb before
  3. It is free
  4. MongoDb is one of the most heavily used databases right now, which means it is very easy to find answers to questions (Stackoverflow, the MongoDb site, Twitter etc.) should the need arise.

Specifically, our solution will be to move just the data entities that have the dynamic structure into MongoDb, but leave the other static data in SQL Server.  This will allow us to maximize the benefit of using MongoDb without forcing the entire database into MongoDb.

Learn more about the apps we build.

Leave a Reply


You are commenting using your account. Log Out /  Change )

Google photo


Twitter picture


Facebook photo


Connecting to %s