0

I am currently using MongoDB to store lots of real-time signals of some sensors. The stored information includes a timestamp, a numeric value and a flag that indicates the quality of the signal.

Queries are very fast but the amount of disk used is exorbitant and would like to try other non-relational database most suitable to my purposes.

I've been looking at http://nosql-database.org/ but I don't know which database is the best for my needs.

Thank you very much :)

Community
  • 1
  • 1
Sergio
  • 1
  • 1

3 Answers3

2

http://www.mongodb.org/display/DOCS/Excessive+Disk+Space

Rob Cowie
  • 22,259
  • 6
  • 62
  • 56
2

MongoDB stores field names inside every document, which is great because it allows all documents to have different fields, but creates a storage overhead when fields are always the same.

To reduce the disk consumption, try shortening the field names, so instead of:

{
    _id: "47cc67093475061e3d95369d",
    timestamp: "2011-06-09T17:46:21",
    value: 314159,
    quality: 3
}

Try this:

{
    _id: "47cc67093475061e3d95369d",
    t: "2011-06-09T17:46:21",
    v: 314159,
    q: 3
}

Then you can map these field names to something more meaningful inside your application.

Also, if you're storing separate _id and timestamp fields then you might be doubling up. The ObjectId type has a timestamp embedded in it, so depending on how you query and use your data, it might mean you can do without a separate timestamp field all together.

Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110
1

Disk space is cheap, don't care about this, development with new database will cost much more... If you on windows you can try RavenDB.

Also mb take a look into this answer about reducing mongo database size:

You can do this "compression" by running mongod --repair or by connecting directly and running db.repairDatabase().

Community
  • 1
  • 1
Andrew Orsich
  • 52,935
  • 16
  • 139
  • 134