Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - API to trigger upquery and Delete #171

Open
unibum opened this issue Dec 27, 2020 · 1 comment
Open

Feature Request - API to trigger upquery and Delete #171

unibum opened this issue Dec 27, 2020 · 1 comment

Comments

@unibum
Copy link

unibum commented Dec 27, 2020

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.

@jonhoo
Copy link
Contributor

jonhoo commented Dec 27, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants