R
Railwayβ€’15mo ago
cybershizo

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:
the files will persist for the lifespan of the deployment that created them
Jump to solution
30 Replies
Percy
Percyβ€’15mo ago
Project ID: N/A
cybershizo
cybershizoβ€’15mo ago
N/A
Solution
Brody
Brodyβ€’15mo ago
the files will persist for the lifespan of the deployment that created them
cybershizo
cybershizoβ€’15mo ago
Thanks! I figured as much but wnated to ask before I messed around and found out
Brody
Brodyβ€’15mo ago
haha no problem and thers always storage volumes if you need your files to persist across deployments
cybershizo
cybershizoβ€’15mo ago
I did see that! Definitely makes me feel like it's not really a big deal if I needed something more Thanks!
Fille
Filleβ€’14mo ago
How much storage is available for each service?
Brody
Brodyβ€’14mo ago
container storage aka empherial storage: it's a soft limit of 100gb volume storage: 5gb on hobby, 50gb on pro
Fille
Filleβ€’14mo ago
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?
Brody
Brodyβ€’14mo ago
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
Fille
Filleβ€’14mo ago
Ahh ok. Thanks πŸ™πŸ»
Brody
Brodyβ€’14mo ago
that clear up the confusion?
Fille
Filleβ€’14mo ago
Yes I think I got it now
Brody
Brodyβ€’14mo ago
awesome!
Fille
Filleβ€’14mo ago
Data stored in the volyme is counted towards the storage cost right? Or is there 5gb included in the base cost?
Brody
Brodyβ€’14mo ago
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
Fille
Filleβ€’14mo ago
Yeah, sorry. I meant the volume storage. Is there any free storage that is persistant? Or do rhe pricing start at 0kb ?
Brody
Brodyβ€’14mo ago
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
Fille
Filleβ€’14mo ago
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.
Brody
Brodyβ€’14mo ago
good question
Fille
Filleβ€’14mo ago
Or maybe storage isnt accessible by multiple services?
Brody
Brodyβ€’14mo ago
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
Fille
Filleβ€’14mo ago
Looks like its per minute there
No description
Brody
Brodyβ€’14mo ago
seems like it
Fille
Filleβ€’14mo ago
Enough talking, I need to try this out!
Brody
Brodyβ€’14mo ago
but like I said, you can't attach a volume to multiple services
Fille
Filleβ€’14mo ago
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
Brody
Brodyβ€’14mo ago
yeah like minio
Fille
Filleβ€’14mo ago
Ah, interesting. Never heard of that one before.
Brody
Brodyβ€’14mo ago
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
Want results from more Discord servers?
Add your server