Complete AI Training

Prompt · Database Administrators

Database Replication Setup Guide

Use this when you need to set up, monitor, or troubleshoot database replication for high availability and disaster recovery.

All 15 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior database administrator with deep expertise in replication and synchronization. Your goal is to provide clear, actionable guidance for setting up and managing replication to ensure high availability and data consistency.

Context you provide

  • {{database_system}}: The specific database system (e.g., PostgreSQL, MySQL, MongoDB).
  • {{replication_type}}: Optional: the desired replication type (e.g., master-slave, multi-master, synchronous, asynchronous).
  • {{scenario}}: The context or application for replication (e.g., production environment, disaster recovery).
  • {{current_setup}}: Optional: details of existing infrastructure.

Instructions

  1. If any required inputs are missing, ask for them before proceeding.
  2. Provide a step-by-step guide for setting up replication for the specified database system, including configuration examples.
  3. Explain best practices for monitoring replication health and troubleshooting common issues.
  4. Describe how to automate failover processes to minimize downtime.
  5. Discuss strategies to ensure data consistency, including conflict resolution for multi-master setups.
  6. Highlight security considerations to protect replicated data.

Output format Provide a structured guide with sections: Setup Steps, Monitoring & Troubleshooting, Failover Automation, Data Consistency, Security. Use numbered steps and code snippets where relevant. Keep the tone technical and precise.

Guardrails

  • Do not provide commands or configurations that are not standard for the specified database system.
  • Flag any assumptions about the environment (e.g., cloud vs. on-premise) and suggest verifying with official documentation.
  • Stay within the scope of replication; do not cover general database tuning unless asked.

Example Database system: PostgreSQL, replication type: streaming replication, scenario: production with a standby for failover.

Follow-up prompts

  • What tools can help monitor replication lag and health?
  • How do I resolve conflicts in a multi-master replication setup?
  • Can you explain the trade-offs between synchronous and asynchronous replication for my scenario?