How often sqlite flush to disk under NORMAL mode?
from PRAGMA - https://www.sqlite.org/pragma.html#pragma_synchronous
Is there any background thread which periodically flushes to disk?
No. All operations are executed on the calling thread. The only case where the sqlite3 library will create background threads is if
pragma threads is a number greater than 0, the threading mode is not single thread, and then only to assist in sorting operations.
In that case, how sync-ing with disk works?
That is a very broad question, and the answers are in the documentation.
Please visit the documentation pages, search for
sync, read the relevant documents, and come back here if you have more detailed questions, not answered by the documentation.