コンテンツにスキップ

システム設計35概念の解説記事リスト

概要

システム設計の35概念について個別に解説した記事を書いた、という投稿。lucode.co に記事がある。

詳細

投稿で紹介されているトピック一覧(投稿本文より):

  1. Microservices
  2. Redis
  3. Event-driven architecture
  4. Database indexing
  5. Circuit breakers
  6. (投稿は「さらに表示」で続く)

システム設計面接や実務で頻出の概念が網羅されている。想定される残りのトピック例:

  • Load balancing
  • Caching strategies
  • Message queues (Kafka, RabbitMQ)
  • CAP theorem
  • Consistent hashing
  • Rate limiting
  • API Gateway
  • Service discovery
  • Distributed transactions
  • CDN
  • Database sharding
  • Replication
  • Observability / Monitoring
  • Authentication & Authorization
  • WebSockets / SSE
  • Search (Elasticsearch)
  • Object storage (S3)
  • Distributed locks
  • Saga pattern
  • CQRS / Event sourcing
  • Idempotency
  • Backpressure
  • Blue-green / Canary deployment
  • Chaos engineering

なぜ重要か / いつ使うか

システム設計面接での使い方

  • 面接前に各概念を「1ページで説明できる」レベルまで理解しておく
  • 特に Redis・Database indexing・Circuit breakers・Event-driven は頻出

実務での活用

概念 典型的な使いどころ
Redis セッション、キャッシュ、分散ロック、Rate limiting
Circuit Breaker マイクロサービス間の連鎖障害防止(Resilience4j, Hystrix)
Event-driven 注文処理・通知・非同期ワークフロー
Database indexing スロークエリの改善(EXPLAIN で確認)
Microservices 大規模チームで独立デプロイが必要な場合

Circuit Breaker の動作例

CLOSED → (失敗が閾値超過) → OPEN → (タイムアウト後)→ HALF-OPEN → (成功)→ CLOSED
                                                                      → (失敗)→ OPEN
// Go での概念実装
type CircuitBreaker struct {
    state       State // CLOSED, OPEN, HALF_OPEN
    failures    int
    threshold   int
    lastFailure time.Time
    timeout     time.Duration
}

func (cb *CircuitBreaker) Call(fn func() error) error {
    if cb.state == OPEN {
        if time.Since(cb.lastFailure) > cb.timeout {
            cb.state = HALF_OPEN
        } else {
            return ErrCircuitOpen
        }
    }
    err := fn()
    if err != nil {
        cb.failures++
        cb.lastFailure = time.Now()
        if cb.failures >= cb.threshold {
            cb.state = OPEN
        }
        return err
    }
    cb.failures = 0
    cb.state = CLOSED
    return nil
}