Farshad Tofighi·Jan 2How MySQL Works Behind the ScenesMany people think MySQL always reads and writes data directly from disk, but in reality, it is designed to minimize disk access and…
Farshad Tofighi·Nov 2, 2025How Redis Removes Expired Cache Keys Behind the ScenesEvery 100 milliseconds (for example), Redis runs a loop that samples a small batch of random keys with expiration times, say, 20 keys per…
Farshad Tofighi·Oct 6, 2025A Clean Way to Detect Slow Queries in LaravelLaravel’s DB::listen lets you hook into every query being executed. Each query comes with its execution time (in milliseconds).
Farshad Tofighi·Aug 30, 2025Mastering Adapter Pattern in Laravel: Building Modular ApplicationsWhen building modular applications in Laravel, one common challenge is how to let different modules interact without creating tight…
Farshad Tofighi·Jul 18, 2025Understanding Redis Eviction PoliciesAn eviction policy in Redis decides what data should be removed (or evicted) when memory is full and new data needs to be added.
Farshad Tofighi·Jul 4, 2025Laravel Tip: Simplify Arrays with fluent()The fluent() function is a Laravel helper that wraps an array into an instance of Illuminate\Support\Fluent.
Farshad Tofighi·Jun 4, 2025Prevent Double Spending in APIs with Idempotency KeysIf you’re building an API that involves money, inventory, or any kind of limited resource, there’s one problem you need to care about…A response icon1A response icon1
Farshad Tofighi·Apr 17, 202510 Lesser-Known Git Commands That Will Level Up Your WorkflowIf you’re a developer, you’re probably using Git every day. And chances are, most of the time you’re typing the same five or six commands…
Farshad Tofighi·Dec 25, 2024How to Sync Data Across Multiple Tabs in a Browser Using JavaScriptLet’s say you’re running an online store. You add an item to your cart in one tab, and now you want that item to appear in all other tabs.A response icon1A response icon1
Farshad Tofighi·Oct 16, 2024Understanding Cache::lock in Laravel: A Solution to Race ConditionsCache::lock is a feature in Laravel that allows you to create distributed locks using Laravel’s cache system.A response icon1A response icon1