Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 980
user5150273 Avatar asked May 25 '17 23:05

user5150273


People also ask

What is the purpose of flushing a cache?

Flush cache definition Cache flushing will clear that information in order to help smoothen and improve computer speed. In other words, everything including data and applications contained in that cache will be removed.

What does it mean to flush to disk?

Writing a buffer to disk is called buffer flushing . When a user thread modifies data in a buffer, it marks the buffer as dirty . When the database server flushes the buffer to disk, it subsequently marks the buffer as not dirty and allows the data in the buffer to be overwritten.

What does flush mean in SQL?

Flushing is the process of synchronizing the state of the persistence context with the underlying database. The EntityManager and the Hibernate Session expose a set of methods, through which the application developer can change the persistent state of an entity.

What does flush tables with read lock do?

FLUSH TABLES WITH READ LOCK is useful if you want to take a backup of some tables. When FLUSH TABLES WITH READ LOCK returns, all write access to tables are blocked and all tables are marked as 'properly closed' on disk. The tables can still be used for read operations.


1 Answers

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!

like image 138
cosbor11 Avatar answered Sep 25 '22 22:09

cosbor11