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


mongodb or redis ?

i've heard should keep collections small in mongodb enable better indexing (and indexes fitting on ram), , i've heard redis "blazing fast" mongodb better if have bigger collections.

what's efficient 1 if have multiple thousand collections of few thousand of hashes ?

i'm asking because in project it's have available data benchmark , design bad benchmark scripts because don't understand theoretical concepts of 2 database engines, specially redis.

thanks answers this.

it depends on specific use case. if want able query documents on other id shouldn't choose redis. redis have implement own indexing scheme, , that's unnecessary.

there's few cases redis better option think use case (not there's wrong redis, use both redis , mongo, different things). sounds me have objects can represented hashes. both mongo , redis can store hashes, mongo can more. mongo can search document on of fields, can add index speed up, , field doesn't have string, can number, date, list, document (or list of documents), , of documents don't have fit in ram (although change when redis' diskstore feature finished). redis doesn't have of that. have implement indexes able search, can't store strings (which inconvenient sometimes), , can't store flat hashes (without resorting implement or use kind of mapping layer ohm).

you mention speed. redis blazingly fast, , mongo isn't bad either, however, use case using mongo may quicker. notice using mongo, not mongo quicker. thing is, if go redis , still want able search document using field isn't primary key, would, mentioned above, have implement yourself. search have make @ least 2 requests redis, 1 looking in index, , 1 getting document. if search results in more 1 document have make request each document individually. overhead of making these requests make using redis worse using mongo. in experience, other simplest cache, queue, or similar needs make more 1 request redis needs.

so, limited information @ disposal, recommend mongodb.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -