architect/database-selection/SKILL.md
--- name: database-selection description: Use this skill whenever the architect subagent is asked to choose a database, compare database options, decide between SQL and NoSQL, design a data storage strategy, or recommend a database for a specific use case. Triggers on: "which database should we use", "SQL vs NoSQL", "choose a database", "data storage strategy", "what DB fits", "PostgreSQL vs MongoDB", "database for this use case", "how should we store this data". Always use this skill before rec
npx skillsauth add achreftlili/deep-dev-skills architect/database-selectionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Choose the right database for the job by analyzing data access patterns first, then matching to the appropriate storage paradigm.
Answer these questions before looking at any database:
The access pattern determines the database type. Never choose a database before answering these.
Use when:
Top choices: PostgreSQL (default), MySQL, CockroachDB (distributed)
PostgreSQL is the safe default for most applications. Only deviate with a clear reason.
Use when:
Top choices: MongoDB, Firestore, DynamoDB (with document access patterns)
Avoid when: you frequently need to query across document fields or join documents
Use when:
Top choices: Redis (in-memory), DynamoDB (persistent), Memcached (pure cache)
Use when:
Top choices: Cassandra, HBase, Bigtable
Use when:
Top choices: Elasticsearch, OpenSearch, Typesense (simpler), Meilisearch
Note: search engines are usually a secondary store — primary data lives in SQL/document DB
Use when:
Top choices: Neo4j, Neptune (AWS), Memgraph
Use when:
Top choices: InfluxDB, TimescaleDB (Postgres extension), Prometheus (metrics only)
Always present the recommendation as:
Recommended: [Database]
Runner-up: [Database]
It is normal and correct to use multiple databases. Common patterns:
| Primary Store | Secondary Store | Purpose | |--------------|----------------|---------| | PostgreSQL | Redis | Caching hot reads | | PostgreSQL | Elasticsearch | Full-text search | | MongoDB | PostgreSQL | Reporting/analytics | | Any | S3/Blob storage | File/blob storage |
State the primary store first, then justify each additional store separately.
testing
Set up Vitest 2.x with TypeScript for unit and component testing using test/describe/it, vi.fn/vi.mock/vi.spyOn, component testing with Testing Library, coverage (v8/istanbul), workspace config, and snapshot testing.
testing
Set up pytest 8.x with Python for unit and integration testing using fixtures (scope, autouse, parametrize), async tests (pytest-asyncio), mocking (unittest.mock, pytest-mock), coverage (pytest-cov), conftest.py patterns, and markers.
testing
Set up Playwright 1.49+ with TypeScript for E2E testing using page object model, fixtures, test.describe/test blocks, assertions, selectors, network mocking, CI configuration, and trace viewer.
testing
Set up Jest 30+ with TypeScript for unit tests, integration tests, mocking (jest.fn, jest.mock, jest.spyOn), coverage configuration, custom matchers, snapshot testing, and setup/teardown patterns.