databasesocketspostgresqldatabase-connectionscalability

Questions about preferred way to connect to a Postgres database


For starters, I'm using Postgres.

Is socket connection a/the preferred way to connect (I will have my database in a separate VM on the same physical machine as my application)? Is socket connection faster? Also, will this setup lead to issues when I need to scale my DB to a separate machine?


Solution

  • Working across machines, even if one of them is a VM, requires socket connections.

    It will lead to fewer issues when you need to scale up; you will continue using the same connectivity method, but might simply target a new machine/database.