Difference between 'Reset' and 'Destroy' Database on Heroku with Postgres?

1.1k views Asked by At

I've noticed that there are two options for Heroku for a Postgres Database in the Admin and Dashboard Area when visiting a database instance.

1: Reset Database:

Heroku Dashboard describes this action as:

Reset the database to its originally-provisioned state, deleting all data inside it.

2: Destroy Database:

Heroku Dashboard describes this action as:

Destroys the database and all of the data inside it.

That said, it's still left a little open to interpretation as to the differences behind the scenes of these two actions.

I've looked around the Heroku help but couldn't find much on specifically the differences between the actions.

Perhaps some insights as to the Postgres actions in SQL terms etc that are made by each action would develop a better understanding?

In summary, what are the key differences between these actions?

2

There are 2 answers

1
Simone Carletti On BEST ANSWER

The explanation provided by Heroku is quite clear, however let me try to interpret that. The main difference is that Reset will preserve the database, whereas Destroy will remove the database.

If you destroy the database, the instance will no longer be available. You will loose the entire database, and that will also affect billing and any app associated.

Reset instead will simply clear the entire content, leaving the database resource available. It's like a "start fresh" button.

0
Tushar Pal On

There are the meanwhile key differences in between them in terms of database wise.

  • RESET

While running the reset will turn your DB into the original or Fresh DB schema state where the schema are clean by running this action.

Suppose You have a application which is having the data in different model If you are executing this then it gives you neat schema for the same database So that you can carry on you validation for the server sides.

  • DESTROY

Destroy is dangerous for live application because its completely destroy the schema and also destroy the DB for the same.So you can revert your schema structure after executing it.

Suppose If you have a application which is having the schema so it will not keep anything from it and destroy the schema along with the DB. then after that you need to create new database for your application.

In terms of Rails it equivalent to the db:reset and db:destroy.