Loading...
Loading...
Compare original and translation side by side
| Use Case | Database | Why |
|---|---|---|
| Transactional (OLTP) | PostgreSQL | ACID, extensions, JSON support |
| High-read web apps | MySQL/MariaDB | Fast reads, mature replication |
| Flexible schema | MongoDB | Document model, horizontal scale |
| Key-value cache | Redis | Sub-ms latency, data structures |
| Time-series data | TimescaleDB/InfluxDB | Optimized for time-based queries |
| Analytics (OLAP) | Snowflake/BigQuery | Columnar, massive scale |
| 适用场景 | 数据库 | 原因 |
|---|---|---|
| 事务处理(OLTP) | PostgreSQL | ACID特性、扩展支持、JSON兼容 |
| 高读量Web应用 | MySQL/MariaDB | 读取速度快、复制机制成熟 |
| 灵活Schema | MongoDB | 文档模型、水平扩展 |
| 键值缓存 | Redis | 亚毫秒级延迟、丰富数据结构 |
| 时序数据 | TimescaleDB/InfluxDB | 针对时间维度查询优化 |
| 分析处理(OLAP) | Snowflake/BigQuery | 列存储、海量扩展能力 |
├─ Single Region HA?
│ ├─ Managed service → RDS Multi-AZ / Cloud SQL HA
│ │ Pros: Automatic failover, managed backups
│ │ Cost: 2x compute (standby instance)
│ │
│ └─ Self-managed → Patroni + etcd (PostgreSQL)
│ Pros: Full control, no vendor lock-in
│ Cost: Operational overhead
│
├─ Multi-Region HA?
│ ├─ Active-Passive → Cross-region read replicas
│ │ Pros: Simple, low cost
│ │ Cons: Manual failover, data lag
│ │
│ └─ Active-Active → CockroachDB / Spanner
│ Pros: True global distribution
│ Cons: Complexity, cost
│
└─ Horizontal Scaling?
├─ Read scaling → Read replicas
├─ Write scaling → Sharding (MongoDB, Vitess)
└─ Both → Distributed SQL (CockroachDB, TiDB)├─ Single Region HA?
│ ├─ Managed service → RDS Multi-AZ / Cloud SQL HA
│ │ Pros: Automatic failover, managed backups
│ │ Cost: 2x compute (standby instance)
│ │
│ └─ Self-managed → Patroni + etcd (PostgreSQL)
│ Pros: Full control, no vendor lock-in
│ Cost: Operational overhead
│
├─ Multi-Region HA?
│ ├─ Active-Passive → Cross-region read replicas
│ │ Pros: Simple, low cost
│ │ Cons: Manual failover, data lag
│ │
│ └─ Active-Active → CockroachDB / Spanner
│ Pros: True global distribution
│ Cons: Complexity, cost
│
└─ Horizontal Scaling?
├─ Read scaling → Read replicas
├─ Write scaling → Sharding (MongoDB, Vitess)
└─ Both → Distributed SQL (CockroachDB, TiDB)| RPO Requirement | Strategy | Implementation |
|---|---|---|
| < 1 minute | Synchronous replication | Patroni sync mode |
| < 5 minutes | Continuous WAL archiving | pg_basebackup + WAL-G |
| < 1 hour | Automated snapshots | RDS automated backups |
| < 24 hours | Daily backups | pg_dump + S3 |
| RPO要求 | 策略 | 实现方式 |
|---|---|---|
| < 1分钟 | 同步复制 | Patroni同步模式 |
| < 5分钟 | 持续WAL归档 | pg_basebackup + WAL-G |
| < 1小时 | 自动快照 | RDS自动备份 |
| < 24小时 | 每日备份 | pg_dump + S3 |