In this video I demostrate how to use the github.com/mco... module to increase the req/s of Platformatic DB by 5x, while reducing the latency to 1/3. Amazing? You can implement it too!
But you don't have just one api in your web app, if there are 100 apis how many will overlap, moreover the input to the query also need to be same for this to work right, this can decrease the performance as well. Isn't it?
Hey Matteo Collina I have one question which package should we use for caching API. should we need to use async-cache-dedupe or fastify-caching ? because both packages ends up with cahcing data into redis or any in-mem cache
Good video! Also, can you point or say where you're looking at when you're using "htop" or other fancy tools, because It's hard to follow when you see a tool for the first time.
Thanks for share this is nice video, still watching videos regarding evolving of Platformtic DB, can't wait to find a project allowing me to my hands on it :) Have you also thought of cache invalidation? Something like creating "relationships" between queries and mutations saying "Hey, if this mutation is running with this movie ID, clear query related object from cache"
Thank you, Matteo. Will try to implement this in my programmer network Fastify API.
Cheers man
Always happy to see these videos!
More to come!
But you don't have just one api in your web app, if there are 100 apis how many will overlap, moreover the input to the query also need to be same for this to work right, this can decrease the performance as well. Isn't it?
Hey Matteo Collina I have one question which package should we use for caching API. should we need to use async-cache-dedupe or fastify-caching ? because both packages ends up with cahcing data into redis or any in-mem cache
the latter is lower level and will deduplicate requests.
@@adventuresinnodeland I am not getting can you please describe I am bit confused and by the way you guys are doing great work
@@VasuRangpariya use async-cache-dedupe
Good video! Also, can you point or say where you're looking at when you're using "htop" or other fancy tools, because It's hard to follow when you see a tool for the first time.
Good tip!
Great new module!
Thanks for share this is nice video, still watching videos regarding evolving of Platformtic DB, can't wait to find a project allowing me to my hands on it :) Have you also thought of cache invalidation? Something like creating "relationships" between queries and mutations saying "Hey, if this mutation is running with this movie ID, clear query related object from cache"
It’s in the roadmap and supported by async-cache-dedupe, we just need to wire it with Platformatic DB.
thanks mattteo for this
Nice video, Thank you so much
Thank you too
Thank you so much, One question, So we should use cache in every query to database, right ?
Yes, at least for the one that fetched data.
definitely not, choose wisely based on profiling and db stats ideally during stage testing
Can we have the link to the repo of that platformic db's github repo or access to the code !
Here is the file I’m showing in the video github.com/platformatic/platformatic/blob/main/packages/sql-mapper/lib/cache.js
Hit the Like in advance, thank you Matteo!
Thanks
Does this only work with promise.all? How about if I send same request out of promise.all? will that also return from cache ?
wow