databases
Practical resources about databases for software engineers.
98 results
Storing, Querying, and Scaling Data
Databases are the persistence layer every application depends on. Choosing between relational and NoSQL, designing indexes, handling migrations, and optimizing slow queries are skills that directly impact user experience and infrastructure cost.
This section covers recipes for PostgreSQL and MySQL connections, MongoDB CRUD operations, Redis caching strategies, and schema design patterns. You will also find guides on ACID transactions, connection pooling, and full-text search implementation.
Implement the Transactional Outbox Pattern for Reliable
Use the transactional outbox pattern to reliably publish domain events alongside database changes,...
Prevent SQL Injection with SQLAlchemy Parameterized Queries
Protect Python applications from SQL injection using SQLAlchemy parameterized queries, ORM models,...
Live Database Credentials with HashiCorp Vault
How to use HashiCorp Vault to generate short-lived database credentials, eliminating hardcoded...
Design a DynamoDB Single-Table Schema for Serverless Apps
Design a DynamoDB single-table schema with composite keys, GSI patterns, and access patterns for...
Multi-Tenant Data Isolation Pattern
Isolate tenant data in shared infrastructure using row-level security, schema-per-tenant, or...
Composite Entity Pattern
Map a coarse-grained entity to multiple database tables by composing dependent objects, reducing...
Data Mapper Pattern
Separate in-memory domain objects from the database by delegating persistence to a dedicated mapper...
Database per Service Pattern
Give each microservice its own private database to ensure loose coupling, independent deployment,...
Eager Loading Pattern
Load related data in a single query rather than multiple round-trips, preventing the N+1 problem...
Geode Pattern
Distribute data across nodes with partitioning so each node owns a shard. Horizontal scaling...
Identity Map Pattern
Ensure each object is loaded only once per transaction by caching instances by their primary key,...
Materialized View Pattern
Precompute and store expensive query results in a read-optimized cache to avoid repeated costly...
Repository Pattern with TypeScript Generics
Implement a type-safe repository pattern in TypeScript that decouples data access logic from domain...
Serverless DB Connection Pooling Pattern
Manage database connections across serverless invocations by using external connection poolers,...
Sharding Pattern
Split a large dataset into smaller partitions (shards) distributed across multiple servers to...
Specification Pattern
Encapsulate business rules for selecting objects as reusable, composable predicate objects that can...
Unit of Work Pattern
Track changes to in-memory objects during a business transaction and commit all updates atomically...
Data Migration Runbook: Checklist
Use this data migration runbook template to plan safe migrations. Includes pre-migration checks,...
Database Failover Runbook
A step-by-step runbook for executing database failover procedures safely with minimal downtime and...
Database Query Tuning Checklist
Checklist for systematic SQL query optimization: EXPLAIN plan analysis, index strategy, N+1 query...
No results found.