a month ago
Hello Railway Support,
I'm trying to understand why my application loses all runtime data after every deployment.
Here is my setup:
Node.js application
Running on Railway
Every deployment creates a new container (expected)
My application stores trading history and persistent memory
After each deploy, all previously collected data disappears
Before I continue implementing new features, I would like to verify whether this is caused by my architecture or by Railway configuration.
Could you please help me answer these questions?
Is the local filesystem inside a Railway deployment ephemeral?
If my application stores SQLite files or JSON files locally, are they expected to disappear after every deployment?
What is the recommended way to persist application data across deployments on Railway?
Does Railway provide persistent volumes, or should I always use an external database (such as PostgreSQL)?
Are there any deployment settings that could unintentionally reset application data?
Is there a recommended way to verify that my application is actually writing to persistent storage instead of ephemeral storage?
Our project depends on long-term persistence of trading history, so understanding the correct Railway architecture is critical.
Thank you very much for your guidance.
Best regards,
Jacek Iwan
3 Replies
a month ago
Yes, the local filesystem inside a Railway deployment is ephemeral, so SQLite files, JSON files, and any other data written to it are discarded on every redeploy. None of your services currently have a persistent volume attached, which is exactly why your trading history disappears. To persist data across deployments, add a volume to your service and configure your application to read/write from the volume's mount path, or use an external database like PostgreSQL.
Status changed to Awaiting User Response Railway • about 1 month ago
Railway
Yes, the local filesystem inside a Railway deployment is ephemeral, so SQLite files, JSON files, and any other data written to it are discarded on every redeploy. None of your services currently have a [persistent volume](https://docs.railway.com/volumes) attached, which is exactly why your trading history disappears. To persist data across deployments, [add a volume](https://docs.railway.com/volumes) to your service and configure your application to read/write from the volume's mount path, or use an external database like PostgreSQL.
a month ago
Hello,
Thank you for the explanation.
This is very helpful.
Before I modify my application, I would like to confirm one thing.
If I attach a Persistent Volume to my Railway service and configure my application to store its SQLite database and JSON files inside the mounted volume, should all data survive future deployments and restarts?
Is there anything else that must be configured besides:
attaching the Persistent Volume,
writing all persistent data to the mounted volume path?
I want to make sure I follow Railway's recommended architecture for long-term persistent application data.
Thank you.
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
That's correct. Once a volume is attached and your application writes to the volume's mount path, data persists across deployments and restarts. The only thing to ensure beyond those two steps is that the mount path configured in Railway matches the path your application actually writes to, as a mismatch would cause writes to land on the ephemeral filesystem instead. No other special configuration is needed.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 1 month ago