data-modeling
Firestore 데이터 모델링과 스키마 설계 패턴을 적용합니다. 새 컬렉션 추가, 관계 설계, 인덱스 최적화, 데이터 마이그레이션 시 사용하세요. NoSQL 특성에 맞는 비정규화 전략을 포함합니다.
When & Why to Use This Skill
This Claude skill provides expert-level Firestore data modeling and NoSQL schema design strategies. It focuses on optimizing database performance and scalability through advanced patterns such as denormalization, composite keys, and atomic counters. Designed for developers and architects, it ensures efficient data structures, cost-effective query patterns, and seamless data migration workflows tailored for NoSQL environments.
Use Cases
- Schema Design for New Applications: Architecting scalable Firestore collection structures and relationship models from the ground up using NoSQL best practices.
- Performance Optimization: Implementing denormalization and data embedding strategies to reduce document reads, minimize latency, and lower operational costs.
- Complex Relationship Management: Utilizing composite keys and unique identifier patterns to handle many-to-many relationships and data integrity constraints.
- Data Migration and Evolution: Planning and executing schema updates or large-scale data migrations while maintaining consistency and optimizing index usage.
| name | data-modeling |
|---|---|
| description | Firestore 데이터 모델링과 스키마 설계 패턴을 적용합니다. 새 컬렉션 추가, 관계 설계, 인덱스 최적화, 데이터 마이그레이션 시 사용하세요. NoSQL 특성에 맞는 비정규화 전략을 포함합니다. |
| allowed-tools | Read, Glob, Grep |
Data Modeling Skill
Instructions
- Denormalize frequently accessed data (NoSQL has no joins)
- Use composite keys for unique relationships (e.g.,
${userId}_${projectId}) - Maintain counters on parent documents for read optimization
- Use soft delete for legal compliance
- Apply consistent timestamp patterns
Current Collections
firestore/
├── projects # Main content
├── users # User profiles
├── comments # Project comments
├── whispers # Private feedback
├── ai_usage # AI rate limiting
├── likes # User-project likes (composite key)
├── digests # Newsletter digests
└── subscriptions # Newsletter subscriptions
Key Patterns
// Denormalization: embed author info
const project = {
authorId: 'user123',
authorName: '홍길동', // Copied from user
}
// Composite Key: unique constraint
const likeId = `${userId}_${projectId}`
// Counter Pattern
await docRef.update({ likes: FieldValue.increment(1) })
For complete schemas, design patterns, and migration strategies, see reference.md.