-
1
Use of Redis Code changes:Times asked 1Official solution
SimpleRedis fridge pe sticky note hai — poori kitchen (database) kholne ki zarurat nahi.
Redis in-memory key-value store hai. Data RAM mein rehta hai, isliye disk wale SQLite/Postgres se kai guna tez.
MAD2 mein Redis do kaam karta hai:
1) Cache — same venue/show/dashboard JSON baar-baar DB se mat nikaalo.
2) Celery message broker — Flask task queue mein daalta hai, worker uthata hai.Source of truth database hi hai. Redis band ho to cache miss ho jaata hai aur Celery queue ruk sakti hai. Crash pe cache gayab ho sakta hai — isliye important data sirf Redis mein mat rakho.
Example
import redis r = redis.Redis(host='localhost', port=6379, db=0) r.set('venues', json.dumps(data), ex=30) print(r.get('venues'))Project example: GET /api/venues pehle Redis dekho. Miss pe SQLAlchemy query, phir SET with timeout. Celery worker Redis list se daily reminder uthata hai.
Viva tipCache ke liye db=1, broker ke liye db=0 rakhna smart hai taaki keys mix na hon. Viva mein
redis-cli ping→ PONG dikhana strong hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
2
Change the color of the button(frontend)Times asked 1Official solution
SimpleLive UI change: relevant CSS/HTML template kholo — color, margin, flex, bootstrap class. Save + hard refresh.
Example
/* button red */ .btn-primary { background: red; } /* center navbar item */ .navbar { justify-content: center; }Viva tipDevTools se pehle try, phir file mein permanent change.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet