Brandon - Free Palestine
Brandon - Free Palestine

Reputation: 16656

Is MongoDB a good fit for this?

In a system I'm building, it's essentially an issue tracking system, but with various issue templates. Some issue types will have different formats that others.

I was originally planning on using MySQL with a main issues table and an issues_meta table that contains key => value pairs. However, I'm thinking NoSQL (MongoDB) might be the better option.

Can MongoDB provide me with the ability to generate "standard" reports, like # of issues by type, # of issues by type by month, # of issues assigned per person, etc? I ask this because I've read a few sources that said Mongo was bad at reporting.


I'm also planning on storing my audit logs in Mongo, since I want a single "table" for all actions (Modifications to any table). In Mongo I can store each field that was changed easily, since it is schemaless. Is this a bad idea?

Anything else I should know, and will Mongo work for what I want?

Upvotes: 1

Views: 974

Answers (2)

Nerian
Nerian

Reputation: 16177

I think MongoDB will be a perfect match for that use case.

  • MongoDB collections are heterogeneous, meaning you can store documents with different fields in the same bag. So different reporting templates won't be a show stopper. You will be able to model a full issue with a single document.

  • MongoDB would be a good fit for logging too. You may be interested in capped collections.

  • Should you need to have relational association between documents, you can do have it too.

  • If you are using Ruby, I can recommend you Mongoid. It will make it easier. Also, it has support for versioning of documents.

Upvotes: 1

om-nom-nom
om-nom-nom

Reputation: 62835

MongoDB will definitely work (and you can use capped collections to automatically drop old records, if you want), but you should ask yourself, does it fit to this task well? For use case you've described it is better option to use Redis (simple and fast enough) or Riak (if you care a lot about your log data).

Upvotes: 1

Related Questions