레디스 저장(persistence)에 대한 설명은 redis 를 만든 antirez의 글을 보는 게 가장 좋은 것 같다.
출처 : http://oldblog.antirez.com/post/redis-persistence-demystified.html



처음에 OS와 디스크에 대한 설명을 진행하며, 메모리 데이터를 디스크에 저장하는 방식에서 놓칠 수 있는 부분을 설명한다. posix의 write, fsync에 대한 설명을 얘기한다. 파일 쓰기가 30초라는 부분을 설명한다. 


 For instance Linux by default will actually commit writes after 30 seconds. This means that if there is a failure, all the data written in the latest 30 seconds can get potentially lost. 


이 부분은 추후 AOF 스냅샷의 appendfsync 설명시 다시 나온다.

appendfsync no

In this configuration Redis does not perform fsync(2) calls at all. However it will make sure that clients not using pipelining, that is, clients that wait to receive the reply of a command before sending the next one, will receive an acknowledge that the command was executed correctly only after the change is transfered to the kernel by writing the command to the AOF file descriptor, using the write(2) system call.

Because in this configuration fsync(2) is not called at all, data will be committed to disk at kernel's wish, that is, every 30 seconds in most Linux systems.



디스크 저장시 발생할 수 있는 오류(data corruption)에 대한 데이터 복구에 대한 설명이 나온다. 

2.6부터 추가된 AOF에 대한 설명과 pipeline에 대한 설명이 있다. 


지금은 너무 평범하지만, 당시만 해도 관련 정보가 없어서 커뮤니티에서 이런 저런 얘기가 있었다.(댓글 만 봐도 당시 상황이 짐작된다)


antirez의 글을 통해 데이터베이스의 완벽성이 당연히 redis에 있지는 않지만, 노력했다는 것들을 좀 유추할 수 있었고, 간결함(simplicity)에 최선을 다한 느낌이 있어서 참 좋았다.






'Redis' 카테고리의 다른 글

[redis] twemproxy 설치 / 예제  (0) 2016.02.10
[redis] RDB  (1) 2016.02.09
[펌] stunnel과 redis 설정  (0) 2016.01.28
[redis] 커맨드 이름 변경하기 (rename-command)  (0) 2016.01.28
[redis] AUTH 커맨드  (0) 2016.01.28
Posted by '김용환'
,