Home > other >  Persistant Data in Heroku Postgres - Ephemeral Filesystem
Persistant Data in Heroku Postgres - Ephemeral Filesystem

Time:03-27

This might be a simple question, but I would like some clarification.

Based off the docs, Heroku has an ephemeral file system. How I interpret it is that anytime you upload a file to Heroku and there is a change in the configuration or the app is restarted, the files are gone.

However, I was wondering if this is the case if you upload data to Heroku Postgres through a dumps file.

For development, I am using a local Postgres server. From there, I would create a dumps file and then upload that file using commands found here:

https://stackoverflow.com/a/71206831/3100570

Now suppose my application makes a POST request to Heroku Postgres, would that data be persisted along with the initial data from the dumps file in the event that the application is restarted or crashed?

CodePudding user response:

Ingesting data into your PostgreSQL database this way doesn't touch your dyno's filesystem. You are simply connecting to PostgreSQL and running the SQL commands contained in that file:

-f, --file=file
    SQL file to run

The data will be stored in PostgreSQL in exactly the same way it would if you did a bunch of INSERTs yourself. You should have no problem ingesting data this way and then continuing to interact with your application as normal.

  • Related