"There are only two hard things in Computer Science: cache invalidation and naming things." [1]

This topic combines the two ;)
As for alternative names I offer: the exotic: entrepot, the industrial: kvstore, the bohemian: stash. Personally I think cache is fine.

I have sometimes thought of using BaseX and Redis together managed by docker-compose.
I like the data structures [3] and the concept of 'variables' that self destruct after some time [4]

/Andy

[1] https://www.martinfowler.com/bliki/TwoHardThings.html
[2] https://en.wikipedia.org/wiki/Entrep%C3%B4t
[3] https://redis.io/docs/about/
[4] https://redis.io/commands/expire/

On Fri, 6 May 2022 at 15:26, Christian Grün <christian.gruen@gmail.com> wrote:
Hi Liam,

> What happens on a crash (e.g. power failure)?

If BaseX is shut down gracefully, the data will be stored; otherwise,
it might get lost indeed. If the cached data is important, it’s
advisable to call cache:write after each update.

In the documentation, I mentioned that the cache will automatically be
written to disk at shutdown time. Based on some more feedback I got, I
imagine there can be cases in which you simply want to create a
temporary cache without making it persistent. I think I’ll change
this, and I will only serialize the cache if a cache file already
exists on disk (as a result of a previous explicit cache:write call).

> E/g/ for the listtle teszt/experiment site i have at
> www.fromoldbooks.org (and www.fromoldbooks.org/Search/) there's a
> framework i wrote that calls out to BaseX and keeps a cached result in
> a separate file, one per query. […]

By reading your reply and the one from Omar, I wonder if the »Cache«
is really the best term to describe what the module offers. It’s
basically a Main-Memory Key-Value Store that can be made persistent,
similar to e.g. Redis. Suggestions for a better name are welcome.

All the best,
Christian