Closed marwage closed 7 years ago
Hello @marwage,
as far as I know we are not planning to cache those predictions. It would make sense if your team @PokemonGoers/predictpokemon-2 could do that, e.g. by saving them in the mongoDb of team @PokemonGoers/pokedata or some other database.
Our team does not have any persistence layer yet and just uses the APIs from all other teams to gather data, so imho it would make sense if your API would cache those results.
What do you guys think? @PokemonGoers/catch-em-all
I agree with @AlexanderLill. As we don't have a database (or some other kind of storage) installed alongside our server the only way we could achieve caching would be locally on the client. This means that multiple subsequent requests by the same client can be answered by the cache but if different clients request predictions for the same location this would still result in multiple requests to your prediction API.
Thanks for the heads up! If we cache them in the DB of @PokemonGoers/pokedata we would only store them for a short time, as we predict only for the current time. Is this correct @goldbergtatyana or do we provide predictions for which the user can specify the time?
Hey. I think that storing them in a db such as mongo would add a tremendous overhead. You can set TTLs on documents in mongo but it's tricky and I'd rather avoid that.
There are some out-of-the-box solutions for caching on the server side (usually storing a cache on disk), so if the predictions are serviced by the api guys (which, given the circumstances, seems to be the most reasonable solution), they can just import a package and cache requests that look similar for a given amount of time (which if I'm not mistaken, they are already doing, correct @PokemonGoers/pokedata ?) So: problem solved?
If you really wanna go fancy, you can even go redis but that's like mega overhead
yep, I agree with @sacdallago, lets keep it all clear and simple :) No time specifications for a user and no storings of predictions in mongodb.
Created an issue in the @PokemonGoers/pokedata project: https://github.com/PokemonGoers/PokeData/issues/180
( @marwage @johartl @bensLine @sacdallago )
Hi ;) I'm from the predictions team and we would like to know if you cache our predictions when there is an equal request (location and time)? We are asking for that because predictions need processing power and therefore time. Have you already implemented something or are you planning to?