<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: wilfridterry</title>
    <description>The latest articles on DEV Community by wilfridterry (@wilfridterry).</description>
    <link>https://dev.to/wilfridterry</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3982610%2F220ef38f-0e2c-414f-92b1-7052a5649f27.png</url>
      <title>DEV Community: wilfridterry</title>
      <link>https://dev.to/wilfridterry</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wilfridterry"/>
    <language>en</language>
    <item>
      <title>200 OK Is Not the Same as "It Works"</title>
      <dc:creator>wilfridterry</dc:creator>
      <pubDate>Wed, 17 Jun 2026 19:19:33 +0000</pubDate>
      <link>https://dev.to/wilfridterry/200-ok-is-not-the-same-as-it-works-14cd</link>
      <guid>https://dev.to/wilfridterry/200-ok-is-not-the-same-as-it-works-14cd</guid>
      <description>&lt;p&gt;A few months ago a team I know shipped a routine Friday deploy. Every monitor stayed green all weekend. On Monday they discovered the signup form had been throwing a JavaScript error since Friday afternoon. The server was returning &lt;code&gt;200 OK&lt;/code&gt; the whole time. The page loaded. The HTML was valid. And not a single person could create an account for three days.&lt;/p&gt;

&lt;p&gt;Nobody filed a bug. Customers don't file bugs. They hit a wall and leave.&lt;/p&gt;

&lt;p&gt;This is the uncomfortable truth about most monitoring setups: &lt;strong&gt;they answer "is the server responding?" when the question that actually matters is "can a customer do the thing they came to do?"&lt;/strong&gt; Those are not the same question, and the gap between them is where revenue quietly leaks out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why &lt;code&gt;200 OK&lt;/code&gt; lies
&lt;/h2&gt;

&lt;p&gt;A classic uptime check does roughly this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s2"&gt;"%{http_code}"&lt;/span&gt; https://yoursite.com/
&lt;span class="c"&gt;# 200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Green. Ship it. But &lt;code&gt;200&lt;/code&gt; only tells you the origin returned &lt;em&gt;something&lt;/em&gt;. It says nothing about whether that something is usable. All of the following return &lt;code&gt;200&lt;/code&gt; while being completely broken for a real human:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A page that renders blank because a JS bundle 404'd and the framework never hydrated.&lt;/li&gt;
&lt;li&gt;A checkout button that disappeared after a CSS refactor changed a class name.&lt;/li&gt;
&lt;li&gt;A login form that submits to an endpoint now returning &lt;code&gt;500&lt;/code&gt;, but the page itself loads fine.&lt;/li&gt;
&lt;li&gt;A third-party script (payments, analytics, a chat widget) that fails and takes the rest of the page down with it.&lt;/li&gt;
&lt;li&gt;A layout that "works" but pushes the CTA below a broken hero image, so conversions crater.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server is healthy. The &lt;em&gt;experience&lt;/em&gt; is dead. And the longer your front end leans on client-side rendering, third-party scripts, and multi-step flows, the wider this gap gets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three layers, not one
&lt;/h2&gt;

&lt;p&gt;Closing the gap means monitoring at three levels, each catching a class of failure the others miss.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Health — but the deep kind
&lt;/h3&gt;

&lt;p&gt;Pinging a URL is table stakes. A genuinely useful health check on a single request should also surface:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTTP, SSL, DNS, redirects&lt;/strong&gt; — the boring stuff that still takes you down at 2 a.m. when a cert expires.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blank-page / empty-render detection&lt;/strong&gt; — did the DOM actually paint meaningful content, or did you ship an empty &lt;code&gt;&amp;lt;div id="app"&amp;gt;&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broken resources&lt;/strong&gt; — any sub-resource (JS, CSS, images, fonts) that failed to load.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Console JavaScript errors&lt;/strong&gt; — the silent killers, since a thrown error can break interactivity without changing the status code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First-party API calls&lt;/strong&gt; — did the XHR/fetch calls the page depends on actually succeed?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Core Web Vitals, security headers, basic a11y and SEO&lt;/strong&gt; — slower-moving signals, but cheap to grab in the same pass.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key shift: stop treating "responded" as "healthy." Healthy means &lt;em&gt;rendered and interactive&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Visual regression — catch what you can't assert
&lt;/h3&gt;

&lt;p&gt;Some breakage has no clean assertion. A button moved. The hero image is 404ing so the layout collapsed. A font swap pushed everything 40px down. You can't easily &lt;code&gt;expect()&lt;/code&gt; your way to "the page looks right."&lt;/p&gt;

&lt;p&gt;So you do what humans do — you look. Programmatically:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capture a screenshot on a schedule (daily/weekly for stable pages).&lt;/li&gt;
&lt;li&gt;Diff it pixel-by-pixel against the previous baseline.&lt;/li&gt;
&lt;li&gt;Surface the changed percentage and the diff image so a human can glance and decide: intended change, or regression?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the same idea behind tools like Percy or BackstopJS, applied continuously to production rather than only in CI. A 2% diff after a deploy you didn't ship is a great early-warning signal.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Journey monitoring — test the verbs
&lt;/h3&gt;

&lt;p&gt;Health checks test nouns (the page). Journeys test verbs (the actions). This is where real money lives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Search → add to cart → checkout&lt;/strong&gt; for ecommerce.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signup → verify → onboard&lt;/strong&gt; for SaaS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Login → load dashboard → key action&lt;/strong&gt; for everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A journey monitor drives a real (headless) browser through these steps on a schedule and reports failure &lt;em&gt;at the step level&lt;/em&gt; — so you don't just learn "checkout is broken," you learn "step 4, clicking 'Place order,' timed out." Historically this meant maintaining brittle Playwright/Cypress scripts that break every time a selector changes. The newer approach is to describe the flow in plain language and let the tooling resolve the steps, which dramatically lowers the maintenance cost that kills most synthetic-monitoring efforts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this lands in practice
&lt;/h2&gt;

&lt;p&gt;You can absolutely assemble this yourself: a cron'd headless-Chrome script for health, BackstopJS for visual diffs, Playwright for journeys, and something to route alerts. I've gone down that road; the wiring and the &lt;em&gt;upkeep&lt;/em&gt; are the expensive parts. Selectors rot, baselines drift, and the alerting glue becomes its own side project.&lt;/p&gt;

&lt;p&gt;The other option is a tool that bundles the three layers. &lt;a href="https://northduty.com/" rel="noopener noreferrer"&gt;NorthDuty&lt;/a&gt; is one I looked at recently that's built squarely around this "up but broken" thesis — it runs health checks (every 5 minutes by default), screenshot-based visual diffs, and user-journey checks on the same project, and notably lets you define journeys as plain text instead of scripts, plus AI-suggests a handful of likely happy-path flows per site. It's &lt;a href="https://northduty.com/app/register" rel="noopener noreferrer"&gt;free to use right now&lt;/a&gt;, so it's easy to point it at a site and see what your current monitoring has been missing. There are others in adjacent space (Checkly leans script-first and developer-heavy, Better Stack and Pingdom lean uptime-first, Visualping is visual-only). The point isn't the brand — it's that you should be covering all three layers, however you get there.&lt;/p&gt;

&lt;h2&gt;
  
  
  A pragmatic starting point
&lt;/h2&gt;

&lt;p&gt;If you want to close the biggest part of the gap with the least effort, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade your health check&lt;/strong&gt; to detect blank renders, console errors, and failed sub-resources — not just status codes. This alone catches a surprising share of "green but broken" incidents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add one journey&lt;/strong&gt; for your single most revenue-critical flow (checkout or signup). One good journey beats ten URL pings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add visual diffs&lt;/strong&gt; on your 3–5 highest-traffic, rarely-changing pages, where an unexpected diff is almost always a regression.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set thresholds, not just on/off&lt;/strong&gt; — alert on response time, health score, SSL expiry, and journey failure, and route them somewhere your team already reads (Slack/Discord/Teams), with maintenance windows to mute planned-work noise.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;200 OK&lt;/code&gt; is a promise from your server, not from your product. The deploys that hurt most are rarely the ones that take the site &lt;em&gt;down&lt;/em&gt; — they're the ones that leave it &lt;em&gt;up and quietly broken&lt;/em&gt;, where every dashboard is green and your customers are the only ones who know the truth.&lt;/p&gt;

&lt;p&gt;Monitor the experience, not just the endpoint.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;How does your team catch "up but broken" today — custom scripts, a hosted tool, or do you find out from support tickets? Curious what's actually working for people.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>monitoring</category>
      <category>testing</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Built a Free Laravel Package That Catches Slow Queries and Writes the Migration For You</title>
      <dc:creator>wilfridterry</dc:creator>
      <pubDate>Sat, 13 Jun 2026 12:41:01 +0000</pubDate>
      <link>https://dev.to/wilfridterry/i-built-a-free-laravel-package-that-catches-slow-queries-and-writes-the-migration-for-you-4ogp</link>
      <guid>https://dev.to/wilfridterry/i-built-a-free-laravel-package-that-catches-slow-queries-and-writes-the-migration-for-you-4ogp</guid>
      <description>&lt;p&gt;Your production database is slow. You know it. Your users know it. But you don't know &lt;em&gt;when&lt;/em&gt; it started or &lt;em&gt;which deploy&lt;/em&gt; broke it.&lt;/p&gt;

&lt;p&gt;Yesterday's deploy made some query 4x slower. Telescope shows "current state" — but not the regression. Pulse tells you "queries are slow" — but not what changed. You're left digging through git logs and running EXPLAIN manually.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;Cardinal&lt;/strong&gt; to answer one question: "Which deploy made which query slow?"&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Let's say you deploy at 3pm. By 6pm, your error tracking shows increased timeout exceptions. You check Telescope — queries look fine now. You check git history — 47 commits since 3pm. You run EXPLAIN on 10 queries manually. Stress.&lt;/p&gt;

&lt;p&gt;This is the "production detective work" pattern. Every team does it. Most solve it by:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keeping spreadsheets of "known slow queries"&lt;/li&gt;
&lt;li&gt;Setting up separate query monitoring (expensive SaaS, usually APM)&lt;/li&gt;
&lt;li&gt;Running &lt;code&gt;slower:analyze&lt;/code&gt; locally in dev (misses production patterns)&lt;/li&gt;
&lt;li&gt;Doing nothing and accepting slow deploys&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cardinal does the detective work for you.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;p&gt;Install the free Laravel package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require cardinal/laravel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. No setup. It hooks into your database automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  It Catches Three Things
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Slow queries&lt;/strong&gt; — tracks every query, alerts when p95 crosses your threshold (default 500ms).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. N+1 queries&lt;/strong&gt; — detects when the same fingerprinted query repeats inside a single request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Warning: N+1: SELECT * FROM products WHERE id = ? [150 repeats in single request]
Location: app/Http/Controllers/OrderController.php:42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Missing indexes&lt;/strong&gt; — parses WHERE and JOIN conditions, checks your schema, suggests an index if a leading column is uncovered.&lt;/p&gt;

&lt;h3&gt;
  
  
  The AI Part
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;php artisan cardinal:analyze {id}&lt;/code&gt; and Cardinal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Gets the query template and its EXPLAIN output&lt;/li&gt;
&lt;li&gt;Reads your table schema (columns, indexes, constraints)&lt;/li&gt;
&lt;li&gt;Sends context to Claude or OpenAI (your API key, your cost)&lt;/li&gt;
&lt;li&gt;Returns a structured diagnosis + ready-to-run migration
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;php artisan cardinal:analyze slow-query-123
&lt;span class="go"&gt;
Diagnosis:
  Query was doing a full table scan of 2.1M rows.
  Missing composite index on (user_id, status).

Fix migration generated:
  php artisan cardinal:fix slow-query-123

Expected improvement:
  p95 latency: 1200ms to 120ms (~10x faster)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// OrderController.php&lt;/span&gt;
&lt;span class="nv"&gt;$orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'items'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$orders&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// triggers N+1&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cardinal catches this automatically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N+1 Detected
Query:    SELECT * FROM customers WHERE id = ?
Repeats:  247 times in single request
Location: app/Http/Controllers/OrderController.php:18

Fix: Order::with('items', 'customer')-&amp;gt;get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hooks into &lt;code&gt;DB::listen&lt;/code&gt; — zero changes to your code&lt;/li&gt;
&lt;li&gt;Fingerprints each query (strips all literals, normalizes whitespace)&lt;/li&gt;
&lt;li&gt;Buffers per-request in memory — no DB write on every query&lt;/li&gt;
&lt;li&gt;Detects patterns in &lt;code&gt;terminating()&lt;/code&gt; hook&lt;/li&gt;
&lt;li&gt;Stores only issues and aggregates, never raw query values&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Overhead:&lt;/strong&gt; listener adds less than 0.05ms per query in recording mode. EXPLAIN and schema inspection run only on-demand via artisan commands, never automatically in production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Privacy
&lt;/h3&gt;

&lt;p&gt;The fingerprinter strips all literals before anything is stored or sent. This is verified by a dedicated CI test that asserts no raw values pass through. Only normalized templates like &lt;code&gt;select * from orders where user_id = ?&lt;/code&gt; are ever stored.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require cardinal/laravel
php artisan migrate
php artisan cardinal:report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Supports Laravel 10, 11, 12, 13 and PHP 8.2+.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Free?
&lt;/h2&gt;

&lt;p&gt;The free package is complete and useful forever. You get continuous monitoring, AI analysis with your own key, and generated migrations. No account required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cardinal Cloud&lt;/strong&gt; (paid, waitlist open) will add production history, deploy-to-regression tracking, and team alerts — starting at $19/month.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/wilfridterry/cardinal" rel="noopener noreferrer"&gt;https://github.com/wilfridterry/cardinal&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Packagist:&lt;/strong&gt; &lt;a href="https://packagist.org/packages/cardinal/laravel" rel="noopener noreferrer"&gt;https://packagist.org/packages/cardinal/laravel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open an issue if something doesn't work. Feedback directly shapes what gets built next.&lt;/p&gt;

&lt;h1&gt;
  
  
  laravel #php #database #performance #opensource
&lt;/h1&gt;

</description>
      <category>database</category>
      <category>laravel</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
