Md. Khorshed Alam

@robelsust

Full-stack engineer and entrepreneur building native developer tools and modern web applications for the Laravel and WP ecosystem.

Commit activity

375 commits in the last year

longest streak 21 dayscurrent 2

6,840 XPMaximum rank (UID 0)

Today

Creating a full GIN (payload) index on a heavy JSONB column bloats write amplification when you only ever filter by payload->>'event_type'. A targeted B-tree expression index on ((payload->>'event_type')) is a fraction of the disk size and much faster to update on…
Running WHERE LOWER(email) = LOWER(?) on a login endpoint bypasses a standard B-tree index on email and scans the whole users table. Either add a functional index on LOWER(email) or normalize emails to lowercase before saving so lookups stay under a millisecond.
Wrapping non-critical third-party analytics pings or cache warmers in Laravel's rescue(fn () => ..., report: true) keeps the main HTTP response from throwing a 500 if an external telemetry service blips, while still sending the exception to Sentry or Nightwatch.
Replacing defineProps(['modelValue']) and defineEmits(['update:modelValue']) pairs with const model = defineModel<string>() across our reusable form inputs deleted hundreds of lines of boilerplate in our Inertia views without changing how parent components bind v-model.
Writing custom openssl_encrypt() wrappers with manual IV concatenation and HMAC checks is way too easy to get subtly wrong. PHP's built-in sodium_crypto_secretbox() handles authenticated encryption in a single call and has been baked into core since PHP 7.2.

Yesterday

Wrapping expensive permission or feature-flag lookups inside Laravel's once(fn () => ...) helper caches the return value in memory for the current request instance and automatically flushes between Octane requests or queue jobs.

Sun, Nov 15

Storing money as BIGINT in minor units (cents/poisha) works fine until you hit multi-currency FX conversions or fractional unit pricing where you need four decimal places. Using NUMERIC(19, 4) in Postgres paired with brick/money in PHP avoids floating-point rounding bugs…
Just as you don't have multiple time zones in a system, you don't add multiple currencies. That is inviting problems. You use foreign currencies for input and display. Everything else is on your preferred currency alone. Bringing modules and architecture to juggle multiple moving…
Routing 50MB video or ZIP uploads through PHP-FPM workers ties up memory and socket connections when a user is on a slow mobile connection. Generating a signed Storage::temporaryUploadUrl() and letting the browser PUT straight to S3 or R2 keeps backend workers free for actual…
I am thirsty of low-memory tips like this one, keep up the good work... 💾
Using { ...formState } when resetting or snapshots-comparing nested form objects in React still shares references on inner arrays, so mutating a nested line-item quietly corrupts your dirty-check baseline. Native structuredClone(formState) handles deep copies cleanly without…
Switching PgBouncer from session pooling to transaction pooling let our 2-vCPU Postgres instance handle 600 concurrent PHP-FPM workers using only 25 actual backend database connections. Just remember to disable prepared statement caching on the PDO side if you're on an older…

Sat, Nov 14

Wrapping a 100k-row CSV or API sync inside a single DB::transaction() is a trap—one malformed row at 95% either rolls back the entire run or leaves your database half-imported with no clean way to resume. I built laravel-data-pipeline to handle streaming ETL in Laravel without…
GitHubGitHub - robelsust/laravel-data-pipeline: Streaming ETL pipelines for Laravel with batch validation, transactional checkpoints, deduplication, and quarantine recovery.Streaming ETL pipelines for Laravel with batch validation, transactional checkpoints, deduplication, and quarantine recovery. - robelsust/laravel-data-pipeline
A query with WHERE tenant_id = ? AND status = 'active' ORDER BY created_at DESC LIMIT 20 will still trigger an expensive Using filesort in MySQL if your index only covers (tenant_id, status). Appending created_at to the end of that composite index lets InnoDB read the top…
Reading headers() or cookies() inside a shared layout helper in Next.js quietly opts every child route out of static rendering without a single build warning. Moving that header check into middleware or a leaf component brought our cached route TTFB back down to 15ms.
Configuring a dedicated database connection in Laravel with options => [PDO::ATTR_TIMEOUT => 5] and SET statement_timeout = '5s' for user-facing CSV and analytics filters keeps a single unindexed date-range query from pegging CPU across the primary database.
Adding v-memo="[row.id, row.status, isSelected]" to a 1,500-row table in Vue 3 stopped the entire grid from re-rendering every time a user ticked a single checkbox. Virtual scrolling is overkill when skipping unnecessary VNode diffs already drops frame time below 4ms.
By default, a single failed job inside Bus::batch() marks the entire batch as cancelled and skips the then() callback. Chaining ->allowFailures() when dispatching bulk webhook or email batches lets healthy jobs keep processing while you inspect the failed rows inside…

Fri, Nov 13

Always keep retry_after on your Redis queue connection at least 15 to 30 seconds higher than the longest job $timeout. When those two numbers are equal, Redis releases the job back to another worker the exact second the first worker is still trying to finish, and your payment…
Checking whether a user has any audit log rows with if ($user->auditLogs()->count() > 0) forces MySQL to scan and count every matching index entry. Using $user->auditLogs()->exists() compiles down to SELECT EXISTS(... LIMIT 1) and stops scanning on the very first match.
Always pass an explicit minute limit to ->withoutOverlapping(15) on scheduled commands in Laravel instead of relying on the default 24-hour mutex TTL. If a container gets OOM-killed mid-run, waiting a full day for the cache lock to expire on its own will quietly stall your…

Thu, Nov 12

When multiple cron workers pull pending payout rows from the same table, plain SELECT ... FOR UPDATE makes the second worker sit idle waiting on row locks. Adding SKIP LOCKED lets each worker grab the next unlocked batch immediately without stepping on each other.

[deleted]This commit was deleted.

⌂ Proxy