Databases

38 guides tagged “Databases”.

  1. How to Connect an AI App to Production Data Securely Do not hand the model a database credential. Put a scoped tool layer between model and data, with tenant filters and an audit trail. Software Engineering advanced 5 min
  2. Connection Pool Exhausted: What It Is and How to Fix It Pool exhaustion means connections are held rather than missing. Learn why raising the limit makes it worse, how to find the leak, and the four real causes. DevOps intermediate 8 min
  3. Offset vs Cursor Pagination: Which Should Your API Use? Offset pagination skips rows and drifts as data changes. Cursor pagination seeks directly and stays consistent. Compare them and learn when each is right. Software Engineering intermediate 8 min
  4. Postgres vs MySQL: Which Should You Use? Postgres and MySQL are far closer than the folklore says. Compare them on types, JSON, constraints, and operations, and get a direct recommendation. Software Engineering beginner 9 min
  5. SQLite vs Postgres: Which Should You Use? SQLite is fast and zero-ops but single-writer. Postgres is concurrent and multi-user. Compare them, and see why local SQLite plus prod Postgres breaks. Software Engineering beginner 8 min
  6. Add a Database Without Regret An intermediate journey: design a schema, ship migrations, index the queries that are actually slow, and prove a backup restores. intermediate 16 min
  7. The 12 Database Mistakes That Show Up in AI-Generated Apps Missing indexes, N+1 queries, float money, naive timestamps, unpooled connections, and destructive migrations — the twelve database mistakes generated code ships with, and the fix for each. Software Engineering beginner 13 min
  8. Databases for AI Builders: Why Your AI-Generated App Gets Slow and Loses Data Your AI writes working SQL that fails at scale. Learn indexing, the N+1 problem, transactions, connection pools, migrations, backups, and consistency — with linked guides for each. Software Engineering beginner 13 min
  9. How to Choose a Database for Your App: A Decision Guide Workload, consistency, data shape, scale, and ops burden — the five questions that decide which database you should use, with a comparison table and the cases where each option is wrong. Software Engineering beginner 11 min
  10. How to Design a Database Schema (That You Won't Have to Rewrite) Design a schema from your queries, not your entities: primary keys, relationships, column types, constraints, indexes, and the migration order that survives deploy day. Software Engineering intermediate 13 min
  11. What Are the Different Types of Databases (and What Is Each One For)? Relational, document, key-value, wide-column, graph, time-series, search, and vector databases — what each data model is, the use cases it fits, and the ones it breaks. Software Engineering beginner 12 min
  12. Deploying AI-Generated Apps to Production: A Vibecoder's Checklist Your AI wrote the app. Now here's every step between 'it works on my machine' and 'it's running in production.' Deployment, monitoring, secrets, databases, and the checklist your AI didn't include. DevOps beginner 10 min
  13. How to Debug AI-Generated Database Queries That Return Wrong Results Your AI wrote a database query. It runs, but returns the wrong data — missing rows, wrong counts, stale results. Here's how to extract the raw SQL, test it directly, and fix it without the AI rewriting your whole data layer. Software Engineering beginner 6 min
  14. Eventual Consistency vs Strong Consistency: What's the Difference (and When Does It Matter)? Strong consistency guarantees all readers see the same data immediately. Eventual consistency saves latency and availability but lets reads return stale data. Here's when each is the right call. Software Engineering intermediate 6 min
  15. Software Engineering for AI Builders: The Concepts Your Coding Assistant Won't Teach You Your AI writes the code, but it doesn't teach you testing, architecture, databases, or Git. Learn every software engineering concept you need to go from vibecoding to shipping. 45+ linked guides. Software Engineering beginner 15 min
  16. How to Run PostgreSQL on k3s (With Backups That Actually Restore) Run Postgres on a single-node k3s cluster with a StatefulSet, a PersistentVolumeClaim, and a scheduled off-node backup you have restored at least once. DevOps intermediate 6 min
  17. What Is the Outbox Pattern? Writing to the database and sending a message are two operations that cannot both be atomic. The outbox pattern makes the message a database row first, then delivers it reliably. Software Engineering advanced 6 min
  18. How to Add an Index to a Slow SQL Query Diagnose a slow query with EXPLAIN, add the right index, and verify the speedup. A practical PostgreSQL tutorial. Software Engineering beginner 7 min
  19. What Is a Covering Index? An index that contains every column a query needs can answer it without visiting the table at all — an index-only scan, which is faster and cheaper than any ordinary index. Software Engineering intermediate 6 min
  20. What Are Database Migrations (and Why Do They Break Deploys)? A migration is a versioned change to your database schema, applied in order. Learn how they work and the failure modes that take down deploys. Software Engineering beginner 5 min
  21. How to Handle Timezones in a Database Store instants in UTC, store the user's zone separately, and convert at the edges. A step-by-step pass over the decisions that prevent silent time bugs. Software Engineering intermediate 8 min
  22. What Is a Materialized View? A materialized view stores the result of a query as a table. It makes expensive reads fast at the cost of staleness and maintenance — and it is not the same as a view. Software Engineering intermediate 6 min
  23. How to Read an EXPLAIN Plan A step-by-step reading of a query plan: what each node does, which numbers matter, and how to spot the scan or the estimate that explains a slow query. Software Engineering intermediate 6 min
  24. SSD vs HDD vs NVMe: What Storage Speed Actually Means Hard drives, SATA SSDs, and NVMe drives differ by more than a factor of a hundred. Learn which number matters for your workload and where cloud storage quietly hurts. Hardware & Machines beginner 7 min
  25. What Is the N+1 Query Problem? The N+1 problem fires one query per row instead of one query total, and AI-generated ORM code causes it constantly. Learn it with a code example. Software Engineering beginner 7 min
  26. What Is Eventual Consistency (and Why Do My Reads Return Stale Data)? Eventual consistency means a write becomes visible everywhere after a delay. Learn why distributed systems use it and when stale reads are a problem. Software Engineering intermediate 5 min
  27. How to Set Up Automated Database Backups Set up automated, tested database backups with a scheduled job, off-site storage, and a restore drill. Concrete commands for PostgreSQL. DevOps intermediate 8 min
  28. How to Fix 'Too Many Connections' in Postgres 'Too many connections' means your app exhausted Postgres's connection limit. Learn the real causes, the quick fixes, and the permanent ones. DevOps intermediate 5 min
  29. Kubernetes Deployment vs StatefulSet: Which Does Your Service Need? Deployments treat pods as interchangeable; StatefulSets give each pod a stable identity and its own storage. Choosing wrong for a database loses data. DevOps beginner 5 min
  30. What Is Sharding? Sharding splits one large dataset across several databases so no single machine has to hold it all. It is a last resort, and the shard key is the decision you live with. Software Engineering advanced 6 min
  31. What Is a Database Deadlock (and How Do You Fix It)? A deadlock is two transactions each holding a lock the other needs. The database detects it and kills one. Here is why generated code creates them and how to make them stop. Software Engineering intermediate 6 min
  32. What Is a Database Transaction (ACID)? A transaction groups database operations so they all succeed or all roll back. Learn ACID, why transfers need it, and how to use it in code. Software Engineering beginner 5 min
  33. What Is a Read Replica? A read replica is a copy of your database that follows the primary. It scales reads, and it introduces replication lag — which is a correctness problem, not just a delay. Software Engineering intermediate 6 min
  34. What Is a Composite Index? A composite index covers several columns in a defined order. Which queries it can serve depends on the leftmost columns, which is why column order is the whole design decision. Software Engineering intermediate 6 min
  35. What Is Database Indexing (and Why Is My Query Slow)? A database index is a lookup structure that lets queries find rows without scanning the whole table. Learn how indexes work and why queries are slow. Software Engineering beginner 7 min
  36. What Is an ORM (and When Should You Use Raw SQL)? An ORM maps database tables to objects so you write queries in your language. Learn what it hides, what it costs, and when raw SQL is the right call. Software Engineering beginner 5 min
  37. What Is a Saga Pattern (and How Is It Different From Two-Phase Commit)? Sagas coordinate a multi-service operation through local transactions and compensating actions; two-phase commit uses a coordinator that blocks. Which one fits depends on consistency needs. Software Engineering advanced 7 min
  38. What Is a Connection Pool? A connection pool reuses database connections instead of opening one per request. Learn why your app hits 'too many connections' and how pooling fixes it. DevOps beginner 5 min