-
Hi, The documentation at https://github.com/gajus/slonik#create-connection mentions:
What does "backend" mean in this context? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My understanding is that a persistent connection to the same backend is when a server creates and reuses a connection to Postgres. It's desirable if you're running a server on EC2, Heroku, etc. You can avoid the overhead of making a new connection, and can avoid having too many connections to a database. If you're running serverless functions which are discarded shortly after they run (for example, on AWS lambda) then you can just use the pool directly. |
Beta Was this translation helpful? Give feedback.
My understanding is that a persistent connection to the same backend is when a server creates and reuses a connection to Postgres. It's desirable if you're running a server on EC2, Heroku, etc. You can avoid the overhead of making a new connection, and can avoid having too many connections to a database.
If you're running serverless functions which are discarded shortly after they run (for example, on AWS lambda) then you can just use the pool directly.