0

When I write to REDIS (set up with an AOF) can I be assured that my data is persisted to the AOF correctly by the time my overall write has completed?

ie: I want to make sure my write is persistent (like a successful commit) before I continue on in my processing.

Bob Light
  • 31
  • 4

1 Answers1

0

If you set appendfsync always, then every write will be persisted and flushed (OS-level fsync) before command returns. However, note that:

  • after OS level fsync there is a hardware level fsync, which is done by device driver and you have no control over it. If you care a lot about data safety, choose enterprise grade devices which have capacitors that allow emergency fsync in case of power failure.

  • appendfsync always is slow compared to other Redis modes. You can peek at numbers a bit here: aof fsync vs cassandra LSM

Imaskar
  • 2,773
  • 24
  • 35