본문으로 건너뛰기
cccskills
무료GitHub에 공개

rfc-generator

Generates Request for Comments documents for technical proposals including problem statement, solution design, alternatives, risks, and rollout plans. Use for "RFC", "technical proposals", "design docs", or "architecture proposals".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구PostgreSQL
설치 방법 보기

포함된 파일(1)

  • SKILL.md8.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

RFC Generator

Create comprehensive technical proposals with RFCs.

RFC Template

# RFC-042: Implement Read Replicas for Analytics

**Status:** Draft | In Review | Accepted | Rejected | Implemented
**Author:** Alice (alice@example.com)
**Reviewers:** Bob, Charlie, David
**Created:** 2024-01-15
**Updated:** 2024-01-20
**Target Date:** Q1 2024

## Summary

Add PostgreSQL read replicas to separate analytical queries from transactional workload, improving database performance and enabling new analytics features.

## Problem Statement

### Current Situation

Our PostgreSQL database serves both transactional (OLTP) and analytical (OLAP) workloads:

- 1000 writes/min (checkout, orders, inventory)
- 5000 reads/min (user browsing, search)
- 500 analytics queries/min (dashboards, reports)

### Issues

1. **Performance degradation**: Analytics queries slow down transactions
2. **Resource contention**: Complex reports consume CPU/memory
3. **Blocking features**: Can't add more dashboards without impacting users
4. **Peak hour problems**: Analytics scheduled during business hours

### Impact

- Checkout p95 latency: 800ms (target: <300ms)
- Database CPU: 75% average, 95% peak
- Customer complaints about slow pages
- Product team blocked on analytics features

### Success Criteria

- Checkout latency <300ms p95
- Database CPU <50%
- Support 2x more analytics queries
- Zero impact on transactional performance

## Proposed Solution

### High-Level Design

┌─────────────┐ │ Primary │────────────────┐ │ (Write) │ │ └─────────────┘ │ ▼ ┌─────────────┐ │ Replica 1 │ │ (Read) │ └─────────────┘ ▼ ┌─────────────┐ │ Replica 2 │ │ (Analytics)│ └─────────────┘


### Architecture
1. **Primary database**: Handles all writes and critical reads
2. **Read Replica 1**: Serves user-facing read queries
3. **Read Replica 2**: Dedicated to analytics/reporting

### Routing Strategy
```typescript
const db = {
  primary: primaryConnection,
  read: replicaConnection,
  analytics: analyticsConnection,
};

// Write
await db.primary.users.create(data);

// Critical read (always fresh)
await db.primary.users.findById(id);

// Non-critical read (can be slightly stale)
await db.read.products.search(query);

// Analytics
await db.analytics.orders.aggregate(pipeline);

Replication

  • Type: Streaming replication
  • Lag: <1 second for read replica, <5 seconds acceptable for analytics
  • Monitoring: Alert if lag >5 seconds

Detailed Design

Database Configuration

# Primary
max_connections: 200
shared_buffers: 4GB
work_mem: 16MB

# Read Replica
max_connections: 100
shared_buffers: 8GB
work_mem: 32MB

# Analytics Replica
max_connections: 50
shared_buffers: 16GB
work_mem: 64MB

Connection Pooling

const pools = {
  primary: new Pool({ max: 20, min: 5 }),
  read: new Pool({ max: 50, min: 10 }),
  analytics: new Pool({ max: 10, min: 2 }),
};

Query Classification

enum QueryType {
  WRITE = "primary",
  CRITICAL_READ = "primary",
  READ = "read",
  ANALYTICS = "analytics",
}

function route(queryType: QueryType) {
  return pools[queryType];
}

Alternatives Considered

Alternative 1: Vertical Scaling

Approach: Upgrade to larger database instance

  • Pros: Simple, no code changes
  • Cons: Expensive ($500 → $2000/month), doesn't separate workloads, still hits limits
  • Verdict: Rejected - doesn't solve isolation problem

Alternative 2: Separate Analytics Database

Approach: Copy data to dedicated analytics DB (e.g., ClickHouse)

  • Pros: Optimal for analytics, no impact on primary
  • Cons: Complex ETL pipeline, eventual consistency, high maintenance
  • Verdict: Defer - consider for future if replicas insufficient

Alternative 3: Materialized Views

Approach: Pre-compute analytics results

  • Pros: Fast queries, no replicas needed
  • Cons: Limited to known queries, maintenance overhead
  • Verdict: Complement to replicas, not replacement

Tradeoffs

What We're Optimizing For

  • Performance isolation
  • Cost efficiency
  • Quick implementation
  • Operational simplicity

What We're Sacrificing

  • Slight data staleness (acceptable for analytics)
  • Additional infrastructure complexity
  • Higher operational costs

Risks & Mitigations

Risk 1: Replication Lag

Impact: Analytics sees stale data Probability: Medium Mitigation:

  • Monitor lag continuously
  • Alert if >5 seconds
  • Document expected lag for users

Risk 2: Configuration Complexity

Impact: Routing errors, performance issues Probability: Low Mitigation:

  • Comprehensive testing
  • Gradual rollout
  • Easy rollback mechanism

Risk 3: Cost Overrun

Impact: Budget exceeded Probability: Low Mitigation:

  • Use smaller instance for analytics ($300/month)
  • Monitor usage
  • Right-size after 1 month

Rollout Plan

Phase 1: Setup (Week 1-2)

  • Provision read replica 1
  • Provision analytics replica 2
  • Configure replication
  • Verify lag <1 second
  • Load testing

Phase 2: Read Replica (Week 3)

  • Deploy routing logic
  • Route 10% search queries to replica
  • Monitor errors and latency
  • Ramp to 100%

Phase 3: Analytics Migration (Week 4-5)

  • Identify analytics queries
  • Update dashboard queries to analytics replica
  • Test reports
  • Migrate all analytics

Phase 4: Validation (Week 6)

  • Measure checkout latency improvement
  • Verify CPU reduction
  • User acceptance testing
  • Mark as complete

Success Metrics

Primary Goals

  • ✅ Checkout latency <300ms p95 (currently 800ms)
  • ✅ Primary DB CPU <50% (currently 75%)
  • ✅ Zero errors from replication lag

Secondary Goals

  • Support 2x analytics queries
  • Enable new dashboard features
  • Team satisfaction survey >8/10

Cost Analysis

ComponentCurrentProposedDelta
Primary DB$500/mo$500/mo$0
Read Replica-$500/mo+$500
Analytics Replica-$300/mo+$300
Total$500/mo$1,300/mo+$800/mo

ROI: Better performance enables revenue growth; analytics unlocks product insights

Open Questions

  1. What's acceptable replication lag for analytics? (Proposed: <5 sec)
  2. How do we handle replica failure? (Proposed: Fallback to primary)
  3. Should we add more replicas later? (Proposed: Monitor and decide in Q2)

Timeline

  • Week 1-2: Provisioning and setup
  • Week 3: Read replica migration
  • Week 4-5: Analytics migration
  • Week 6: Validation
  • Total: 6 weeks

Appendix

References

Review History

  • 2024-01-15: Initial draft (Alice)
  • 2024-01-17: Added cost analysis (Bob)
  • 2024-01-20: Addressed review comments

## RFC Process

### 1. Draft (1 week)
- Author writes RFC
- Include problem, solution, alternatives
- Share with team for early feedback

### 2. Review (1-2 weeks)
- Distribute to reviewers
- Collect comments
- Address feedback
- Iterate on design

### 3. Approval (1 week)
- Present to architecture review
- Resolve remaining concerns
- Vote: Accept/Reject
- Update status

### 4. Implementation
- Track progress
- Update RFC with learnings
- Mark as implemented

## Best Practices

1. **Clear problem**: Start with why
2. **Concrete solution**: Be specific
3. **Consider alternatives**: Show you explored options
4. **Honest tradeoffs**: Every choice has costs
5. **Measurable success**: Define done
6. **Risk mitigation**: Plan for failure
7. **Iterative**: Update based on feedback

## Output Checklist

- [ ] Problem statement
- [ ] Proposed solution with architecture
- [ ] 2+ alternatives considered
- [ ] Tradeoffs documented
- [ ] Risks with mitigations
- [ ] Rollout plan with phases
- [ ] Success metrics defined
- [ ] Cost analysis
- [ ] Timeline estimated
- [ ] Reviewers assigned

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audits and implements web accessibility (a11y) following WCAG 2.1 guidelines with ARIA patterns, keyboard navigation, screen reader support, and contrast checking. Use when users request "accessibility audit", "a11y review", "WCAG compliance", "screen reader support", or "keyboard navigation".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

Creates Architecture Decision Records documenting key technical decisions with context, alternatives considered, tradeoffs, consequences, and decision owners. Use when documenting "architecture decisions", "technical choices", "design decisions", or "ADRs".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

Designs multi-step agent workflows with tool usage, retry logic, state management, and budget controls. Provides orchestration diagrams, tool execution order, fallback strategies, and cost limits. Use for "AI agents", "agentic workflows", "multi-step AI", or "autonomous systems".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

MUST USE when user wants to 调研/research/搜索/search/查/找/look up anything on the internet — e.g. 全网调研 X / 帮我调研一下 X / 查一下 X / 搜搜 X / 看看大家怎么评价 X / X 上有什么讨论 / research this topic。 Also MUST USE when user mentions any platform or shares any URL/链接: 小红书/xiaohongshu/xhs, Twitter/推特/X, B站/bilibili, Reddit, Facebook, Instagram, V2EX, LinkedIn/领英/招聘/求职/jobs, YouTube, GitHub code search, 小宇宙播客, 雪球/股票行情, RSS feeds, or any web URL. 15 platforms, multi-backend routing (OpenCLI / per-platform CLIs / APIs). Zero config for 6 channels. Run `agent-reach doctor --json` to see which backend serves each platform right now. NOT for: 写报告/数据分析/翻译等内容加工(本 skill 只负责从互联网获取内容); 发帖/评论/点赞等写操作;已有专门 skill 的平台(先用专门 skill)。 【路由方式】SKILL.md 包含路由表和常用命令,复杂场景需按需阅读对应分类的 references/*.md。 分类:search / social (小红书/推特/B站/V2EX/Reddit/Facebook/Instagram) / career(LinkedIn) / dev(github) / web(网页/文章/RSS) / video(YouTube/B站/播客) / finance(雪球/股票)。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

Orchestrates multi-agent AI systems with task delegation, agent communication, shared memory, and workflow coordination. Use when users request "multi-agent system", "agent orchestration", "AI agents", "agent coordination", or "autonomous agents".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

Creates SLO-based alerts and operational dashboards with key charts, alert thresholds, and runbook links. Use for "alerting", "dashboards", "SLO", or "monitoring".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sathishssj3/Stereix-Engine22026년 10월 4일 업데이트

sathishssj3의 스킬 모두 보기

이 스킬의 문제 신고