Skip to content

Topic · 67 articles

Databases

Modeling data, indexing it, and keeping writes correct.

Behind almost every backend problem is a data problem. This hub is the broader view across databases: how to model relationships, when an index helps and when it hurts, keeping writes atomic with transactions, optimizing slow queries, and isolating tenants safely in a shared database.

For engine-specific depth, follow it into the PostgreSQL and Redis hubs.

Subscribe to Databases via RSS

All Databases articles

Redis Caching Best Practices and Pitfalls — Aman Kumar Singh
Cache Invalidation Strategies with Redis — Aman Kumar Singh
Refresh-Ahead Caching with Redis — Aman Kumar Singh
Write-Behind (Write-Back) Caching with Redis — Aman Kumar Singh
Read-Through and Write-Through Caching with Redis — Aman Kumar Singh
The Cache-Aside Pattern with Redis — Aman Kumar Singh
Redis Key Expiration, TTL, and Eviction Policies — Aman Kumar Singh
Redis Sorted Sets and Ranked Data — Aman Kumar Singh
Redis Sets and Set Operations — Aman Kumar Singh
Redis Lists and Simple Queues — Aman Kumar Singh
Redis Hashes: Storing Objects — Aman Kumar Singh
Redis Strings, Counters, and Atomic Operations — Aman Kumar Singh
Redis Data Structures: An Overview — Aman Kumar Singh
What Redis Is and When to Use It — Aman Kumar Singh
The PostgreSQL Production Checklist — Aman Kumar Singh
Scaling PostgreSQL: Vertical, Read Replicas, and Sharding — Aman Kumar Singh
Monitoring PostgreSQL in Production — Aman Kumar Singh
Tuning Autovacuum for Production in PostgreSQL — Aman Kumar Singh
Backups and Point-in-Time Recovery in PostgreSQL — Aman Kumar Singh
High Availability and Failover in PostgreSQL — Aman Kumar Singh
Streaming Replication and Read Replicas in PostgreSQL — Aman Kumar Singh
Connection Pooling with PgBouncer in PostgreSQL — Aman Kumar Singh
Table Partitioning in PostgreSQL — Aman Kumar Singh
Row-Level Security for Multi-Tenant SaaS in PostgreSQL — Aman Kumar Singh
Show all 67 articles
Triggers and Stored Procedures in PostgreSQL — Aman Kumar Singh
Materialized Views and Refresh Strategies in PostgreSQL — Aman Kumar Singh
Views in PostgreSQL: When They Help and When They Hurt — Aman Kumar Singh
Full-Text Search in PostgreSQL — Aman Kumar Singh
Arrays, Enums, and Composite Types in PostgreSQL — Aman Kumar Singh
Indexing and Querying JSONB Efficiently in PostgreSQL — Aman Kumar Singh
Working with JSONB in PostgreSQL — Aman Kumar Singh
MVCC, Dead Tuples, and VACUUM in PostgreSQL — Aman Kumar Singh
SELECT FOR UPDATE and Row-Locking Patterns in PostgreSQL — Aman Kumar Singh
Optimistic vs Pessimistic Locking in PostgreSQL — Aman Kumar Singh
Understanding and Preventing Deadlocks in PostgreSQL — Aman Kumar Singh
Locks in PostgreSQL and How to Avoid Contention — Aman Kumar Singh
PostgreSQL Isolation Levels Explained — Aman Kumar Singh
Transactions and ACID in PostgreSQL — Aman Kumar Singh
Index Maintenance, Bloat, and REINDEX in PostgreSQL — Aman Kumar Singh
Finding and Fixing Slow Queries in PostgreSQL — Aman Kumar Singh
PostgreSQL Query Optimization Techniques — Aman Kumar Singh
Reading EXPLAIN and EXPLAIN ANALYZE in PostgreSQL — Aman Kumar Singh
Partial and Expression Indexes in PostgreSQL — Aman Kumar Singh
Composite and Covering Indexes in PostgreSQL — Aman Kumar Singh
Choosing the Right PostgreSQL Index Type — Aman Kumar Singh
How PostgreSQL Indexes Actually Work — Aman Kumar Singh
CTEs and Recursive Queries in PostgreSQL — Aman Kumar Singh
Window Functions in PostgreSQL — Aman Kumar Singh
Aggregations, GROUP BY, and HAVING in PostgreSQL — Aman Kumar Singh
SQL Joins in PostgreSQL, Explained Properly — Aman Kumar Singh
Constraints: Your Last Line of Data Integrity — Aman Kumar Singh
Primary Keys in PostgreSQL: UUID vs BIGINT — Aman Kumar Singh
Schema Design and Normalization in PostgreSQL — Aman Kumar Singh
Choosing the Right PostgreSQL Data Types — Aman Kumar Singh
Pagination and Filtering — Aman Kumar Singh
Transactions and Data Integrity — Aman Kumar Singh
Database Migrations in NestJS — Aman Kumar Singh
Connecting PostgreSQL with TypeORM — Aman Kumar Singh
Performance Tuning Before Launch — Aman Kumar Singh
Disaster Recovery and Backups — Aman Kumar Singh
Audit Logs You Can Trust — Aman Kumar Singh
Multi-Tenancy Architecture for SaaS — Aman Kumar Singh
Organizations, Teams, and Invitations — Aman Kumar Singh
Adding Full-Text Search — Aman Kumar Singh
Organization and Multi-Tenant Authentication — Aman Kumar Singh
Role-Based Access Control (RBAC) in a SaaS — Aman Kumar Singh
Setting Up PostgreSQL the Right Way — Aman Kumar Singh

Frequently asked questions

Which databases do these articles cover?

Mostly relational databases with PostgreSQL as the primary example, alongside Redis for caching, plus the modeling, indexing, and transaction principles that apply across SQL engines.

How do I make a slow database query fast?

Start with the schema and indexes, not the query text. The articles cover reading EXPLAIN output, choosing indexes that actually get used, and avoiding N+1 access patterns — the changes that move query time the most.