Is there a way to force memcached to not evict a key and value?
Not that I know of. You could try a Couchbase bucket, which is backed by disk. Or you could try the newer Ephemeral bucket (which you can configure to turn off ejection, but not at an individual document level as far as I know). There are lots of other benefits to using these instead of memcached buckets (which in Couchbase, are basically legacy). For more information, check out: https://docs.couchbase.com/server/current/learn/buckets-memory-and-storage/buckets.html