PostgreSQL indexing for newbies - Practical Guide postgres-16

PostgreSQL indexing for newbies - Practical Guide

PostgreSQL indexing explained for beginners: how B-tree, BRIN, GIST, and GIN indexes work, reading EXPLAIN ANALYZE to see if they are used, maintenance and hit rate tips, and clear rules for when an index helps and when it just slows your writes down.

Mar 31, 2025

Mastering database enums in Rails with Postgres - Guide

Mastering database enums in Rails with Postgres - Guide

Database enums in PostgreSQL give Rails apps type safety, implicit ordering, and faster queries than string columns. Single-value enums with validation, multi-select enum arrays, dynamic enum management, and the migrations that wire it all together.

How to run Rails console in safe sandbox mode?

How to run Rails console in safe sandbox mode?

Rails console sandbox mode wraps every database operation in a transaction and rolls it all back on exit, so you can experiment safely. How to launch it, plus the traps: database locking, non-rollbackable operations, and why production use still needs care.

What is ACID?

What is ACID?

ACID stands for Atomicity, Consistency, Isolation, and Durability: the four guarantees behind reliable database transactions. Each property explained with a concrete Rails example, like wrapping a money transfer in a transaction so it fully succeeds or rolls back.

Database shrading and database partitioning in Rails

Database shrading and database partitioning in Rails

Database sharding in Rails step by step: create a separate database per shard, wire them up in database.yml, and query across them. Plus how sharding differs from partitioning, with a native PostgreSQL partitioning example done through Rails migrations.

Rails eager_load, joins and includes - when to use what

Rails eager_load, joins and includes - when to use what

Rails eager_load, includes, preload, and joins each fight slow queries differently: LEFT OUTER JOIN versus separate queries, how includes picks its strategy, and when a plain joins is enough. Clear examples showing which loading method to choose for each situation.