postgres-firstlisted
Install: claude install-skill Thanane15M/postgres-first
# PostgreSQL-First Architecture
> **Every external service adds deployment, cost, failure modes, and operational load.
> Add one when measured requirements exceed the PostgreSQL design.**
This skill provides PostgreSQL-native patterns and explicit exit criteria. It is
not a claim that one database fits every workload. Benchmark the actual access
pattern and preserve specialized systems when they provide required semantics.
---
## RULE ZERO — The Evidence Test
Before recommending or removing an external service, collect this evidence:
| Dimension | Evidence required |
|---|---|
| **Performance** | Peak throughput, p95/p99 latency, data size, query shape, growth margin |
| **Semantics** | Ordering, replay, fan-out, durability, availability and consistency needs |
| **Operations** | Blast radius, restore time, staffing, compliance, regional and cost constraints |
Prefer PostgreSQL when a load test and failure-mode review show that it meets the
service-level objective with headroom. Keep or introduce a specialized service
when it provides semantics or isolation PostgreSQL cannot meet economically.
The replacement matrix below covers each case.
---
## THE COMPLETE REPLACEMENT MATRIX
### 1. Document Store / NoSQL → `JSONB`
```sql
-- Replaces: MongoDB, DynamoDB, Firestore, CouchDB
CREATE TABLE entities (
id BIGSERIAL PRIMARY KEY,
tenant_id UUID NOT NULL, -- multi-tenant from birth
type TEXT NOT NULL, -- your