Topic

Databases

Hand-picked tutorials, guides and examples on Databases — explained simply.

  • 40 articles
  • 52 min of reading
  • 2 sub-topics
  • 27 Sep, 2026 last updated

Showing 40 articles

MySQLNew 1 min read

Modern MySQL Features Every Developer Should Use

If your MySQL habits date from version 5.x, you're missing features that make queries simpler and schema changes safer. Common table expressions WITH monthly AS ( SELECT DATE_FORMAT(created_at, '%Y-%m') AS month, SUM(total) AS revenue FROM orders GROUP BY mont...

27 Sep, 2026 Author 569 132
Read article
MongoDBNew 1 min read

MongoDB for SQL Developers

MongoDB stores data as JSON-like documents in collections . If you know SQL, most concepts map directly; the big shift is designing around how data is read rather than normalising everything. Vocabulary Table → collection . Row → document (stored as BSON, whic...

26 Sep, 2026 Author 313 84
Read article
MongoDB 1 min read

MongoDB Schema Design: Embed or Reference?

"Schemaless" doesn't mean "no design". In MongoDB, schema design starts from one question: what does the application read together? Embed when data is read together and owned by the parent { "_id": "ord_42", "customerId": 7, "status": "paid", "shippingAddress"...

08 Sep, 2026 Author 1.46K 135
Read article
Redis 2 min read

Distributed Locks with Redis

When several app instances run the same scheduled job, you often want exactly one of them to do the work. A Redis lock is a simple way to coordinate. Acquire with SET NX PX import { randomUUID } from 'node:crypto'; async function acquireLock(name, ttlMs) { con...

21 Aug, 2026 Author 460 44
Read article
PostgreSQL 2 min read

Working with JSONB in PostgreSQL

JSONB stores JSON in a binary format that PostgreSQL can query and index efficiently. It's ideal for data whose shape varies: webhook payloads, settings, product attributes. JSON vs JSONB json stores the text as-is; jsonb parses it into a binary form, drops du...

04 Aug, 2026 Author 1.42K 56
Read article
MySQL 1 min read

JSON in MySQL: Columns, Functions and Indexing

MySQL's JSON column type validates documents on insert and stores them in an efficient binary format. It's handy for flexible attributes alongside normal columns. Storing and reading CREATE TABLE products ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, name V...

04 Aug, 2026 Author 206 78
Read article
Redis 1 min read

Event Processing with Redis Streams

Redis Streams are append-only logs with consumer groups. They sit between simple Redis lists and full message brokers like Kafka: persistent, replayable and easy to run. Producing events await redis.xAdd('orders', '*', { // '*' = auto-generated id (timestamp-s...

03 Aug, 2026 Author 697 37
Read article
Redis 1 min read

Real-Time Messaging with Redis Pub/Sub

Pub/Sub lets one process publish a message to a channel and every subscribed process receive it instantly. A classic use is keeping WebSocket servers in sync. The problem it solves With three app instances behind a load balancer, user A's WebSocket might be on...

16 Jul, 2026 Author 410 73
Read article
MongoDB 1 min read

Mongoose Models, Validation and Middleware

MongoDB itself is flexible about document shape. Mongoose adds schemas, validation, defaults and helpers on top of the official driver, which brings structure to application code. Defining a model import mongoose from 'mongoose'; await mongoose.connect(process...

15 Jul, 2026 Author 274 35
Read article
MongoDB 1 min read

Multi-Document Transactions in MongoDB

Single-document updates in MongoDB have always been atomic. Since version 4.0 (replica sets) and 4.2 (sharded clusters), MongoDB also supports multi-document ACID transactions. Do you need one? Often a good document design avoids the need. Updating an order an...

27 Jun, 2026 Author 701 134
Read article
PostgreSQL 1 min read

Full-Text Search in PostgreSQL

For many apps, PostgreSQL's built-in full-text search is good enough to skip running a separate search engine. It handles stemming ("running" matches "run"), ranking and boolean queries. Core concepts SELECT to_tsvector('english', 'The runners were running qui...

24 May, 2026 Author 1.29K 98
Read article
PostgreSQL 1 min read

SQL Window Functions and CTEs in PostgreSQL

Window functions compute values across related rows without collapsing them like GROUP BY does. Combined with CTEs, they replace a lot of application-side data crunching. Window function basics SELECT customer_id, id AS order_id, total_paise, ROW_NUMBER() OVER...

06 May, 2026 Author 1.24K 75
Read article
MySQL 1 min read

Upgrading to MySQL 8.4 LTS: What You Need to Know

MySQL 8.0 reached end of life in April 2026, so it no longer receives security fixes. The current long-term support line is MySQL 8.4 LTS . The new release model LTS releases (8.4) - long support with bug and security fixes only. The right choice for productio...

05 May, 2026 Author 413 121
Read article
Redis 1 min read

Storing Sessions in Redis with Express

The default in-memory session store loses every session on restart and doesn't work with more than one server. Redis is the standard fix: fast, shared and with built-in expiry. Setup npm install express-session connect-redis redis import express from 'express'...

05 May, 2026 Author 581 87
Read article
PostgreSQL 2 min read

What's New in PostgreSQL 18

PostgreSQL 18 was released in September 2025. Here are the changes most relevant to application developers and operators. Asynchronous I/O A new asynchronous I/O subsystem lets PostgreSQL issue several reads at once instead of waiting for each one. Sequential...

18 Apr, 2026 Author 288 35
Read article
MySQL 1 min read

Backing Up and Restoring MySQL Databases

A backup you've never restored is a hope, not a backup. Here's how to take consistent MySQL backups and prove they work. Logical backups with mysqldump mysqldump --single-transaction --routines --triggers --events \ --set-gtid-purged=OFF -h db -u backup -p sho...

17 Apr, 2026 Author 1.38K 119
Read article