ha-store
ha-store copied to clipboard
Implement cache tiers
Is your feature request related to a problem? Please describe. Sometimes it would be great to have fast, in-memory lookups, then fallback to remote (redis, for example) lookups.
Describe the solution you'd like Having the stores as a list would enable tiered lookups, for example:
const {store, Storage} = require('ha-store');
const redis = require('ha-store-redis');
const itemStore = store({
resolver: getItems,
delimiter: ['language'],
stores: [
Storage.InMemory,
redis,
],
});
Describe alternatives you've considered None considered right now
Additional context This was requested by a user that currently uses redis storage but would also see benefits from using in-memory first.