Loading...
Loading...
Database design, SQL, NoSQL, and data management
npx skill4agent add fujigo-software/f5-framework-claude database┌─────────────────────────────────────────────────────────┐
│ Relational (SQL) │
│ PostgreSQL │ MySQL │ SQL Server │ Oracle │ SQLite │
├─────────────────────────────────────────────────────────┤
│ Document (NoSQL) │
│ MongoDB │ CouchDB │ Firestore │ RethinkDB │
├─────────────────────────────────────────────────────────┤
│ Key-Value │
│ Redis │ DynamoDB │ Memcached │ etcd │ Riak │
├─────────────────────────────────────────────────────────┤
│ Wide-Column │
│ Cassandra │ HBase │ ScyllaDB │ BigTable │
├─────────────────────────────────────────────────────────┤
│ Graph │
│ Neo4j │ Amazon Neptune │ ArangoDB │ JanusGraph │
├─────────────────────────────────────────────────────────┤
│ Time-Series │
│ InfluxDB │ TimescaleDB │ Prometheus │ QuestDB │
├─────────────────────────────────────────────────────────┤
│ Search │
│ Elasticsearch │ OpenSearch │ Meilisearch │ Typesense │
└─────────────────────────────────────────────────────────┘| Use Case | Recommended | Alternative | Rationale |
|---|---|---|---|
| General purpose | PostgreSQL | MySQL | Versatile, ACID, JSON support |
| Simple web app | MySQL | SQLite | Wide hosting support |
| High-speed caching | Redis | Memcached | Data structures, persistence |
| Flexible documents | MongoDB | CouchDB | Schema-less, horizontal scale |
| Analytics/OLAP | ClickHouse | BigQuery | Column-oriented, fast aggregations |
| Complex relationships | Neo4j | ArangoDB | Native graph queries |
| Time-series data | TimescaleDB | InfluxDB | Time-based partitioning |
| Full-text search | Elasticsearch | Meilisearch | Inverted index, relevance |
| Global distribution | CockroachDB | Spanner | Geo-partitioning |
| Embedded/Edge | SQLite | DuckDB | Zero configuration |
Start: What's your primary need?
│
├─> Structured data with relationships?
│ ├─> Complex queries needed? → PostgreSQL
│ ├─> Simple CRUD, wide hosting? → MySQL
│ └─> Embedded/serverless? → SQLite
│
├─> Flexible schema/documents?
│ ├─> Horizontal scaling? → MongoDB
│ └─> Real-time sync? → Firestore
│
├─> High-speed caching?
│ ├─> Data structures needed? → Redis
│ └─> Simple key-value? → Memcached
│
├─> Analytics/reporting?
│ ├─> Real-time analytics? → ClickHouse
│ └─> Time-series data? → TimescaleDB
│
├─> Graph relationships?
│ └─> → Neo4j or Amazon Neptune
│
└─> Full-text search?
└─> → Elasticsearch or Meilisearch┌─────────────┐ ┌─────────────┐
│ Primary │────▶│ Replica │◀── Reads
│ (Writes) │ │ (Reads) │
└─────────────┘ └─────────────┘
┌─────────────┐
────▶│ Replica │◀── Reads
│ (Reads) │
└─────────────┘┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ App │────▶│ Cache │────▶│ Database │
│ │ │ (Redis) │ │ (PGSQL) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
└───────────────────┘
Cache miss: query DB, populate cache┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Events │────▶│ Event │────▶│ Projected │
│ (append) │ │ Store │ │ Views │
└─────────────┘ └─────────────┘ └─────────────┘database/
├── _index.md # This file
├── fundamentals/
│ ├── database-types.md # Database paradigms comparison
│ ├── acid-properties.md # Transaction guarantees
│ ├── cap-theorem.md # Distributed system trade-offs
│ └── normalization.md # Data normalization forms
├── sql/
│ ├── sql-fundamentals.md # Basic SQL operations
│ ├── advanced-queries.md # Complex query patterns
│ ├── joins-explained.md # Join types with diagrams
│ ├── window-functions.md # Analytics functions
│ └── cte-subqueries.md # CTEs and subqueries
├── postgresql/
│ ├── postgres-features.md # PostgreSQL capabilities
│ ├── indexes.md # Index types and usage
│ ├── json-operations.md # JSON/JSONB handling
│ └── full-text-search.md # FTS configuration
├── nosql/
│ ├── mongodb-basics.md # MongoDB fundamentals
│ ├── redis-patterns.md # Redis data patterns
│ ├── dynamodb-modeling.md # DynamoDB design
│ └── when-to-use.md # NoSQL vs SQL decision
├── design/
│ ├── schema-design.md # Schema principles
│ ├── data-modeling.md # ER modeling
│ ├── relationships.md # Relationship types
│ └── denormalization.md # Strategic denorm
├── migrations/
│ ├── migration-strategies.md # Migration approaches
│ ├── zero-downtime.md # Online migrations
│ └── data-migration.md # Data movement
├── optimization/
│ ├── query-optimization.md # Query tuning
│ ├── indexing-strategies.md # Index design
│ ├── explain-analyze.md # Query plans
│ └── connection-pooling.md # Pool management
└── operations/
├── backup-recovery.md # Backup strategies
├── replication.md # Replication setup
├── sharding.md # Horizontal scaling
└── monitoring.md # DB observability