What does flushing the database mean? Also with "flash"

user5150273 picture user5150273 · May 26, 2017 · Viewed 9.5k times · Source

I want to know what "flush" and "flash" means and the difference between them.

Answer

cosbor11 picture cosbor11 · Jan 18, 2018

Flushing: To sync the temporary state of your application data with the permanent state of the data (in a database, or on disk).

Explanation: Flushing is really a caching term, not a database term. When you save data using an ORM or an application, you usually have an object reference to it in memory. For instance, a User. The state of that user could be represented like this: {name: Bob, id: 10}. When you flush with the database you update both references to match each other. Some ORMs, like Hibernate cache the datasets (even without you configuring caching) and when the data is updated by triggers or other systems or processes outside of the current session, the data is out-of-sync until you "flush" it.

Flash: I'm assuming you mean "Flash Memory"? This just means the hardware you are storing data on is storing the data as 1s and 0s using electricity, whereas traditional memory devices store the memory as magnetic positive or negative charges. All you really need to know is that it is much faster than magnetic drives.

Hope this helps!