title: Should a connection to Redis cluster be made on each Flask request?
body: <p>I have a Flask API, it connects to a Redis cluster for caching purposes. Should I be creating and tearing down a Redis connection on each flask api call? Or, should I try and maintain a connection across requests?</p>
  
  <p>My argument against the second option is that I should really try and keep the api as stateless as possible, and I also don't know if keeping some persistent across request might causes threads race conditions or other side effects.</p>
  
  <p>However, if I want to persist a connection, should it be saved on the session or on the application context?</p>