Just finished a system design session on Caching & Distributed Systems ๐ฅ โ here's the full breakdown in a thread ๐งต
1/ Why cache at all?
If a computation takes 30-40s, you cache the result. Next time someone asks โ it's instant. That's the entire idea.
2/ Redis vs Postgres
Redis = RAM โ blazing fast, limited size
Postgres = Disk โ slower, persistent, large
Pick based on your use case โ not hype.
3/ Cache HIT vs MISS
HIT โ serve from Redis โ
MISS โ fetch from DB โ update Redis โ serve
This pattern = Read-Through Cache
4/ TTL is your best friend
Set expiry on every cache key.
24hrs for slow-changing data.
5min for real-time data.
No TTL = stale data forever ๐
5/ Eviction Policy: LRU
When storage is full, kick out the Least Recently Used item.
This is how Redis stays lean under pressure.
6/ Consistent Hashing ๐
Distributed cache across 3+ nodes?
Use a hash ring.
hash(key) % n โ determines the partition
Add/remove a node? Only a fraction of keys move. Not all.
7/ Infrastructure ladder:
Data Center โ Hypervisor (Proxmox)
โ VMs โ VPS โ Cloud (AWS/Azure/GCP)
More abstraction = less control but less headache.
Thank you @piyushgarg_dev sir for the awesome session and we missed you today @Hiteshdotcom sir and thank you all the TA's @nirudhuuu@ChaiCodeHQ
#SystemDesign #Redis #Caching #DistributedSystems #ChaiCode #BackendEngineering
Just wrapped up another GenAI class by @piyushgarg_dev
Today we went beyond basic RAG and explored how production-ready AI systems actually retrieve and reason over information.
Learning from today's class:
โ Query Translation
โ Step-Back Prompting
โ Query Routing
โ HyDE (Hypothetical Document Embeddings)
โ Reciprocal Rank Fusion (RRF)
โ Input & Output Guardrails
โ PII Detection
โ Advanced RAG Pipelines
@ChaiCodeHQ@Hiteshdotcom@nirudhuuu@BlazeisCoding@yntpdotme@devwithjay@surajtwt_
#chaicode #RAG #AdvancedRAG
RAG doesn't kill hallucinations โ it just moves where they happen.
Poor retrieval, bad chunking, context limits, stale knowledge bases can all quietly break a RAG pipeline.
Wrote up where RAG actually fails (and when to skip it):
https://t.co/Om2K9FmAKG
@ChaiCodeHQ#GenAI#RAG #LLM
Building logic for DSA is Problem solving and not able to write that logic in code is programming problem. Both are separate issues.
The moment you realise this, DSA becomes easy.
@Hiteshdotcom@PriyaBhatiaDS The best course of internet, everyone just jumps into the code. She taught the maths behind it.
Ever tried listing every skill installed across your Claude Code / Cursor / Copilot setup? Yeah, neither could I.
Skill-discovery, built by Surenode โ one command, runs locally, zero config. Scans your agents' skill folders + instruction files, fingerprints them, flags suspicious patterns (env dumps, hidden payloads, prompt injection), redacts secrets before anything leaves your machine.
git clone https://t.co/YKKe15m4q8
cd skill-discovery && pip install .
skill-discovery --dry-run
Nothing leaves your machine unless you point it at a server. Open source, and it's the inventory layer behind Surenode's KLIN governance platform for teams.
๐ https://t.co/YKKe15m4q8
Milte hain phir aaj class mein. Civil uniform mein aana, aur snacks khud lekar aana โค๏ธ
Thodi baatein, thodi yaadein... saath lekar aakhri manzil tak pahunchenge
This is not a full stop... it's just a comma
Class-01 of GenAi Done
Spent time breaking down how LLMs actually work, from scratch ๐ง
1๏ธโฃ Tokenisation โ text becomes numbers
2๏ธโฃ Embeddings โ numbers become meaning (vectors that capture relationships, e.g. Eiffel Tower โ Paris)
3๏ธโฃ Positional Encoding โ order matters
4๏ธโฃ Self-Attention โ tokens "talk" to each other (ICICI Bank vs River Bank โ context decides meaning)
5๏ธโฃ Transformer (encoder-decoder) โ training (backprop) vs inference
#GenAI #LLM #AIEngineering
@ChaiCodeHQ@Hiteshdotcom and @piyushgarg_dev sir for an awesome session.
If you're excited about building AI applications and agents, you'll love our upcoming GenAI JS Cohort starting on June 29th
We'll go deep into LLMs, RAG, AI Agents, MCP, embeddings, vector databases, and production-grade AI systems.
Join us: https://t.co/MOOr64M7bg
See you in the class ๐งก