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.

advanced

Implement the Transactional Outbox Pattern for Reliable

Use the transactional outbox pattern to reliably publish domain events alongside database changes,...

intermediate

Prevent SQL Injection with SQLAlchemy Parameterized Queries

Protect Python applications from SQL injection using SQLAlchemy parameterized queries, ORM models,...

intermediate

Live Database Credentials with HashiCorp Vault

How to use HashiCorp Vault to generate short-lived database credentials, eliminating hardcoded...

advanced

Design a DynamoDB Single-Table Schema for Serverless Apps

Design a DynamoDB single-table schema with composite keys, GSI patterns, and access patterns for...

advanced

Multi-Tenant Data Isolation Pattern

Isolate tenant data in shared infrastructure using row-level security, schema-per-tenant, or...

intermediate

Composite Entity Pattern

Map a coarse-grained entity to multiple database tables by composing dependent objects, reducing...

intermediate

Data Mapper Pattern

Separate in-memory domain objects from the database by delegating persistence to a dedicated mapper...

intermediate

Database per Service Pattern

Give each microservice its own private database to ensure loose coupling, independent deployment,...

intermediate

Eager Loading Pattern

Load related data in a single query rather than multiple round-trips, preventing the N+1 problem...

advanced

Geode Pattern

Distribute data across nodes with partitioning so each node owns a shard. Horizontal scaling...

intermediate

Identity Map Pattern

Ensure each object is loaded only once per transaction by caching instances by their primary key,...

intermediate

Materialized View Pattern

Precompute and store expensive query results in a read-optimized cache to avoid repeated costly...

intermediate

Repository Pattern with TypeScript Generics

Implement a type-safe repository pattern in TypeScript that decouples data access logic from domain...

intermediate

Serverless DB Connection Pooling Pattern

Manage database connections across serverless invocations by using external connection poolers,...

advanced

Sharding Pattern

Split a large dataset into smaller partitions (shards) distributed across multiple servers to...

intermediate

Specification Pattern

Encapsulate business rules for selecting objects as reusable, composable predicate objects that can...

intermediate

Unit of Work Pattern

Track changes to in-memory objects during a business transaction and commit all updates atomically...

advanced

Data Migration Runbook: Checklist

Use this data migration runbook template to plan safe migrations. Includes pre-migration checks,...

intermediate

Database Failover Runbook

A step-by-step runbook for executing database failover procedures safely with minimal downtime and...

intermediate

Database Query Tuning Checklist

Checklist for systematic SQL query optimization: EXPLAIN plan analysis, index strategy, N+1 query...

No results found.