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

Caching strategy for breed search #23

Merged
merged 3 commits into from
Nov 29, 2020
Merged

Caching strategy for breed search #23

merged 3 commits into from
Nov 29, 2020

Conversation

mapra99
Copy link
Owner

@mapra99 mapra99 commented Nov 29, 2020

Caching breed search service. Only caching searches that matches one of the following:

  • Searches are made by name (these are the ones that consume more runtime)
  • Searches include more than 20 images

This may fixes #11

Some drawback to doing this:

  1. Caching the results of name searches can consume memory very quickly. I'm curious to see how much this can affect our redis memory capacity. This could probably lead to future issues

@mapra99 mapra99 added this to the Production release!!! milestone Nov 29, 2020
@mapra99 mapra99 temporarily deployed to cats-wiki-search-cachin-yfu4sn November 29, 2020 04:08 Inactive
@mapra99 mapra99 temporarily deployed to stg-cats-wiki November 29, 2020 04:11 Inactive
@mapra99
Copy link
Owner Author

mapra99 commented Nov 29, 2020

Benchmarking notes for posterity:
Running this endpoint on staging:
https://stg-cats-wiki.herokuapp.com/breeds/search?term=be&by=breed_name&include_images=10

Took 1.73s
With this change it took 120ms

@mapra99 mapra99 temporarily deployed to cats-wiki-search-cachin-yfu4sn November 29, 2020 04:22 Inactive
@mapra99 mapra99 merged commit 5fa24a9 into development Nov 29, 2020
@mapra99 mapra99 deleted the search-caching branch December 27, 2020 18:28
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

Successfully merging this pull request may close these issues.

Strategize speed improvement for breed search service
1 participant