Hi There,
As far as I understand from the code, Nakama appears to use sql.Open to establish the database connection:
{db, err := sql.Open(“pgx”, parsedURL.String())}
This utilizes Go’s database/sql abstraction with the pgx driver, which is great for basic connection pooling.
I have a few questions regarding this implementation:
- Does Heroic Cloud (enterprise version) use
pgxpoolinstead ofsql.Open? - Is there any open-source or community-built utility for Nakama that leverages
pgxpoolfor database connections? - In this article - an Aurora database cluster was used.
- Was the same
db_Connectmethod (as in the open-source Nakama) used in that setup?
- Are there any benchmark or standard values for
max_open_connections,idle_connections, andmax_lifetime?
- For example, if Nakama is running on a 1 CPU or 2 CPU machine, and the database is on a CockroachDB standard cluster (2 CPUs), what would be the ideal values?
- If a query execution fails due to contention or timeout on the database:
- Does the current implementation perform any retries?
- Is it possible for Nakama to fail to log such cases?
Thanks in advance for the clarification!