백업, 복원 및 재해 복구
수파베이스의 백업 메커니즘을 이해하고, 수동 백업을 수행하는 방법과 데이터를 위한 재해 복구 계획을 수립하는 방법을 학습합니다.
백업, 복원 및 재해 복구은(는) CoddyKit의 무료 Supabase Backend as a Service 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Supabase Backend as a Service 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Supabase Backend as a Service 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Data Safety: Why Backups?
In the world of applications, your data is one of your most valuable assets. Losing it due to an accident, corruption, or malicious activity can be catastrophic.
This lesson will guide you through Supabase's backup mechanisms, how to perform manual backups, and how to create a solid Disaster Recovery Plan (DRP).
Supabase's Automatic Backups
Supabase provides robust automatic backup solutions to protect your database. These backups are taken daily and stored securely.
- Daily Snapshots: Your entire database is backed up automatically every 24 hours.
- Retention: These backups are typically retained for 7 days on the free plan and up to 30 days on paid plans.
- Managed Service: Supabase handles the complexity of these backups for you, ensuring data durability.
Understanding Backup Types
When discussing database backups, it's helpful to understand the difference between logical and physical backups:
- Logical Backups: These export your database schema and data as a series of SQL commands. They are flexible and portable, great for migrating data.
pg_dumpcreates logical backups. - Physical Backups: These are direct copies of the database files on disk. They are faster for large databases but less portable. Supabase's automatic backups are typically physical snapshots.
Performing Manual Database Dumps
While Supabase handles automatic backups, performing manual dumps gives you direct control over specific data points or for local development. You can use the standard PostgreSQL tool pg_dump via your terminal.
Remember to replace <YOUR_DB_HOST> with your actual database host (e.g., db.<PROJECT_REF>.supabase.co) and set the PGPASSWORD environment variable before running.
PGPASSWORD="<YOUR_DB_PASSWORD>" pg_dump \
-h <YOUR_DB_HOST> -p 5432 \
-U postgres -d postgres > my_supabase_backup.sqlRestoring from a Manual Backup
To restore your database from a .sql backup file, you can use the psql command-line client. This is useful for migrating data or recovering to a specific state.
Important: Restoring usually involves dropping existing tables, so be extremely careful and ensure you have a fresh backup of your current state before proceeding!
PGPASSWORD="<YOUR_DB_PASSWORD>" psql \
-h <YOUR_DB_HOST> -p 5432 \
-U postgres -d postgres \
< my_supabase_backup.sqlPoint-in-Time Recovery (PITR)
For business-critical applications, Supabase offers Point-in-Time Recovery (PITR) on higher-tier plans. This advanced feature allows you to restore your database to *any* specific second within a given retention period.
PITR is crucial for minimizing data loss in scenarios where you need to undo a specific accidental change or recover from a precise moment before an incident occurred.
Backing Up Supabase Storage
Beyond your database, Supabase Storage holds your application's files (images, videos, documents). Unlike the database, Storage buckets are not automatically backed up by Supabase in the same way.
You should implement your own strategy for backing up critical files from your Storage buckets. This might involve:
- Regularly downloading files using the Supabase CLI.
- Using a custom script that interacts with the Storage API.
- Integrating with cloud storage backup services.
What is a Disaster Recovery Plan?
A Disaster Recovery Plan (DRP) is a documented process for an organization to recover from an unplanned event that disrupts normal operations. It's more comprehensive than just backups.
A DRP outlines steps to ensure your application can quickly resume critical functions after a major incident, such as a regional outage, data center failure, or severe data corruption.
Key DRP Components
A robust Disaster Recovery Plan (DRP) should include:
- Recovery Time Objective (RTO): The maximum acceptable downtime.
- Recovery Point Objective (RPO): The maximum acceptable amount of data loss.
- Roles & Responsibilities: Who does what during a disaster.
- Communication Plan: How to inform users and stakeholders.
- Testing Schedule: Regularly testing the DRP to ensure it works.
- Runbooks: Step-by-step guides for recovery procedures.
DRP Quick Check
Consider the core components of a Disaster Recovery Plan (DRP).
Recap: Data Safety First
Congratulations! You've learned about the critical aspects of data safety with Supabase.
- Supabase provides automatic daily database backups.
- You can perform manual logical backups and restores using
pg_dumpandpsql. - Point-in-Time Recovery offers advanced restoration capabilities.
- Remember to plan for backing up your Supabase Storage files.
- A comprehensive Disaster Recovery Plan (DRP) is essential for business continuity, defining RTO, RPO, roles, and testing.
Always prioritize your data's safety!
자주 묻는 질문
“백업, 복원 및 재해 복구” 강의는 무료인가요?
네 — “백업, 복원 및 재해 복구” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Supabase Backend as a Service 강의 전체를 잠금 해제할 수 있습니다. Supabase Backend as a Service 강의에는 총 4개의 강의가 포함되어 있습니다.
“백업, 복원 및 재해 복구”에서 뭘 배우나요?
수파베이스의 백업 메커니즘을 이해하고, 수동 백업을 수행하는 방법과 데이터를 위한 재해 복구 계획을 수립하는 방법을 학습합니다. 브라우저에서 직접 실행하는 실습 코드로 Supabase Backend as a Service을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Supabase Backend as a Service을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Supabase Backend as a Service은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“백업, 복원 및 재해 복구” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Supabase Backend as a Service 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Supabase Backend as a Service 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 환경 관리 및 CI/CD
- 백업, 복원 및 재해 복구
- 보안 감사 및 모범 사례
- 모니터링, 로깅 및 관측 가능성