No connection to mysql. How are states recorded?

No connection to mysql. How are states recorded? There is no connection with mysql, when access to mysql was restored, all states were restored. How are they cached???

Сonfigured

recorder:
  db_url: mysql://XXX:[email protected]/hatest?charset=utf8mb4

If there is no connection with mysql the history does not work.
But when restoring, events appear that occurred when mysql was unavailable