# Does yugabyte db fsync data to file?

**URL:** <https://forum.yugabyte.com/t/does-yugabyte-db-fsync-data-to-file/646>\
**Category:** General\
**Created:** [March 2, 2020, 11:28am UTC](https://forum.yugabyte.com/t/does-yugabyte-db-fsync-data-to-file/646 "2020-03-02T11:28:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![divingdiana](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@divingdiana](https://forum.yugabyte.com/u/divingdiana)\
**Post date:** [March 2, 2020, 11:28am UTC](https://forum.yugabyte.com/t/does-yugabyte-db-fsync-data-to-file/646/1 "2020-03-02T11:28:05Z")

</div>

How is data recovered after a crash?

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [March 2, 2020, 1:58pm UTC](https://forum.yugabyte.com/t/does-yugabyte-db-fsync-data-to-file/646/2 "2020-03-02T13:58:34Z")

</div>

> Does yugabyte db fsync data to file?

Yes. YugabyteDB uses DocDB for persistence. [DocDB](https://docs.yugabyte.com/latest/architecture/docdb/) is a LSM storage engine forked from RocksDB. In a single node scenario, on restart the process read the WAL to return in the state that it was when it crashed.

> How is data recovered after a crash?

Each DML is synchronously [replicated](https://docs.yugabyte.com/latest/architecture/docdb/replication/) using RAFT algorithm and each replica writes to it’s own local Write Ahead Log.

When a node [crashes](https://docs.yugabyte.com/latest/architecture/core-functions/high-availability/#tablet-peer-leader-failure), YugabyteDB picks a new leader tablet in the order of a couple of seconds. If the old node doesn’t come back online or it takes too long, tablet peers are replicated in other nodes of the cluster using a process called bootstraping until the replication factor is achieved for each tablet.
