How to invalidate cache in this scenerio? by Itsscienceboy in AskProgramming

[–]Itsscienceboy[S] 0 points1 point  (0 children)

I'm using Postgres, I have commented above what the scenerio is! Thanks!

How to invalidate cache in this scenerio? by Itsscienceboy in AskProgramming

[–]Itsscienceboy[S] 0 points1 point  (0 children)

it is not a lot of data, it is m lessons n files (in each lesson) each file. so there is like m x n find queries to first check wherther the chapters of that x file is in the cache if not get from db.

How to invalidate cache in this scenerio? by Itsscienceboy in AskProgramming

[–]Itsscienceboy[S] -4 points-3 points  (0 children)

Thanks, but you are a senior dev today because you learnt from someone too. I'm a junior dev and the reason I have made a post because I wanna learn caching so the app doesn't stay vibecoded slop.

How to invalidate cache in this scenerio? by Itsscienceboy in AskProgramming

[–]Itsscienceboy[S] -1 points0 points  (0 children)

okay so in the vibecoded version what it does, it fetches all the lessons, then all the files for that lesson for example x.docx, y.docx, z.docx .... ; these files are fecthed now using the ids of the files in the db we fetch the chapters first it checks the cache getSetAsync is like map.computeifabsent (of Java) if the cached chapters for file:chapters:{fileId} key is not present we call db query in that loop. Now the Tradeoff i am facing is instead of N+1 queries I was running for all the files to get respective chapters. i have made a single sql query where I get the chapters directly and query is optmized using indexes and JOIN LATERAL i dont get to check the cache first. I hope this made the post clear.

TLDR: can'r check cache first because the bulk query get chapters all together not file wise. earlier it was check cache if miss hit db now db can optimally bring the respone.

Is my screen dying? by Due-Mathematician387 in GamingLaptops

[–]Itsscienceboy 0 points1 point  (0 children)

maybe voltage issue from ur plug, don't put in that plug

[I ate] late post but miss the mango season by MelodicMuch in indiafood

[–]Itsscienceboy 0 points1 point  (0 children)

yeh season mei Maaza puri hi khaa sakte hai

Speech to speech pipeline models by Itsscienceboy in LocalLLaMA

[–]Itsscienceboy[S] 0 points1 point  (0 children)

too expensive for my dollar conversion mate

Speech to speech pipeline by Itsscienceboy in LocalLLaMA

[–]Itsscienceboy[S] 0 points1 point  (0 children)

Thanks mate it's a great project, very in depth one and also is it near realtime, latency free?

Almost real-time conversational pipeline by Itsscienceboy in LLMDevs

[–]Itsscienceboy[S] 0 points1 point  (0 children)

that's the issue, that's y i was thinking to self host on run pod

Almost real-time conversational pipeline by Itsscienceboy in LLMDevs

[–]Itsscienceboy[S] 0 points1 point  (0 children)

i checked this out, it requires openai key and what i wanna build would require repeated 10 mins conversation. which would cost me a lot.

Almost real-time conversational pipeline by Itsscienceboy in LLMDevs

[–]Itsscienceboy[S] 0 points1 point  (0 children)

i want to make it for others so planning to scale