Friday 21 December 2018

DB modules in routes or separate?

So maybe this is a silly question but hey, it is what it is. When using something like redis, is it best to create and connect in each route of your REST api or have a separate file that creates a single client, connects once, and import that into your route to use instead? Are there pros/cons to either one as far as performance, connection limits, etc?

Submitted December 22, 2018 at 07:00AM by sesharc

No comments:

Post a Comment