Closed MarZab closed 6 days ago
Hi @MarZab - currently we do not plan to offer a feature around search / scan. One thing to note is that if you are using an in-memory store it will be very high performant. One thing to think about is using Cacheable so that you can do in-memory and also layer 2 / secondary would be your persistent store to keep performance.
Still confused as to why you need an entire store namespace per user session as usually you would want to just make the key be the {userId}
.
I am trying to implement a prefix scan and delete. While a generalised search was ruled out years ago, I would argue the iterator returning all values is not viable for large caches.
My proposal is to add a prefix filter option to
iterator
(any maybeclear
) - that would be implemented as a per-invocation extension of the namespace.Here is my use-case (albeit using a non backward-compatible signature, for ilustrative purposes):
I would be happy to contribute to this cause.
Note: I explored using a
new Keyv({ store: this.store, namespace: 'session:${userId}' });
per invocation but creating/destroying has overhead/side effects that make this pattern unviable in my mind.