StackPractices

databases

Practical resources about databases for software engineers.

99 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.

intermediate

Cursor-Based Pagination with PostgreSQL

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

intermediate

Cache Database Query Results with Redis and Python

Cache expensive database query results in Redis with cache-aside pattern, TTL management, and...

intermediate

Configure Caffeine Cache in Java with Eviction Policies

Set up Caffeine cache in a Java application with size-based, time-based, and weighted eviction...

intermediate

Cache Database Queries with Django Cache Framework

Use Django's built-in cache framework with per-view caching, template fragment caching, and...

beginner

UUID Generation in Python, JavaScript, and Java

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

beginner

UUID Generation: v4, v7, and ULID Comparison

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

intermediate

Implement ACID Transactions in PostgreSQL

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

intermediate

Caching with Redis

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

beginner

Connect to MySQL

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

beginner

Connect to PostgreSQL

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

beginner

Connect to Redis

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

intermediate

Database Connection Pooling

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

intermediate

Handle Database Deadlocks and Retries

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

database deadlocks retries transactions
intermediate

Manage Database Migrations Safely

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

intermediate

Database Migrations Safely

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

intermediate

Set Up Database Read Replicas for Scaling

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

intermediate

Database Replication

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

database-replication database performance sql
intermediate

Database Transactions

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

intermediate

Create and Use Database Views and Materialized Views

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

intermediate

Prevent and Resolve Deadlocks in SQL Transactions

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

deadlocks isolation-levels sql concurrency

No results found.