Data sync between environments
I have an app which is made up of an Elysia API and a postgres DB. I have a prod and staging env setup. I faced a bit of a weird issue where I was using my app in the prod environment which included changes in the prod environment. However, the weird thing is these changes reflected in the staging environment. I am using internal DB urls and there are as follows:
Prod env -
postgresql://PROD_USER_HERE:[email protected]:5432/railway
Staging env - postgresql://STAGING_USER_HERE:[email protected]:5432/railway
I am wondering if this is the right approach or if i should be using external URLs for each environment? Any advice is appreciated8 Replies
Project ID:
b6238b67-1449-4085-9111-5da192d6ede2
b6238b67-1449-4085-9111-5da192d6ede2
the weird thing is these changes reflected in the staging environmentwhat changes?
new rows added to the DB
interesting, there is a private network for each environment within a project, aka the private network is isolated from one environment to another.
i have seen an issue very similar to this, their issue was that they where hardcoding the public url somewhere so that no matter the environment the app would always request the same url
Thats what I figured. My URLs are definitely not hardcoded anywhere but its possible i was on staging when i thought i was on prod. If i notice anything again I will open a new thread.
sounds good, and yes you should be using the private urls whenever possible, its both faster and you are not charged for any egrees over the private network
perfect