Post

It sounds like more of an index than a cache to me?

#1
It's not entirely clear from the descriptions, but I think what you're describing w/ the AI is an index and not a cache. If it were a cache then there would have to be a whole cache-invalidation system where every time a new market came into existence the cache (or part of it anyway) would be invalidated and the next time somebody asked "who has markets?" the whole search would be redone and the new guy would be discovered. That wouldn't be great. I have a feeling you're having the new market that comes in to being register itself w/ the system as a thing that has a market which to me makes it an index.

It's like an index in a relational database. If you index based on a particular column every time a row gets added there also is an entry added to that index keyed by the value in that column and pointing at that particular row.

In other words your AI is constantly querying a large data structure (a database of sorts), and if I understand your description correctly you've optimized it by indexing the common queries which is always a big win.

Caches are calculated on pull, but require actually running the full query every time they're requested after being invalidated, but indexes are push driven where when something in the state changes that would alter the result, the result is simply updated incrementally at that time instead of rerunning the full query next time it's needed.

Online Now

Users browsing this forum: No registered users and 9 guests

cron