본문 바로가기
DB2026년 5월 26일2분 읽기

PostgreSQL pgBackRest 백업 — 12TB DB, 시간당 백업 전략

YS
김영삼
조회 698
PostgreSQL pgBackRest 백업 — 12TB DB, 시간당 백업 전략

핵심 요약

12TB PG DB를 pgBackRest로 1년 운영. 주 full + 일 differential + 시간 incremental + WAL archive. 복구 RPO 5분, RTO 28분. 비용 월 $640. 사후.

1. 전략

  • Full: 매주 일요일 02시 (4시간, $58)
  • Differential: 매일 02시 (40분)
  • Incremental: 매시간 정각 (3~8분)
  • WAL archive: 연속, S3 every 16MB

2. pgbackrest.conf 핵심

[global]
repo1-type=s3
repo1-s3-bucket=our-pg-backup
repo1-s3-region=ap-northeast-2
repo1-cipher-type=aes-256-cbc
repo1-cipher-pass=...
process-max=8
compress-type=zst
compress-level=3
archive-async=y

3. 복구 RPO/RTO

시나리오RPORTO
마지막 WAL까지 PITR1분52분
최근 incremental까지~1h28분
전체 무손실(replica fallback)03분

4. 매월 복구 훈련

임시 EC2에 마지막 백업 복구·정합성 검증 자동화. 백업이 정말 복구 가능한지가 핵심.

5. 함정

  • WAL archive 누락 — archive_command 실패 시 복구 불가, alert 매분 monitoring
  • repo 손상 — 동일 region 1개만은 위험, cross-region 별도 repo
  • compress level 3 이상은 비용 절감 작고 CPU 폭증 — 3 권장
  • cipher pass 키 분실 = 백업 영구 손실 — Vault·KMS에 별도 보관

댓글 0

아직 댓글이 없습니다.
Ctrl+Enter로 등록