What's the most efficient document-oriented database engine to store thousands of medium sized documents?

Question!

MongoDB or Redis ?

I've heard that I should keep collections small in MongoDB to enable better indexing (and indexes fitting on RAM), and I've heard that redis is "blazing fast" but MongoDB is better if you have bigger collections.

What's the most efficient one if I have multiple thousand collections of say a few thousand of hashes ?

I'm asking this because in my project it's too early to have available data to benchmark and I would probably design bad benchmark scripts because I don't understand very well the theoretical concepts of those two database engines, specially Redis.

Thanks for everyone who answers this.



Answers


The document size, while important, should not be the most important factor for you in selecting Mongo or Redis. It's rare you'll hit the 4MB limit in Mongo, and if you do, it might be an indicator your document is not broken down enough. Redis is a bit more all purpose so if you intend on using your data store for niche areas in your application state (suggestions boxes, cache, etc.), Redis may be a better fit. If persisting richer items, ones that extend beyond Redis' native data types and structures, Mongo is probably a better fit.

Truthfully, both Redis and Mongo are superb and dead simple to get up and running. Considering it's early in your lifecycle, try both on for size and see what feels better.



I'll toss one more option into the ring: Berkeley DB XML. It's a small footprint C library with C and Java APIs that provide XML data management, XQuery and XPath queries. It's designed to be very fast, scalable and reliable. It supports transactions, recovery and replication. You can use it to store XML documents as well as non-SQL key-value pairs.

Disclaimer: I'm the product manager for Berkeley DB, so I'm a bit biased. However, we have lots of customers that use BDB XML for medium to very large document repositories.

By : dsegleau


This video can help you solving your question :)
By: admin