Is mongodb application layer caching worth it?

I am using mongodb as a container for a collection of html help documents which are served by a REST server (cherry on top) using pymongo.

Since the database is relatively small (~ 50 documents) and rarely changes (only when someone edits my webserver interface, which runs on the same machine as the REST server), I wonder if I can speed it up with document caching ... Three options:

a) I could either cache locally (in a Python process) and then listen for, say, an invalidation trigger sent by my web server interface (for example, via a UNIX socket or signal or any other means).

b) I could cache via memcached and my webserver interface is invalid by deleting or updating said documents when something changes.

c) I couldn't do anything and relied on caching through the working set being automatically cached in memory by mongodb (is that?).

What do you think is the best strategy for such cases?

+3


source to share





All Articles