IEEE-NITK / corpus

A Django-based web application for managing all things IEEE NITK!
https://ieee.nitk.ac.in
2 stars 7 forks source link

Remove DB call on Landing Page #36

Open nishant-nayak opened 1 year ago

nishant-nayak commented 1 year ago

Currently, the landing page makes a call to the DB to fetch the information about all societies to render the Societies section on the page. This data is essentially static and is not likely to change frequently. 2 possible alternatives to solve this unnecessary overhead call to the DB include:

  1. Adding all the society information statically. This removes the DB call but adds additional developer effort if we were to add/remove societies from the student branch.
  2. Use a caching layer like Redis to cache DB responses. This will still incur a call to an external service, but the data fetch time should be much shorter.

(1) seems like a better fix for the current use case, but if we decide to integrate a caching layer then we could think about caching the DB response into the cache.