default로 appendonly.aof 파일에 기록됨

수행 순서

  1. 클라이언트가 Redis에 업데이트 요청
  2. Redis 해당 명령 AOF에 저장
  3. 파일쓰기 완료 후 명령을 수행해 Redis 메모리 내용 변경

같은 Key에 대해 여러 명령어가 수행된다면 메모리에는 마지막 수행값만 남지만 AOF은 수행된 모든 기록이 남음

AOF 사용법

설정 설명 예시
appendonly AOF 사용 여부 yes
appendfilename AOF 파일 이름 "appendonly.aof
appendfsync 운영체제의 fsync()에 의한 지연된 쓰기 옵션(메모리 → 디스크)

max memory는 실제메모리의 절반이 좋음

appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

appendonly.aof 파일 형식