StackPractices

Tag: database

Browse 68 practical software engineering resources tagged with "database". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving database. Each resource is written for engineers who ship real systems, with copy-paste examples and practical trade-offs.

Database Engineering

Databases are the persistence layer behind most production systems. Engineering them well requires understanding data modeling, indexing, transactions, replication, query optimization, and operational trade-offs.

The resources below cover relational and NoSQL databases, migrations, connection pooling, caching, full-text search, and scaling strategies. Each recipe translates database theory into working code and operational practice.

Every resource includes clear explanations, copy-paste code, and practical warnings. Use them to make informed decisions, avoid production pitfalls, and speed up your delivery. If you are just getting started, read the beginner-friendly articles first; if you are experienced, jump straight to the advanced patterns and architecture guides. New resources are added regularly, so bookmark this page and check back for the latest patterns.

Cursor-Based Pagination with PostgreSQL

Implement efficient cursor-based pagination for large datasets in PostgreSQL, avoiding OFFSET...

Pagination

How to implement cursor-based and offset-based pagination in APIs and databases across Python,...

Multi-Tenancy Architecture

Design multi-tenant applications with shared or isolated databases, tenant-aware routing, and data...

Implement the Cache-Aside Pattern with Redis

Use the cache-aside pattern to read and write data through Redis, handling cache misses, stale...

UUID Generation in Python, JavaScript, and Java

Generate universally unique identifiers (UUIDs) for database keys, session tokens, and resource...

UUID Generation: v4, v7, and ULID Comparison

Compare UUID v4, v7, ULID, and nanoid for generating unique identifiers with different tradeoffs in...

Implement ACID Transactions in PostgreSQL

How to use PostgreSQL transactions to ensure Atomicity, Consistency, Isolation, and Durability for...

Caching with Redis

How to implement application caching using Redis for performance and scalability.

Connect to MySQL

How to connect to MySQL databases in Python, JavaScript, and Java.

Connect to PostgreSQL

How to connect to PostgreSQL databases in Python, JavaScript, and Java.

Connect to Redis

How to connect to Redis and perform basic operations in Python, JavaScript, and Java.

Database Connection Pooling

Configure and tune database connection pools to maximize throughput while preventing connection...

Handle Database Deadlocks and Retries

Detect, prevent, and recover from database deadlocks with automatic retry logic, consistent lock...

Manage Database Migrations Safely

How to version, apply, and rollback database schema changes using migration tools like Flyway,...

Database Migrations Safely

How to run database schema migrations without downtime or data loss.

Set Up Database Read Replicas for Scaling

Scale read-heavy workloads with database read replicas, replication lag monitoring, and read/write...

Database Replication

Set up and manage database replication for high availability, read scaling, and disaster recovery...

Database Transactions

How to use ACID transactions to ensure data integrity across Python, JavaScript, and Java with SQL...

Create and Use Database Views and Materialized Views

How to create and use database views and materialized views to simplify queries and improve read...

Prevent and Resolve Deadlocks in SQL Transactions

Identify deadlock patterns in SQL databases, apply consistent lock ordering, use appropriate...