AIOpenLibraryAIOpenLibrary
Back to Software Architecture

Database Scaling Strategy Advisor

Design database scaling strategies with read replicas, sharding, caching layers, and polyglot persistence based on access patterns.

Updated Mar 11, 2026

ShareLinkedIn

Customize Your Prompt

0/8 filled

Prompt

You are a database architect who has scaled systems from thousands to billions of records. Help me design a database scaling strategy.

Current database: [CURRENT_DB]
Current data volume: [DATA_VOLUME]
Growth rate: [GROWTH_RATE]
Read/write ratio: [READ_WRITE_RATIO]
Query patterns: [QUERY_PATTERNS]
Latency requirements: [LATENCY_REQUIREMENTS]
Consistency requirements: [CONSISTENCY]
Budget: [BUDGET]

Design a scaling strategy:

**1. Current State Assessment**
- Bottleneck analysis: Is the problem reads, writes, storage, or connections?
- Query performance audit: N+1s, missing indexes, full table scans
- Connection pool analysis

**2. Vertical Scaling** (do this first):
- Hardware upgrades (CPU, memory, IOPS)
- Configuration tuning (buffer pool, work_mem, max_connections)
- Query optimization (indexes, materialized views, query rewriting)
- When you've hit the ceiling and need to go horizontal

**3. Read Scaling**
- Read replicas: How many, routing strategy, replication lag handling
- Caching layers:
  - Application-level cache (what to cache, TTL strategy, invalidation)
  - Redis/Memcached: Cache-aside vs. read-through vs. write-through
  - CDN caching for API responses
- Materialized views for complex aggregations

**4. Write Scaling**
- Write-ahead optimization
- Batch/bulk operations
- Async writes (queue → DB)
- Sharding strategy (if needed):
  - Shard key selection (the most critical decision)
  - Hash-based vs. range-based partitioning
  - Cross-shard query handling
  - Resharding plan

**5. Polyglot Persistence** (right tool for each job):
- Transactional data → [recommendation]
- Search/full-text → [recommendation]
- Caching/sessions → [recommendation]
- Analytics/OLAP → [recommendation]
- Time-series → [recommendation]
- Graph relationships → [recommendation]
- Synchronization strategy between stores

**6. Data Architecture**
- Hot/warm/cold data tiering
- Archival and purge strategy
- Backup and point-in-time recovery

**7. Estimated Cost & Timeline**
- Phase 1 quick wins (this week)
- Phase 2 medium-term (this quarter)
- Phase 3 long-term (if growth continues)
- Cost comparison of approaches

**8. What NOT To Do**
- Premature optimization warnings
- Over-engineering signals
- When managed services beat self-hosting

Powered by Hugging Face Inference API

Pro Tips

  • Most teams over-shard or under-cache. A phased approach starting with vertical scaling and query optimization addresses 80% of problems before adding distributed complexity.

References

Comments

Log in to leave a comment

More Software Architecture Prompts

🏗️Software ArchitectureNEW

Architecture Decision Record Writer

Write well-structured Architecture Decision Records (ADRs) that document the context, options considered, and rationale behind key technical decisions.

You are a principal software architect who believes that documented decisions ar...

Claude
IntermediateView prompt
🏗️Software ArchitectureNEW

System Design Document Generator

Generate comprehensive system design documents (RFCs/design docs) with component architecture, data flow, API contracts, and operational considerations.

You are a staff engineer writing a design document for a new system. Create a co...

Claude
AdvancedView prompt
🏗️Software ArchitectureNEW

Event-Driven Architecture Planner

Design event-driven systems with event sourcing, CQRS, message brokers, and eventual consistency patterns.

You are a distributed systems architect specializing in event-driven architectur...

Claude
AdvancedView prompt

You Might Also Like

✍️Writing & Content✦ Premium

Blog Post Architect

Create SEO-optimized, engaging blog posts with structured outlines, compelling hooks, and strategic keyword placement.

You are an expert content strategist and SEO specialist. Create a comprehensive ...

Claude Opus 4
IntermediateView prompt
📚Education✦ Premium

Socratic Method Tutor

Learn any concept through guided questioning that builds deep understanding instead of memorization.

You are a Socratic tutor. Your role is to help me deeply understand a concept th...

Claude Opus 4
BeginnerView prompt
📦Product Management✦ Premium

Product Requirements Document (PRD)

Generate comprehensive PRDs with user stories, acceptance criteria, technical requirements, and success metrics.

You are a senior product manager at a top tech company. Write a comprehensive PR...

Claude Opus 4
IntermediateView prompt