Does setting DATABASE_URL instead of DATABASE_PRIVATE_URL affect egress usage?

As the title says, I have a service that uses sqlx and I had to set DATABASE_URL instead of DATABASE_PRIVATE_URL, because otherwise it wouldn't work. Currently I'm seeing slight usage on the database egress, even if I'm not connecting directly to the db frequently. I was curious whether I would get different egress readings depending on which type of database url I was using.
7 Replies
Percy
Percy3mo ago
Project ID: N/A
PolpOnline
PolpOnlineOP3mo ago
N/A
MantisInABox
MantisInABox3mo ago
Your app should use the private URL, as it will not incur egress charges. If you are using the "public" URL, it will indeed cause egress charges If you are using an older deploy of the database, you have those variables you listed. If you create a new database, you will have DATABASE_URL and DATABASE_PUBLIC_URL which is a better solution for identification on which is which
PolpOnline
PolpOnlineOP3mo ago
Railway Help Station
[Rust] [Sqlx] [Networking] Using DATABASE_URL=${DATABASE_PRIVATE_UR...
Changing to DATABASE_URL=${DATABASE_URL} fixes it. I believe it has something to do with resolving names inside the build container.
PolpOnline
PolpOnlineOP3mo ago
I tried enabling the new builder environment and the log says that "Config file src/backend/nixpacks.toml does not exist" root directory is set to src/backend/ Forgot to publish my project id, it is 062ea51f-a209-44fa-84fa-639d60a22f66 @Vin can you check it and see if you can discover why I can't enable the new builder environment?
MantisInABox
MantisInABox3mo ago
Unfortunately, I'm not a team member, so I cannot see your projects, but you are sure that you have a nixpacks.toml file in that root directory?
PolpOnline
PolpOnlineOP3mo ago
Yeah, the project is open source too, https://github.com/PolpOnline/monitor
GitHub
GitHub - PolpOnline/monitor
Contribute to PolpOnline/monitor development by creating an account on GitHub.
Want results from more Discord servers?
Add your server