Ephemeral storage concern
Hi I want to do programmatic NPM publishes using a Railway service I will need to basically use shell commands to write files to disk, possibly pack them, and then programmatically publish using child processes I guess
My question is in the context of a Railway service, during the lifecycle of the service, can I rely on writing to disk? I understand storage is generally ephemeral so it's all scoped to the deploy of a service, so my question specifically is -- during the lifecycle of a deploy can I rely on writing and reading from disk just like a VM? Any caveats or concerns or specific blog posts I should read?
Thank you
Solution:Jump to solution
the files will persist for the lifespan of the deployment that created them
30 Replies
Project ID:
N/A
N/A
Solution
the files will persist for the lifespan of the deployment that created them
Thanks! I figured as much but wnated to ask before I messed around and found out
haha no problem
and thers always storage volumes if you need your files to persist across deployments
I did see that! Definitely makes me feel like it's not really a big deal if I needed something more
Thanks!
How much storage is available for each service?
container storage aka empherial storage: it's a soft limit of 100gb
volume storage: 5gb on hobby, 50gb on pro
Ok. So i can temporarly put 100gb on disk but only 5gb should be kept around?
What happens if i leave to much on disk? Will the service be restarted and the data wiped?
no that's not what I meant, those are separate storage mediums, anything you store in the containers storage will be erased upon the next deployment
anything you store in the volumes will persist
Ahh ok. Thanks ππ»
that clear up the confusion?
Yes I think I got it now
awesome!
Data stored in the volyme is counted towards the storage cost right?
Or is there 5gb included in the base cost?
nope, you are only charged for volume storage, your account comes with 100gb on shared container storage
container storage is the storage of where your app code is located, it is empherial.
volume storage you can think of like mounting an SSD to your deployment, it's storage is persistent and you are only charged for what you store in it
Yeah, sorry. I meant the volume storage. Is there any free storage that is persistant? Or do rhe pricing start at 0kb ?
no free volume storage, but if you don't use any volume storage then you won't be charged for any volume storage
you only pay for the storage used
not for the volume size
Is storage also counted each minute?
So i store 5Gb just for 1 minute, i will only pay for that minute ? Or do i have to pay for the full 5GB for that month? I was wondering if I could use it as a temporary storage to be used by multiple services.
good question
Or maybe storage isnt accessible by multiple services?
maybe the usage pricing will be able to shed some light on your question, but even after looking at it I'm not sure about the answer
https://docs.railway.app/reference/pricing
and yes, only one volume per one service
eventually railway will allow you to attach multiple volumes to a service or multiple services, but they currently don't support that
Looks like its per minute there
seems like it
Enough talking, I need to try this out!
but like I said, you can't attach a volume to multiple services
I guess i could have a separate service with a volume attached and use that service to access the data
If i needed that type of behaviour
yeah like minio
Ah, interesting. Never heard of that one before.
it's just a self deployable S3 compatible service
super cool
and you can access it over the private network, so latency and access time should be low