Problem with files in autoscale deploy

Good morning, I have a problem saving files in my deploy of type ‘autoscale’. When I save a file, be it an mp4 or mp3 or whatever, after a few minutes, my file is deleted! I understand that even deployments don’t keep files when doing ‘redeploy’ but I don’t do that, I just have my sv flask which stores files AT RUN TIME, but after a few minutes, my files that I saved at run time cease to exist for some reason!

It’s not my code or anything like that because I don’t have anything that causes this behavior, on localhost everything works just fine!

:wave: Welcome back @Botato300!

Deployments don’t have persistent filesystems, which means any new files are lost every time the deployment shuts down (which will happen when redeployed).

You probably already know that, but the issue here is that Autoscale deployments shut off after some amount of it not being used.
This makes the deployment far cheaper.

So now, you have a few options.

  1. Switch to using a Reserved VM deployment:
    This will likely be WAY more expensive than the Autoscale. You’ll still lose the file system on redeploy, however the deployment won’t go down on its own (or at least, shouldn’t).
  2. Wait for object storage:
    Replit is currently working on something known as “Object storage”. It is currently in beta (they sent out a form in an email a few weeks ago [not to that many people]), and it makes storing files very easy.
  3. Upload files to some sort of CDN:
    The most similar thing to this I’ve done is code a way to add files to GitHub, but I don’t know if it (GitHub) would be the best solution for your case.
2 Likes

Thank you very much for answering, I think I will wait for the object storage, because using the VM instance is too expensive for my case!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.