Database EngineerReplication and HA2 promptsIntermediate → Advanced2 single promptsFree to use

Replication and HA AI Prompts

2 Database Engineer prompts in Replication and HA. Copy ready-to-use templates and run them in your AI workflow. Covers intermediate → advanced levels and 2 single prompts.

AI prompts in Replication and HA

2 prompts
AdvancedSingle prompt
01

Backup and Recovery Strategy

Design a backup and recovery strategy for this production database. Database size: {{size}} RPO: {{rpo}} RTO: {{rto}} Retention requirement: {{retention}} (30 days, 7 years for...

Prompt text
Design a backup and recovery strategy for this production database. Database size: {{size}} RPO: {{rpo}} RTO: {{rto}} Retention requirement: {{retention}} (30 days, 7 years for compliance, etc.) Database: {{database}} 1. Backup types: Full backup: - Complete copy of the database - Slow to create and restore; self-contained - Frequency: weekly or daily depending on RPO Incremental backup: - Only changes since the last full or incremental backup - Fast to create; requires chaining backups for restore - pgBackRest and Barman support incremental PostgreSQL backups WAL archiving (point-in-time recovery): - Archive every WAL segment to S3/GCS/Azure Blob - Enables recovery to any point in time within the archive window - Combined with a base backup: recover to any second - archive_mode = on; archive_command = 'pgbackrest --stanza=main archive-push %p' 2. pgBackRest configuration: stanza: production repo1-path: /var/lib/pgbackrest repo1-retention-full: 4 # keep 4 full backups repo1-s3-bucket: company-db-backups Schedule: - Full backup: weekly (Sunday 02:00) - Differential backup: daily (02:00 Mon-Sat) - WAL archiving: continuous 3. Recovery time estimate: - Full restore: depends on backup size and network bandwidth - PITR: restore the base backup + replay WAL up to the target time - Test restore time regularly: log the time taken in the DR runbook 4. Backup validation (critical — most organizations skip this): - Monthly automated restore test: restore to a staging instance, run integrity checks - pg_restore --list: verify backup catalog is intact - SELECT COUNT(*) on key tables after restore - Log validation results; alert if restore fails 5. Offsite and immutable backups: - Store backups in a separate cloud region from the primary database - Enable S3 Object Lock (WORM) for compliance retention requirements - Encrypt backups at rest and in transit Return: backup schedule, pgBackRest configuration, PITR setup, restore time estimate, and validation automation plan.
IntermediateSingle prompt
02

Replication Setup

Design a replication and high-availability setup for this PostgreSQL database. RPO requirement: {{rpo}} (maximum acceptable data loss) RTO requirement: {{rto}} (maximum acceptab...

Prompt text
Design a replication and high-availability setup for this PostgreSQL database. RPO requirement: {{rpo}} (maximum acceptable data loss) RTO requirement: {{rto}} (maximum acceptable downtime) Read scaling needed: {{read_scaling}} (yes/no) Cloud provider: {{cloud}} 1. Replication types: Physical (streaming) replication: - Copies WAL (Write-Ahead Log) byte-for-byte from primary to standby - Standby is an exact replica at the byte level - Synchronous mode: primary waits for standby to confirm WAL receipt before committing (RPO = 0) - Asynchronous mode: primary does not wait (small data loss risk; better performance) Logical replication: - Replicates logical changes (INSERT/UPDATE/DELETE) via the publication/subscription model - Can replicate specific tables or schemas - Allows different PostgreSQL versions between publisher and subscriber - Use for: selective replication, zero-downtime migrations, cross-version upgrades 2. Synchronous vs asynchronous: synchronous_standby_names = 'ANY 1 (standby1, standby2)' - Synchronous: guarantees RPO=0 but adds latency to every write - Asynchronous: no write latency penalty; potential for a small amount of data loss - Choice: financial / healthcare data → synchronous; acceptable small RPO → asynchronous 3. Automatic failover with Patroni: - Patroni: open-source HA solution using etcd/Consul/ZooKeeper for leader election - Automatically promotes the most up-to-date standby when the primary fails - Provides: REST API for cluster status, automatic primary registration with load balancer - Managed alternatives: AWS RDS Multi-AZ, GCP Cloud SQL HA, Azure Flexible Server 4. Read replica routing: - Direct read-heavy queries (reporting, analytics) to standby replicas - Use PgBouncer or application-level routing to send reads to replicas - Caution: replica lag means reads may see slightly stale data 5. Monitoring replication lag: SELECT client_addr, state, sent_lsn, replay_lsn, (sent_lsn - replay_lsn) AS lag_bytes FROM pg_stat_replication; Alert if lag_bytes > threshold. Return: replication architecture for the given RPO/RTO, synchronous vs async decision, Patroni configuration, and lag monitoring.

Recommended Replication and HA workflow

1

Backup and Recovery Strategy

Start with a focused prompt in Replication and HA so you establish the first reliable signal before doing broader work.

Jump to this prompt
2

Replication Setup

Review the output and identify what needs follow-up, cleanup, explanation, or deeper analysis.

Jump to this prompt

Frequently asked questions

What is replication and ha in database engineer work?+

Replication and HA is a practical workflow area inside the Database Engineer prompt library. It groups prompts that solve closely related tasks instead of leaving users to search through one flat list.

Which prompt should I start with?+

Start with the most general prompt in the list, then move toward the more specific or advanced prompts once you have initial output.

What is the difference between a prompt and a chain?+

A single prompt gives you one instruction and one output. A chain is a multi-step sequence designed to build on earlier results and produce a more complete workflow.

Can I use these prompts outside MLJAR Studio?+

Yes. They work in other AI tools too. MLJAR Studio is still the best fit when you want local execution, visible code, and notebook-based reproducibility.

Where should I go next after this category?+

Good next stops are Migration and Upgrades, Schema Design, Performance Tuning depending on what the current output reveals.

Explore other AI prompt roles

🧱
Analytics Engineer (dbt)
20 prompts
Browse Analytics Engineer (dbt) prompts
💼
Business Analyst
50 prompts
Browse Business Analyst prompts
🧩
Citizen Data Scientist
24 prompts
Browse Citizen Data Scientist prompts
☁️
Cloud Data Engineer
20 prompts
Browse Cloud Data Engineer prompts
🛡️
Compliance & Privacy Analyst
12 prompts
Browse Compliance & Privacy Analyst prompts
📊
Data Analyst
72 prompts
Browse Data Analyst prompts
🏗️
Data Engineer
35 prompts
Browse Data Engineer prompts
🧠
Data Scientist
50 prompts
Browse Data Scientist prompts
📈
Data Visualization Specialist
23 prompts
Browse Data Visualization Specialist prompts
🔧
DataOps Engineer
16 prompts
Browse DataOps Engineer prompts
🛒
Ecommerce Analyst
20 prompts
Browse Ecommerce Analyst prompts
💹
Financial Analyst
22 prompts
Browse Financial Analyst prompts
🩺
Healthcare Data Analyst
25 prompts
Browse Healthcare Data Analyst prompts
🤖
LLM Engineer
20 prompts
Browse LLM Engineer prompts
📣
Marketing Analyst
30 prompts
Browse Marketing Analyst prompts
🤖
ML Engineer
42 prompts
Browse ML Engineer prompts
⚙️
MLOps
35 prompts
Browse MLOps prompts
🧭
Product Analyst
16 prompts
Browse Product Analyst prompts
🧪
Prompt Engineer
18 prompts
Browse Prompt Engineer prompts
🧪
Prompts Engineer
18 prompts
Browse Prompts Engineer prompts
📉
Quantitative Analyst
27 prompts
Browse Quantitative Analyst prompts
🔬
Research Scientist
32 prompts
Browse Research Scientist prompts
🧮
SQL Developer
16 prompts
Browse SQL Developer prompts
📐
Statistician
17 prompts
Browse Statistician prompts