You can definitely use limited collections for this purpose. But it is important to know the basic limitations.
- Data expires depending on insertion order without expiration
- Frequently accessed data can be erased from memory Columns
_id
is not defined by default in Capped Collections, you will need to provide these indexes.- Objects cannot be resized to resize the object. For example, you can increase an existing integer, but you cannot add a field or change a string value in a record.
- Limited collections cannot be delayed .
Because of # 1 and # 4 and # 5, you are definitely losing some of the core features of Memcache.
There is a long outstanding JIRA ticket for TTL-based private collections , which is probably exactly what you want.
Of course, the big question in this whole discussion is "where is the extra RAM." Many people who use MongoDB as their main store just drop Memcache. If you have a ton of extra memory, why not just use it instead of actual data instead of copies of that data?
source share