Ivan Longin
Ivan Longin

Reputation: 3353

Hold some collection in RAM in MongoDB

I have one collection that is small but I have lots of readings from it and I have wondering can you say to mongodb to keep some collection in RAM (cash them) all the time?

I could take redis and put all stuff that I want to cash in it but since it is relatively complex structure (arrays etc) it would be really easier to work with mongodb queries and I don't have to worry about putting cash to disc and other things.

Tnx :)

Upvotes: 3

Views: 944

Answers (1)

dicarsio
dicarsio

Reputation: 472

If you have a hot collection (not inactive and reading a lot from it) it will be on RAM. you only have to ensure you have enough RAM and that the table has lots of activity. You can also use touch when it doesn't.

Upvotes: 5

Related Questions