noria icon indicating copy to clipboard operation
noria copied to clipboard

Feature Request - API to trigger upquery and Delete

Open unibum opened this issue 3 years ago • 1 comments

Hi,

Apologies in advance if I don't fully understand Noria (hence question not relevant) or I use the wrong terminology.

Scenario 1: User lists a new item/product to sell. We want system (ideally Postgresql Db) to call API to have Noria Upquery / pre-load the data in advance so any user querying / searching see's new product. Searcher gets immediate product information and no latency/wait while Noria does and upquery to return relevant data.

So we still pay the penalty of a single Upquery, except we trigger it immediately when new item listed, not when the first person clicks on the product. that way, with limited Noria resources we could purposely pre-load certain 'popular' categories and not others.

Unclear if this api need is eliminated if/when Noria can sync DB backends (PG to RocksDB) [or use a write orientated DB as primary Noria DB / source] and this Noria reads from the Noria local/RocksDB and naturally pulls/loads from that into CPU memory etc.

Scenario 2: Product is sold, since TTL not in place, we might want to have data sit in Noria for 30 days while sale completes. Then DB calls API to then delete from Noria. E.g. user hasn't re-listed more of same item for sale, we know information no longer needed to be stored in Noria. Perhaps API for DB to invoke when it wants to delete data from Noria to free up space.

Thanks in advance for your considerations.

unibum avatar Dec 27 '20 20:12 unibum

The way to pre-populate the cache is simply to issue the relevant query. That's all you need to do, and then Noria will cache it :)

As for explicitly eviction a cache entry, there's not currently any API for doing so, but that does seem like a reasonable thing to add. Where the complexity arises is in where in the dataflow you start the eviction. You could just evict from the leaf views, but then you'd still leave a bunch of internal state around that should probably also be pruned.

jonhoo avatar Dec 27 '20 21:12 jonhoo