Tips tagged with "Advanced"

Browse all tips tagged with Advanced.
shape
shape
shape
shape
shape
shape
shape
shape

Database Hard

Transaction Isolation Levels: Dirty, Non-Repeatable and Phantom Reads in MySQL and PostgreSQL

Why DB::transaction() did not stop your oversold stock: what each isolation level guarantees in MySQL vs PostgreSQL and how to pick one in Laravel.

Laravel 13 PHP 8.4 Mysql 8.4
Diagram Try the challenge
11 min Read tip
DevOps Hard

Zero-Downtime Database Migrations with Expand/Contract: Rename Columns Without Breaking Deploys

Renaming a column mid-deploy breaks old servers and queue workers. Use expand/contract, batched backfills and the right deploy order to change schemas safely.

Laravel 13 PHP 8.4 Mysql 8.4
Diagram Try the challenge
12 min Read tip
JavaScript Medium

JavaScript Event Loop: Microtasks vs Macrotasks, Predicting Output Order, and Starving the Loop

Sync code, then all microtasks, then one macrotask. Use that rule to predict Promise vs setTimeout order and to stop async loops from freezing Node.

Node.js 22 Ecmascript 2024
Diagram Try the challenge
11 min Read tip
Laravel Medium

Laravel Job Batching vs Chains: Progress, Failures, allowFailures and then/catch/finally

Bus::chain runs jobs in order and stops at the first failure; Bus::batch runs them in parallel with progress and callbacks. Learn exactly when then, catch and finally fire.

Laravel 13 PHP 8.4
Diagram Try the challenge
10 min Read tip
DevOps Hard

Consistent Hashing: Distributing Load Without a Full Reshuffle

How consistent hashing distributes keys across nodes so adding or removing a node only reshuffles a small fraction of the keyspace, with a virtual-node implementation in PHP and Python.

PHP 8.4 Python 3.12
Diagram Try the challenge
3 min Read tip
PHP Medium

LRU Cache: Design an O(1) Cache with a Doubly Linked List and Hash Map

How to design an LRU cache that supports get and put in O(1) time using a hash map paired with a doubly linked list, with a working PHP implementation and a hands-on coding challenge.

PHP 8.4
Diagram Try the challenge
4 min Read tip
Laravel Medium

Idempotency Keys: Preventing Duplicate Payments in Distributed Systems

Why idempotency keys matter in payment APIs, how to implement them safely with a database-backed store, and common pitfalls like race conditions and key collisions.

PHP 8.4
Diagram
4 min Read tip
Database Hard

Database Deadlocks: Detection, Diagnosis, and Prevention

How relational databases detect deadlocks with wait-for graphs, why they happen, and concrete techniques to prevent them in high-concurrency systems.

Postgresql 13+
Diagram
5 min Read tip
DevOps Medium

Docker Multi-Stage Builds for Smaller Images

Reduce your Docker image size dramatically using multi-stage builds.

Docker 20.10+
Diagram
2 min Read tip
Laravel Medium

Laravel Query Optimization with Eager Loading

Learn how to optimize database queries in Laravel by using eager loading to prevent N+1 query problems.

Laravel 11.x PHP 8.2+
Diagram
2 min Read tip