Storage & Databases Bundle
Three cheatsheets for the databases you're most likely to run in production: PostgreSQL for relational workloads, Redis for caching and queues, and Neo4j for connected data. Each sheet covers query patterns, configuration that matters, and the admin commands that rescue you at 2am.
What's Included
PostgreSQL Cheatsheet
- Query patterns — CTEs, window functions, upserts (
ON CONFLICT), LATERAL joins - Indexing — B-tree, GIN, partial indexes, and
EXPLAIN ANALYZEreading - Vacuum and bloat — autovacuum tuning, when tables need intervention
- Replication — streaming, slots, lag monitoring, failover basics
- pg_hba.conf and roles — authentication methods, least-privilege grants
- Backups — pg_dump vs physical, point-in-time recovery prerequisites
Redis Cheatsheet
- Data types — strings, hashes, lists, sets, sorted sets, streams
- Keyspace patterns — naming conventions, scanning (
SCANnotKEYS) - Persistence — RDB vs AOF trade-offs, fsync policies
- Pub/sub vs streams — when each fits
- Clustering — hash slots,
MOVEDredirects, sentinel vs cluster mode - Lua scripting — atomic multi-key operations
Neo4j Cheatsheet
- Cypher patterns — MATCH, OPTIONAL MATCH, path queries, variable-length
- Indexes and constraints — range, text, uniqueness, existence
- Query tuning — PROFILE reading, cardinality estimation, EAGER avoidance
- APOC essentials — the procedures worth installing for
- Import — LOAD CSV, batched MERGE patterns
- Graph modelling — relationship direction, property placement decisions
Excerpt — Redis Sorted Sets as Leaderboards
# Add players with scores (updates if member exists)
ZADD leaderboard 100 "player1" 85 "player2" 120 "player3"
# Top 3 with scores, highest first
ZREVRANGE leaderboard 0 2 WITHSCORES
# A player's rank (0-based) and score
ZREVRANK leaderboard "player1"
ZSCORE leaderboard "player1"
# Paginate the full board — ranks 10-19
ZREVRANGE leaderboard 10 19 WITHSCORES
Excerpt — PostgreSQL Partial Index
-- Index only unshipped orders: 2% of rows instead of 100%
CREATE INDEX idx_orders_pending
ON orders (customer_id, created_at)
WHERE status = 'pending';
-- The planner uses it when the predicate matches
EXPLAIN ANALYZE
SELECT * FROM orders
WHERE customer_id = 42 AND status = 'pending'
ORDER BY created_at DESC LIMIT 10;
Choosing Between the Three
| Workload | Database | Why | |---|---|---| | Transactions, relations, constraints | PostgreSQL | ACID, joins, mature tooling | | Caching, rate limits, queues, sessions | Redis | Sub-millisecond, in-memory semantics | | Deep relationship traversal, recommendations | Neo4j | Index-free adjacency, Cypher |
Mixed workloads are normal — PostgreSQL as source of truth, Redis in front, Neo4j beside. The sheets cross-reference these integration points (e.g., moving queue patterns between Redis lists and Postgres SKIP LOCKED).
Related Reading on graphwiz.ai
- Postgres Queues at Scale: Production Patterns
- Cypher Query Optimization
- APOC Procedures: Neo4j Production Patterns
Format
- Three PDFs (print-ready, A4)
- Instant download after purchase
Price
$9.00
Who This Is For
- Backend engineers using PostgreSQL, Redis, or Neo4j in their application stack
- Database administrators who need a cross-platform reference for SQL, key-value, and graph query patterns
- Full-stack developers building applications that combine relational data, caching, and graph relationships
FAQ
Which versions do the sheets target? PostgreSQL 16, Redis 7.x, Neo4j 5.x. Version-specific notes appear where 15/6/4 behaviour differs.
Does the Neo4j sheet cover the GDS library? It covers APOC in depth; GDS algorithm selection is a separate topic — see the Neo4j GDS article for that.
Are the cheatsheets updated? Yes — buyers get re-download access to new revisions through the library page.