<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Anass Ez-zouaine | Backend, AI &amp; Shopify Engineer | DevOps</title><description>DevOps posts from Anass Ez-zouaine | Backend, AI &amp; Shopify Engineer.</description><link>https://ansezz.com/</link><item><title>PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35: update your Laravel servers today</title><link>https://ansezz.com/blog/php-security-release-oct-2026/</link><guid isPermaLink="true">https://ansezz.com/blog/php-security-release-oct-2026/</guid><description>PHP shipped fixes for two critical remote code execution bugs on 21 October 2026. Here is what is affected, what the interim settings do, and how to rebuild and redeploy a Laravel app in Docker.</description><pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On 21 October 2026 the PHP project posted a &lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;security advisory&lt;/a&gt; for two critical bugs. If you run a Laravel app on PHP, in Docker or on a plain server, this post is for you.&lt;/p&gt;

- PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two critical bugs that can allow unauthenticated remote code execution ([php.net](https://www.php.net/archive/2026.php#2026-10-21-5)).
- Both are scored 9.2 under CVSS v4 ([NVD CVE-2026-109618](https://nvd.nist.gov/vuln/detail/CVE-2026-109618), [NVD CVE-2026-109619](https://nvd.nist.gov/vuln/detail/CVE-2026-109619)).
- Any PHP serving web requests is at risk. The PHP team rates mod_php as the riskiest setup.
- The settings changes below reduce exposure. Only the update fixes it.
- In Docker, restarting a container does nothing. Pull the new base image, rebuild, redeploy.

&lt;h2&gt;What was fixed&lt;/h2&gt;
&lt;p&gt;The advisory lists two bugs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CVE-2026-109618, RCE via out-of-memory corruption&lt;/strong&gt; (&lt;a href=&quot;https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w&quot;&gt;GHSA-w8hw-w9fx-j79w&lt;/a&gt;). When PHP runs out of memory, it can stop while internal request data is only partly set up. Request cleanup may then treat that bad data as valid (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CVE-2026-109619, RCE via stale global state&lt;/strong&gt; (&lt;a href=&quot;https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp&quot;&gt;GHSA-6wmf-4rv5-p3rp&lt;/a&gt;). Some internal state that belongs to one request can survive after its memory is freed. A later request in the same worker may use that stale state before it gets reset (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both GitHub advisories list affected versions as anything below 8.2.35, 8.3.36, 8.4.27 and 8.5.12, with a CVSS v4 vector of &lt;code&gt;AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H&lt;/code&gt; (&lt;a href=&quot;https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w&quot;&gt;GHSA-w8hw-w9fx-j79w&lt;/a&gt;, &lt;a href=&quot;https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp&quot;&gt;GHSA-6wmf-4rv5-p3rp&lt;/a&gt;). NVD shows a base score of 9.2 for each (&lt;a href=&quot;https://nvd.nist.gov/vuln/detail/CVE-2026-109618&quot;&gt;CVE-2026-109618&lt;/a&gt;, &lt;a href=&quot;https://nvd.nist.gov/vuln/detail/CVE-2026-109619&quot;&gt;CVE-2026-109619&lt;/a&gt;). The &lt;a href=&quot;https://www.php.net/ChangeLog-8.php#8.4.27&quot;&gt;ChangeLog&lt;/a&gt; entry for each release lists both advisories under Core.&lt;/p&gt;
&lt;h2&gt;Who is at risk&lt;/h2&gt;
&lt;p&gt;The advisory says: all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP team considers the risk highest for mod_php, where they demonstrated an exploit in which an unauthenticated request triggers the attack before any application code runs (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;So your Laravel middleware, auth and validation do not protect you here. The bug sits below your app.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Old versions: 8.1 and below&lt;/h2&gt;
&lt;p&gt;PHP 8.1 and older no longer get updates from the PHP project. Because of the severity, the security team published minimal source backports for &lt;a href=&quot;https://github.com/php/php-src/tree/PHP-7.4-CVE-2026-109618-109619&quot;&gt;PHP 7.4&lt;/a&gt;, &lt;a href=&quot;https://github.com/php/php-src/tree/PHP-8.0-CVE-2026-109618-109619&quot;&gt;PHP 8.0&lt;/a&gt; and &lt;a href=&quot;https://github.com/php/php-src/tree/PHP-8.1-CVE-2026-109618-109619&quot;&gt;PHP 8.1&lt;/a&gt; for people who build from source or have no LTS vendor. Linux distributions and LTS vendors got the patches in advance, so check your vendor for packages (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The advisory also says &lt;a href=&quot;http://rpms.remirepo.net&quot;&gt;rpms.remirepo.net&lt;/a&gt; will not have updates on the day of release, and asks users of that repo to switch to distribution packages or build from source (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/p&gt;
&lt;h2&gt;If you cannot update right now&lt;/h2&gt;
&lt;p&gt;The PHP team lists settings that reduce exposure to specific attack paths. They say plainly that these do not make an install safe (&lt;a href=&quot;https://www.php.net/archive/2026.php#2026-10-21-5&quot;&gt;php.net&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;For CVE-2026-109618 (out of memory):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;memory_limit=-1&lt;/code&gt; in a way the app cannot override, such as &lt;code&gt;php_admin_value&lt;/code&gt; in the FPM pool or Apache config. Check that no pool, directory or app setting puts a finite limit back. An allocation failure below PHP can still reach the bug.&lt;/li&gt;
&lt;li&gt;Set a low &lt;code&gt;post_max_size&lt;/code&gt;: &lt;code&gt;8M&lt;/code&gt; if you have no uploads, &lt;code&gt;32M&lt;/code&gt; if you do. Keep &lt;code&gt;upload_max_filesize&lt;/code&gt; below &lt;code&gt;post_max_size&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Consider limits at the web server or proxy for request size, field count, multipart parts, headers and nesting depth, including requests with no usable &lt;code&gt;Content-Length&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use a container or cgroup memory limit, ideally one that kills only the affected worker. Do not use &lt;code&gt;RLIMIT_AS&lt;/code&gt; or &lt;code&gt;RLIMIT_DATA&lt;/code&gt; instead, since those can cause the allocation failure.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For CVE-2026-109619 (stale state):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;session.upload_progress.enabled=0&lt;/code&gt; and restart every worker. Put it in &lt;code&gt;php.ini&lt;/code&gt;, the FPM pool or server config. &lt;code&gt;ini_set()&lt;/code&gt; and FPM &lt;code&gt;.user.ini&lt;/code&gt; do not work for this.&lt;/li&gt;
&lt;li&gt;On PHP 8.5, set &lt;code&gt;fatal_error_backtraces=0&lt;/code&gt; and restart every worker.&lt;/li&gt;
&lt;li&gt;Remove invalid or deprecated per request settings that emit diagnostics early. Hiding them with &lt;code&gt;error_reporting&lt;/code&gt;, &lt;code&gt;display_errors&lt;/code&gt; or &lt;code&gt;@&lt;/code&gt; does not help.&lt;/li&gt;
&lt;li&gt;Fix fatal errors and execution timeouts an attacker can reach, including in callbacks, upload or import handling, and cleanup.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An FPM pool example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; /usr/local/etc/php-fpm.d/zz-security.conf
[www]
php_admin_value[memory_limit] = -1
php_admin_value[post_max_size] = 32M
php_admin_value[upload_max_filesize] = 30M
php_admin_flag[session.upload_progress.enabled] = off
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Treat this as a stopgap for hours, not weeks.&lt;/p&gt;
&lt;h2&gt;Laravel and Docker: how to actually update&lt;/h2&gt;
&lt;h3&gt;1. Find the PHP version everywhere&lt;/h3&gt;
&lt;p&gt;On each server, and inside each running container:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;php -v
docker compose exec app php -v
docker exec &amp;lt;container&amp;gt; php -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check the web workers, not only the CLI. On a server with several PHP builds, &lt;code&gt;php -v&lt;/code&gt; may show a different binary than the one FPM runs. &lt;code&gt;php-fpm -v&lt;/code&gt; (or &lt;code&gt;php-fpm8.3 -v&lt;/code&gt; on Debian style installs) tells you what FPM uses.&lt;/p&gt;
&lt;p&gt;Then check the base image in every &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rg -n &quot;^FROM&quot; --glob &quot;Dockerfile*&quot; .
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You want a tag on or above the patched patch release, for example &lt;code&gt;php:8.3.36-fpm&lt;/code&gt; or &lt;code&gt;php:8.4.27-fpm&lt;/code&gt;. A floating tag like &lt;code&gt;php:8.3-fpm&lt;/code&gt; only helps if you pull it again after the new image is published. A fully pinned old tag like &lt;code&gt;php:8.3.30-fpm&lt;/code&gt; will never update by itself. Check the &lt;a href=&quot;https://hub.docker.com/_/php/tags&quot;&gt;official image tags&lt;/a&gt; before you build.&lt;/p&gt;
&lt;p&gt;If your image installs PHP from distro packages (for example &lt;code&gt;apt-get install php8.3-fpm&lt;/code&gt;), you depend on your distro shipping the fix.&lt;/p&gt;
&lt;h3&gt;2. Pull and rebuild. A restart does not help&lt;/h3&gt;
&lt;p&gt;A container restart runs the same image with the same PHP binary. You need a new image:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker compose build --pull --no-cache app
docker compose up -d app
docker compose exec app php -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;--pull&lt;/code&gt; makes Docker fetch the newest base image for your tag. &lt;code&gt;--no-cache&lt;/code&gt; stops it from reusing an old layer. Do the same for queue workers, Horizon, the scheduler and any Octane container, since they often use their own image or service.&lt;/p&gt;
&lt;h3&gt;3. Redeploy on Coolify&lt;/h3&gt;
&lt;p&gt;If you deploy with Coolify:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Update the &lt;code&gt;FROM&lt;/code&gt; line in your &lt;code&gt;Dockerfile&lt;/code&gt; if it pins an old patch version, and commit it.&lt;/li&gt;
&lt;li&gt;Open the application and redeploy. If Coolify builds from your repo, use the force rebuild option without build cache so it does not reuse old layers. If Coolify pulls a prebuilt image from a registry, rebuild and push that image in CI first, then redeploy.&lt;/li&gt;
&lt;li&gt;After the deploy, open the terminal for the container in Coolify and run &lt;code&gt;php -v&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure&gt;
&lt;h3&gt;4. Confirm&lt;/h3&gt;
&lt;p&gt;For each environment, write down the PHP version shown by &lt;code&gt;php -v&lt;/code&gt; in the web container and the worker containers. Every one should read 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later, or a vendor build that lists both CVEs as fixed.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;Two critical bugs, both fixed in the 21 October releases. The interim settings help a little. Updating is the only safe choice: find your versions, pull the new base image, rebuild, redeploy, and check &lt;code&gt;php -v&lt;/code&gt; again.&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>security</category><category>laravel</category><category>docker</category><category>coolify</category><category>deployment</category></item><item><title>Coolify in 2026: 60k GitHub stars and the self-hosted PaaS bet</title><link>https://ansezz.com/blog/coolify-2026-self-hosted-paas/</link><guid isPermaLink="true">https://ansezz.com/blog/coolify-2026-self-hosted-paas/</guid><description>Coolify crossed 60k GitHub stars. What that buys you, how it really compares to Dokploy, CapRover and Dokku, and the firewall claim to ignore.</description><pubDate>Mon, 03 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Scaling a web app used to mean signing a blank check. Coolify is why it doesn&apos;t have to anymore.&lt;/p&gt;

- Coolify gives you a Heroku-style workflow on your own servers, built on plain Docker.
- Dokploy is now a real competitor. Coolify&apos;s edge is time in production, not catalog size.
- Coolify does not manage your firewall. Docker bypasses UFW, so filter at your provider instead.

&lt;p&gt;You start on the free tier, traffic spikes, and suddenly the bill has a comma in it.&lt;/p&gt;
&lt;p&gt;The alternative (a raw VPS, SSH, and a prayer) costs you the weekend instead of the money. Nginx vhosts, certbot renewals that silently fail, a deploy script nobody wants to touch.&lt;/p&gt;
&lt;p&gt;That gap is the whole reason Coolify exists, and it&apos;s why the project has quietly turned into the default answer for &quot;I want Heroku, but on my server.&quot;&lt;/p&gt;
&lt;p&gt;As of today the repo sits at &lt;strong&gt;60,298 GitHub stars&lt;/strong&gt; and ships hundreds of one-click services. Version 4 has been the stable line for a while now.&lt;/p&gt;
&lt;p&gt;It is no longer a hobby project you&apos;re brave for running. It&apos;s infrastructure with a bus factor above one.&lt;/p&gt;
&lt;p&gt;I run production workloads on it. This post is what I&apos;d tell you over coffee: what the numbers mean, where Coolify genuinely wins, and which of its marketing-adjacent claims you should quietly ignore.&lt;/p&gt;
&lt;h2&gt;What 60k stars actually signals&lt;/h2&gt;
&lt;p&gt;Stars are a vanity metric right up until they aren&apos;t. What the curve tells you here is not &quot;Coolify is good software.&quot; It&apos;s that a critical mass of developers decided &lt;strong&gt;sovereign infrastructure&lt;/strong&gt; was worth the tradeoff.&lt;/p&gt;
&lt;p&gt;The reasoning is boring and correct. A managed PaaS owns your build pipeline, your runtime, your egress pricing, and your migration path. When any one of those changes, you refactor on their timeline.&lt;/p&gt;
&lt;p&gt;Heroku killing free dynos taught a generation of developers that &quot;managed&quot; means &quot;someone else decides.&quot;&lt;/p&gt;
&lt;p&gt;Self-hosting used to mean giving up the good parts: git-push deploys, automatic TLS, a dashboard your teammate can read. Coolify&apos;s actual contribution is that it kept those and dropped the rent.&lt;/p&gt;
&lt;p&gt;Practically, a mature project means the things that bite you at 2am are handled by someone other than you: proxy config, certificate renewal, container lifecycle, backup scheduling. That&apos;s the product.&lt;/p&gt;
&lt;h2&gt;Docker containerization is the whole engine&lt;/h2&gt;
&lt;p&gt;Underneath the dashboard, Coolify is an orchestrator for Docker. Every app, database, and service you deploy is a container. Your local environment and your production server run the same image, which is the entire point.&lt;/p&gt;
&lt;figure&gt;
&lt;p&gt;When you push to your repo, Coolify pulls the code, builds an image, and starts the replacement container.&lt;/p&gt;
&lt;p&gt;Build sources are flexible: a Dockerfile if you have one, a &lt;code&gt;docker-compose.yaml&lt;/code&gt; for multi-service stacks, static output for a plain frontend, or &lt;strong&gt;Nixpacks&lt;/strong&gt; when you want zero config and can live with its opinions.&lt;/p&gt;
&lt;p&gt;What containerization buys you here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Isolation.&lt;/strong&gt; One app OOM-ing doesn&apos;t take the box down with it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portability.&lt;/strong&gt; Moving from the cheapest droplet your provider sells to a dedicated Hetzner box is a server swap, not a migration project.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resource control.&lt;/strong&gt; Per-container CPU and memory limits, set in the UI, enforced by Docker.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reproducibility.&lt;/strong&gt; The image that passed staging is the image that runs in production.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Where Kubernetes starts to make sense&lt;/h3&gt;
&lt;p&gt;If you&apos;re weighing this against a full orchestrator, my breakdown of &lt;a href=&quot;https://ansezz.com/blog/docker-vs-kubernetes/&quot;&gt;Docker vs Kubernetes&lt;/a&gt; covers where the line actually sits, and it&apos;s further out than most teams assume.&lt;/p&gt;
&lt;p&gt;Kubernetes earns its complexity somewhere north of &quot;a dozen services and a platform team.&quot; Below that, Coolify&apos;s model is strictly less work for the same outcome.&lt;/p&gt;
&lt;p&gt;For the ground-floor version of this setup, I wrote it up in &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify and Docker for SaaS hosting&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;What the one-click service catalog actually contains&lt;/h2&gt;
&lt;p&gt;This is the part people underrate. The service catalog is not a gimmick. It&apos;s the difference between &quot;I&apos;ll set up Plausible this weekend&quot; and &quot;Plausible is running, next task.&quot;&lt;/p&gt;
&lt;p&gt;Worth splitting into two things that get conflated.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Databases are first-class resources&lt;/strong&gt;, not templates. There are eight of them: PostgreSQL, MySQL, MariaDB, MongoDB, Redis, DragonFly, KeyDB, and ClickHouse. They get their own connection UI, their own lifecycle, and (for the SQL and document stores) their own backup scheduling.&lt;/p&gt;
&lt;p&gt;Everything else is a compose template, and that&apos;s where the breadth lives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dev tools&lt;/strong&gt;: Gitea, Hoppscotch, n8n, Uptime Kuma.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Analytics&lt;/strong&gt;: Plausible, Umami, PostHog.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CMS and app platforms&lt;/strong&gt;: Ghost, Strapi, Directus, WordPress, Appwrite, Supabase.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI infrastructure&lt;/strong&gt;: Qdrant and other vector stores for RAG workloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each template ships with sane defaults, networking, volume mounts, and generated secrets. You get a running service and a URL.&lt;/p&gt;
&lt;h3&gt;Catalog size is not a moat&lt;/h3&gt;
&lt;p&gt;The &quot;280+&quot; figure is Coolify&apos;s own tagline and it undersells the current state: the repo&apos;s &lt;code&gt;templates/compose&lt;/code&gt; directory holds 362 of them today.&lt;/p&gt;
&lt;p&gt;Worth knowing, though, that catalog size is no longer a moat. Dokploy ships 514 blueprints and CapRover has 354 one-click apps. Everyone in this space has enough templates.&lt;/p&gt;
&lt;p&gt;Two caveats worth stating plainly. First, a one-click template is a &lt;em&gt;starting point&lt;/em&gt;. It is not tuned for your load, and the defaults are chosen to boot cleanly, not to survive traffic.&lt;/p&gt;
&lt;p&gt;Second, templates are community-maintained; pin your image tags rather than riding &lt;code&gt;latest&lt;/code&gt; into a breaking upgrade.&lt;/p&gt;

Open every Coolify service you run and replace any `latest` image tag with a pinned version.

&lt;h2&gt;Coolify vs the alternatives, on real numbers&lt;/h2&gt;
&lt;p&gt;The self-hosted PaaS space stopped being a one-horse race. Here&apos;s where the four main projects actually stand today:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Coolify&lt;/th&gt;
&lt;th&gt;Dokploy&lt;/th&gt;
&lt;th&gt;CapRover&lt;/th&gt;
&lt;th&gt;Dokku&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Interface&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Web dashboard&lt;/td&gt;
&lt;td&gt;Web dashboard&lt;/td&gt;
&lt;td&gt;Web UI&lt;/td&gt;
&lt;td&gt;CLI-first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multi-server&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Native + Swarm&lt;/td&gt;
&lt;td&gt;Native + Swarm&lt;/td&gt;
&lt;td&gt;Docker Swarm&lt;/td&gt;
&lt;td&gt;Via plugins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Service catalog&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;362 templates&lt;/td&gt;
&lt;td&gt;514 blueprints&lt;/td&gt;
&lt;td&gt;354 one-click apps&lt;/td&gt;
&lt;td&gt;Plugin-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Build sources&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dockerfile / Compose / Nixpacks / static&lt;/td&gt;
&lt;td&gt;Dockerfile / Compose / Nixpacks / Railpack / Heroku + Paketo buildpacks&lt;/td&gt;
&lt;td&gt;Dockerfile / captain-definition&lt;/td&gt;
&lt;td&gt;Herokuish buildpacks / Dockerfile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backups&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;S3-compatible, scheduled&lt;/td&gt;
&lt;td&gt;S3-compatible&lt;/td&gt;
&lt;td&gt;Manual / scripted&lt;/td&gt;
&lt;td&gt;Plugin-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub stars&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;60.3k&lt;/td&gt;
&lt;td&gt;36.5k&lt;/td&gt;
&lt;td&gt;15.1k&lt;/td&gt;
&lt;td&gt;32.1k&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A few honest reads on that table.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dokploy&lt;/strong&gt; is the real competitor now, not a footnote. It has 36k stars and is climbing fast, with a template catalog that has quietly grown &lt;em&gt;larger&lt;/em&gt; than Coolify&apos;s and a wider set of build sources (Railpack and Paketo on top of the usual Nixpacks and Dockerfile).&lt;/p&gt;
&lt;p&gt;It&apos;s leaner and the UI is arguably cleaner. If you&apos;re starting fresh in 2026 it deserves a genuine evaluation rather than a dismissal. Coolify&apos;s remaining edge is time in production: more people have hit more edge cases, and those fixes are already merged.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dokku&lt;/strong&gt; has the smallest resource footprint of the four and the most Unix-native design. If you&apos;re comfortable in a terminal and want something that will still work identically in five years, it&apos;s a defensible choice. The CLI-first model is a real barrier for teams where not everyone deploys.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CapRover&lt;/strong&gt; is the oldest of the four and still actively maintained; it committed as recently as this week. It&apos;s Swarm-native by design, which is a genuine advantage if clustering is your starting requirement rather than an afterthought. Its ceiling is the smaller community: fewer people hitting problems means fewer problems already solved for you.&lt;/p&gt;
&lt;h2&gt;What multi-server actually means&lt;/h2&gt;
&lt;p&gt;Coolify supports three topologies: a single server, multiple standalone servers managed from one dashboard, and Docker Swarm clusters.&lt;/p&gt;
&lt;p&gt;The middle one is what most teams want, and it&apos;s worth being precise about what it is. Adding a second server means Coolify SSHes into it and manages Docker there. Each server runs its own containers and its own proxy.&lt;/p&gt;
&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; a cluster. There&apos;s no automatic failover, no scheduler moving workloads between nodes. If a server dies, the apps on it are down until you redeploy elsewhere.&lt;/p&gt;
&lt;p&gt;That&apos;s a feature, not a gap. It&apos;s the model that fits the 95% case: put the database on a high-memory box, the app on a high-CPU box, and keep the Coolify instance itself on a small separate server so a runaway build can&apos;t take down your control plane.&lt;/p&gt;
&lt;p&gt;If you need true clustering, that&apos;s what the Swarm mode is for. If you need more than Swarm, you&apos;re in Kubernetes territory.&lt;/p&gt;
&lt;p&gt;I go deeper on the topology decisions, dedicated build servers, and zero-downtime rollouts in &lt;a href=&quot;https://ansezz.com/blog/scaling-with-coolify/&quot;&gt;scaling SaaS with Coolify&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Security: what&apos;s real and what isn&apos;t&lt;/h2&gt;
&lt;p&gt;This is where I&apos;ll break with the usual Coolify writeup, because there&apos;s a claim floating around that Coolify handles your firewall for you. It does not, and believing it will hurt you.&lt;/p&gt;
&lt;p&gt;Here&apos;s what Coolify actually gives you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automatic TLS.&lt;/strong&gt; Let&apos;s Encrypt issuance and renewal for custom domains, handled by the bundled proxy: Traefik by default, Caddy still marked experimental.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encrypted secrets.&lt;/strong&gt; Environment variable values are stored with Laravel&apos;s &lt;code&gt;encrypted&lt;/code&gt; cast, so they&apos;re not sitting in the database as plaintext. That cast uses Laravel&apos;s standard encrypted payload, the same format my &lt;a href=&quot;https://ansezz.com/tools/laravel-encrypt-decrypt/&quot;&gt;Laravel decrypt tool&lt;/a&gt; reads with an APP_KEY. Scopes go per-resource, with shared variables at the environment, project, and team level, and separate build-time and runtime visibility.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team roles.&lt;/strong&gt; &lt;code&gt;owner&lt;/code&gt;, &lt;code&gt;admin&lt;/code&gt;, and &lt;code&gt;member&lt;/code&gt; per team, so a contractor doesn&apos;t get production database access.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scheduled backups.&lt;/strong&gt; Postgres gets first-class scheduled dumps (Coolify backs up its own database the same way); MySQL, MariaDB, and MongoDB are covered too. Destination is local disk or any S3-compatible bucket. Backblaze B2 and Cloudflare R2 both work and cost almost nothing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Docker and UFW trap&lt;/h3&gt;
&lt;p&gt;Here&apos;s the part nobody says out loud:&lt;/p&gt;
&lt;p&gt;Docker publishes ports by writing NAT rules that bypass UFW.&lt;/p&gt;
&lt;p&gt;If you &lt;code&gt;ufw deny 5432&lt;/code&gt; and then map Postgres to the host, that port is open to the internet and &lt;code&gt;ufw status&lt;/code&gt; will happily tell you it&apos;s blocked. This is Docker behavior, not a Coolify bug, but the consequence lands on you either way.&lt;/p&gt;

  &lt;div&gt;`ufw deny 5432` is set, and `ufw status` says the port is blocked.&lt;/div&gt;
  &lt;div&gt;Docker&apos;s NAT rules route around UFW, and Postgres is open to the internet.&lt;/div&gt;

&lt;p&gt;The fix is to filter at a layer Docker can&apos;t route around:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use your provider&apos;s firewall.&lt;/strong&gt; Hetzner Cloud Firewall, DigitalOcean Cloud Firewall, AWS security groups: these sit outside the host, so Docker&apos;s iptables rules are irrelevant.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Don&apos;t publish database ports at all.&lt;/strong&gt; Databases should be reachable over the internal Docker network by container name. Coolify defaults to this; the risk is you enabling public access &quot;just for a migration&quot; and forgetting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Close the dashboard ports.&lt;/strong&gt; Coolify needs 8000, 6001, and 6002 during setup. Once you&apos;ve put the dashboard behind a domain and its own TLS, those can be closed. Leave 22, 80, and 443.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do those three and your self-hosted setup is meaningfully harder to reach than most managed deployments, because there&apos;s less surface exposed to begin with.&lt;/p&gt;

From a machine outside your network, scan your server&apos;s public IP for open database ports. If 5432 answers, fix it at the provider firewall today.

&lt;h2&gt;The actual argument: vendor independence&lt;/h2&gt;
&lt;p&gt;Strip away the features and the case for Coolify is one sentence: you stop renting your deployment pipeline.&lt;/p&gt;
&lt;figure&gt;
&lt;p&gt;The math is not subtle. Ten small projects on a managed platform (a few hobby-tier databases, some build minutes, a bit of bandwidth) lands somewhere around $150 to $250/month once you&apos;re past free tiers.&lt;/p&gt;
&lt;p&gt;The same ten projects fit on a single mid-tier VPS with 8 vCPU and 16 GB of RAM, with headroom to spare. On Hetzner that&apos;s a low-double-digit euro bill on the ARM line, roughly double on x86. Either way it&apos;s an order of magnitude, not a percentage.&lt;/p&gt;
&lt;h3&gt;The catch&lt;/h3&gt;
&lt;p&gt;You are now the on-call engineer. Kernel updates, disk space, a container that wedges at 3am: that&apos;s yours. Coolify reduces that work by maybe 90%, not 100%.&lt;/p&gt;
&lt;p&gt;For a solo developer or a small team, the trade is usually worth it. For a company where an hour of downtime costs more than a year of managed hosting, it isn&apos;t, and you should pay the tax.&lt;/p&gt;
&lt;p&gt;I made this exact switch and wrote up the numbers in &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;why I&apos;m ditching expensive cloud providers&lt;/a&gt;. The runway extension was the point; the control turned out to matter more.&lt;/p&gt;
&lt;h2&gt;How I&apos;d approach the migration&lt;/h2&gt;
&lt;p&gt;If you&apos;re considering the move, the order matters more than the tooling:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Price it honestly.&lt;/strong&gt; Add up your current managed spend including bandwidth and build minutes, then compare against a VPS with 2x the resources you think you need. If the gap isn&apos;t at least 3x, the operational burden probably isn&apos;t worth it. My &lt;a href=&quot;https://ansezz.com/tools/self-hosting-cost-calculator/&quot;&gt;self-hosting cost calculator&lt;/a&gt; does that sum and prices in your ops hours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start with something you can afford to break.&lt;/strong&gt; Staging environments, internal dashboards, side projects. Learn the failure modes on workloads where the blast radius is you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get containerized first.&lt;/strong&gt; If your app already builds from a Dockerfile, migration is an afternoon. If it doesn&apos;t, fix that &lt;em&gt;before&lt;/em&gt; you touch Coolify; you&apos;ll be debugging one thing instead of two.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wire up S3 backups on day one.&lt;/strong&gt; Before the first production workload lands. A single server with no offsite backup is a countdown, not an architecture.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Put the control plane on its own box.&lt;/strong&gt; Coolify&apos;s documented minimum is 2 cores, 2 GB of RAM, and 10 GB of free disk, which the cheapest tier most providers sell already covers. A dedicated instance means a runaway build can never take down the dashboard you&apos;d use to fix it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add external monitoring.&lt;/strong&gt; Coolify tells you a container is running. It does not tell you your users can check out. Uptime Kuma (one-click, naturally) or Better Stack closes that gap.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Coolify&apos;s real achievement is that it made the PaaS experience a commodity. The dashboard, the git integration, the automatic TLS: these were competitive moats five years ago.&lt;/p&gt;
&lt;p&gt;Now they&apos;re a &lt;code&gt;curl | bash&lt;/code&gt; away, and the only thing you&apos;re paying a managed provider for is not thinking about servers. That&apos;s a legitimate thing to pay for. It just isn&apos;t worth a 10x premium anymore.&lt;/p&gt;

- Coolify gives you a PaaS experience on servers you own, built on plain Docker.
- Compare it honestly with Dokploy, CapRover and Dokku. Catalog size no longer decides it.
- Multi-server is not a cluster. Use Swarm if you need real clustering.
- Filter ports at your provider&apos;s firewall, because Docker bypasses UFW.
- Price the move honestly, and remember you become the on-call engineer.

&lt;p&gt;What&apos;s still keeping you on managed hosting: the operational load, or the fear of being the one holding the pager? &lt;a href=&quot;https://ansezz.com/contact/&quot;&gt;Tell me&lt;/a&gt; which one it is.&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>coolify</category><category>self-hosting</category><category>devops</category><category>docker</category><category>deployment</category></item><item><title>Docker vs Kubernetes: containers vs orchestration</title><link>https://ansezz.com/blog/docker-vs-kubernetes/</link><guid isPermaLink="true">https://ansezz.com/blog/docker-vs-kubernetes/</guid><description>Docker packages your app into a portable box; Kubernetes manages a fleet of them across a cluster. How they differ and when you need orchestration.</description><pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Shipping software is hard.&lt;/p&gt;

- Docker packages your app into a portable image and runs containers on one host.
- Kubernetes orchestrates many containers across a cluster: scheduling, scaling, self-healing and rolling deploys.
- Small teams can stay on Docker or Coolify. Reach for Kubernetes when availability and scale demand it.

&lt;p&gt;You build an app that works perfectly on your machine, but the moment it hits production, everything breaks.&lt;/p&gt;
&lt;p&gt;This &quot;it works on my machine&quot; syndrome is exactly why understanding the difference between Docker vs Kubernetes is essential for modern engineers.&lt;/p&gt;
&lt;p&gt;Environment inconsistencies create friction, delay releases, and lead to late-night debugging sessions that could have been avoided with the right tooling.&lt;/p&gt;
&lt;p&gt;The gap between local development and production scale is wide. One tool packages your application into a portable box; the other manages a fleet of those boxes across a cluster of servers.&lt;/p&gt;
&lt;p&gt;If you are shipping modern web or e-commerce applications, you eventually need both, and knowing where each one stops saves you a lot of wasted effort.&lt;/p&gt;
&lt;h2&gt;The container revolution with Docker&lt;/h2&gt;
&lt;p&gt;Docker changed how we think about software delivery by introducing the concept of containerization.&lt;/p&gt;
&lt;p&gt;A container is a lightweight, standalone package that includes everything needed to run an application. This includes the code, runtime, system tools, libraries, and settings.&lt;/p&gt;
&lt;p&gt;When you use Docker, you are essentially creating an immutable image of your software. This image behaves exactly the same whether it is running on your laptop, a colleague&apos;s machine, or a staging server.&lt;/p&gt;
&lt;p&gt;It eliminates the need to manually configure environments, which is a major win for developer productivity.&lt;/p&gt;
&lt;h3&gt;One host at a time&lt;/h3&gt;
&lt;p&gt;Docker operates on a single-host level. It manages the lifecycle of individual containers. You use the Docker CLI to build, run, and stop these containers.&lt;/p&gt;
&lt;p&gt;For many small-scale projects or early-stage startups, Docker on a single VPS is often enough. In fact, tools like &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify for Docker SaaS hosting&lt;/a&gt; have made it easy to manage these deployments without needing a massive orchestration layer.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Understanding Kubernetes orchestration&lt;/h2&gt;
&lt;p&gt;If Docker is about the container, Kubernetes is about the cluster. Kubernetes, often abbreviated as K8s, is an open-source platform designed to automate the deployment, scaling, and management of containerized applications.&lt;/p&gt;
&lt;p&gt;It does not compete with Docker. Docker builds the image; Kubernetes schedules and runs it at scale through whatever container runtime sits on each node.&lt;/p&gt;
&lt;p&gt;Imagine you have a high-traffic Shopify app that suddenly experiences a surge in users. Managing fifty individual Docker containers across five different servers manually would be a nightmare.&lt;/p&gt;
&lt;p&gt;You would have to track which server has space, handle load balancing, and manually restart any container that crashes.&lt;/p&gt;
&lt;h3&gt;Desired state&lt;/h3&gt;
&lt;p&gt;Kubernetes handles this automatically. It uses a declarative approach where you define the &quot;desired state&quot; of your system in YAML files.&lt;/p&gt;
&lt;p&gt;The Kubernetes control plane then keeps the actual state matching what you declared. If a container dies, Kubernetes restarts it. If a node fails, it reschedules the work elsewhere.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Docker vs Kubernetes: key technical differences&lt;/h2&gt;
&lt;p&gt;Comparing Docker vs Kubernetes is not about choosing one over the other. They operate at different layers of the stack.&lt;/p&gt;
&lt;p&gt;Docker is the runtime that builds and runs the container. Kubernetes is the orchestration layer that schedules those containers across a network.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Docker&lt;/th&gt;
&lt;th&gt;Kubernetes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Containerizing an application&lt;/td&gt;
&lt;td&gt;Managing a cluster of containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scaling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Manual scaling on a single host&lt;/td&gt;
&lt;td&gt;Automated horizontal scaling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Self-healing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Restart policies, single host&lt;/td&gt;
&lt;td&gt;Probe-based restarts and rescheduling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Networking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Basic host-level networking&lt;/td&gt;
&lt;td&gt;Advanced cluster-wide networking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low to medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Docker focuses on the &quot;how&quot; of running an app. Kubernetes focuses on the &quot;where&quot; and &quot;how many&quot; of running those apps across a distributed system.&lt;/p&gt;
&lt;p&gt;If the unit of scheduling is new to you, it helps to understand the &lt;a href=&quot;https://ansezz.com/blog/container-vs-pod/&quot;&gt;difference between a container and a pod&lt;/a&gt; before you reach for orchestration.&lt;/p&gt;
&lt;h2&gt;How they work together in production&lt;/h2&gt;
&lt;p&gt;In a professional DevOps workflow, Docker and Kubernetes are teammates. The process usually starts with a Dockerfile.&lt;/p&gt;
&lt;p&gt;You build a Docker image and push it to a private container registry. This image is your &quot;source of truth&quot; for the application.&lt;/p&gt;
&lt;p&gt;Next, you create Kubernetes manifests. These files tell the cluster which image to use, how many replicas are needed, and what environment variables to inject.&lt;/p&gt;
&lt;p&gt;When you apply these manifests, the kubelet on each node calls the container runtime to pull the image and start the container.&lt;/p&gt;
&lt;h3&gt;The dockershim caveat&lt;/h3&gt;
&lt;p&gt;One caveat that trips people up: since version 1.24, Kubernetes removed dockershim, so it no longer talks to Docker Engine directly. Nodes now run a CRI-compliant runtime such as containerd or CRI-O.&lt;/p&gt;
&lt;p&gt;The image you built with Docker still runs fine because it follows the OCI image spec, but Docker Engine itself is no longer the thing executing it.&lt;/p&gt;
&lt;h3&gt;Rolling updates&lt;/h3&gt;
&lt;p&gt;Together, the two make updates smooth. You can perform rolling deployments where Kubernetes replaces old pods with new ones in a controlled rollout. This keeps the service available throughout.&lt;/p&gt;
&lt;p&gt;If the new version has a bug, Kubernetes stops the rollout when health checks fail, and one command (&lt;code&gt;kubectl rollout undo&lt;/code&gt;) takes you back to the previous stable image.&lt;/p&gt;

Run `kubectl get nodes -o wide` on your cluster and look at the CONTAINER-RUNTIME column. It will most likely say containerd, not Docker.

&lt;h2&gt;Choosing the right path for your project&lt;/h2&gt;
&lt;p&gt;Not every project needs the overhead of Kubernetes. If you are an entrepreneur or a small team building a simple web application, starting with Docker Compose or a &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;self-hosted SaaS platform&lt;/a&gt; might be more efficient.&lt;/p&gt;
&lt;p&gt;It allows you to ship fast without managing a complex cluster.&lt;/p&gt;
&lt;p&gt;However, if your business requires high availability, handles massive amounts of data, or uses a microservices architecture, Kubernetes is the industry standard.&lt;/p&gt;
&lt;p&gt;It provides the &lt;a href=&quot;https://ansezz.com/blog/horizontal-vs-vertical-scaling/&quot;&gt;horizontal scaling&lt;/a&gt; needed to grow from a few hundred users to millions without changing your core infrastructure.&lt;/p&gt;
&lt;h3&gt;Shopify at scale&lt;/h3&gt;
&lt;p&gt;Shopify itself is a good example of the payoff: its platform runs on Kubernetes across hundreds of clusters on Google Kubernetes Engine, autoscaling stateless workloads to absorb the brutal traffic spikes of Black Friday and Cyber Monday.&lt;/p&gt;
&lt;p&gt;Most merchants never touch that layer because Shopify owns it. But if you are building custom apps or your own infrastructure at that scale, the ability to declare capacity and let the cluster reconcile it is the competitive advantage that outweighs the setup complexity.&lt;/p&gt;

  &lt;div&gt;Small team, simple web app, ship fast with Docker Compose or Coolify. You restart and scale by hand.&lt;/div&gt;
  &lt;div&gt;High availability, big data, microservices. The cluster schedules, scales and heals from the desired state you declare.&lt;/div&gt;


Write down how many servers and containers you run today and how often one fails. If the answer is &quot;one server, rarely,&quot; Kubernetes can wait.


- **Docker** is for creating, packaging, and running individual containers on a host.
- **Kubernetes** is for orchestrating and managing fleets of containers across a cluster of servers.
- **Synergy**: You use Docker to build the images and Kubernetes to deploy and scale them.
- **Scale matters**: Small projects should stick to Docker to avoid unnecessary complexity. Enterprise-grade apps require Kubernetes for self-healing and autoscaling.
- **Declarative power**: Kubernetes uses YAML to maintain a desired state, making infrastructure management more predictable.

&lt;p&gt;If you&apos;re weighing that jump right now, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams get the call right&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At what stage of growth did your infrastructure move from a single server to a distributed cluster?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>docker</category><category>kubernetes</category><category>devops</category><category>scaling</category></item><item><title>Forward proxy vs reverse proxy: the technical guide</title><link>https://ansezz.com/blog/forward-proxy-vs-reverse-proxy/</link><guid isPermaLink="true">https://ansezz.com/blog/forward-proxy-vs-reverse-proxy/</guid><description>A forward proxy hides the client; a reverse proxy hides the server. How traffic direction shapes your load balancing, SSL termination, and security design.</description><pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Most developers interact with proxies every single day without realizing which direction the traffic is actually flowing.&lt;/p&gt;

- A forward proxy speaks for the client and hides its IP. It handles outbound traffic, filtering and anonymity.
- A reverse proxy speaks for the server and hides the backend. It handles load balancing, SSL termination, WAF and caching.
- In Docker and Laravel setups, Nginx as a reverse proxy with the right forwarded headers is the pattern you will touch most.

&lt;p&gt;The choice between a forward proxy vs reverse proxy comes down to one question: whose side is the middleman on?&lt;/p&gt;
&lt;p&gt;You set up Nginx for a Laravel app, and it works. You route outbound traffic through a corporate proxy, and it works.&lt;/p&gt;
&lt;p&gt;But when the site goes down under heavy load or your IP gets blacklisted, that distinction becomes the difference between a quick fix and hours of infrastructure debt.&lt;/p&gt;
&lt;p&gt;In modern web architecture, a proxy is essentially a &quot;middleman&quot; server. It sits between two parties to facilitate communication.&lt;/p&gt;
&lt;p&gt;However, the side it represents determines its name, its function, and its security benefits. This guide breaks down the core technical differences to help you choose the right pattern for your next deployment.&lt;/p&gt;
&lt;h2&gt;The forward proxy: protecting the client&lt;/h2&gt;
&lt;p&gt;A forward proxy sits in front of one or more client machines and acts as their representative to the open internet.&lt;/p&gt;
&lt;p&gt;When a user makes a request to a website, the request first hits the forward proxy. The proxy then evaluates the request, sends it to the web server, and passes the response back to the user.&lt;/p&gt;
&lt;p&gt;From the perspective of the internet, the forward proxy is the one making the request. The original client&apos;s IP address remains hidden behind the proxy&apos;s IP. This is a common setup in corporate environments or for users seeking anonymity.&lt;/p&gt;
&lt;figure&gt;
&lt;h3&gt;Why use a forward proxy?&lt;/h3&gt;
&lt;p&gt;Forward proxies are primarily used to manage and secure outbound traffic. Here are the most common engineering use cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Anonymity and privacy&lt;/strong&gt;: By masking the client IP, forward proxies prevent websites from tracking individual users based on their network location.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content filtering&lt;/strong&gt;: Organizations use forward proxies to block access to specific URLs or categories of websites. If a request violates a security policy, the proxy simply drops it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bypassing geo-restrictions&lt;/strong&gt;: If you need to access a service only available in another region, a forward proxy located in that region can make your request appear local.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching for performance&lt;/strong&gt;: If multiple clients in the same network request the same external resource, the forward proxy can cache that response locally. This saves bandwidth and reduces latency for subsequent requests.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The reverse proxy: protecting the server&lt;/h2&gt;
&lt;p&gt;While a forward proxy represents the client, a reverse proxy represents the server. It sits at the edge of your infrastructure and intercepts all incoming requests from the internet before they reach your backend application.&lt;/p&gt;
&lt;p&gt;The client believes they are communicating directly with the origin server. In reality, they are talking to the reverse proxy. The proxy then decides which backend server should handle the request.&lt;/p&gt;
&lt;p&gt;This architecture is a cornerstone of &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;modern cloud infrastructure&lt;/a&gt; and high-availability systems.&lt;/p&gt;
&lt;figure&gt;
&lt;h3&gt;Why use a reverse proxy?&lt;/h3&gt;
&lt;p&gt;Reverse proxies are essential for scaling and securing web applications. They handle several &quot;heavy lifting&quot; tasks that your application code shouldn&apos;t have to manage.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Load balancing&lt;/strong&gt;: This is the most common use case. A reverse proxy like Nginx or HAProxy distributes incoming traffic across multiple app nodes so no single server becomes a bottleneck. The overlap here is real enough that it&apos;s worth reading &lt;a href=&quot;https://ansezz.com/blog/load-balancer-vs-reverse-proxy/&quot;&gt;load balancer vs reverse proxy&lt;/a&gt; to see where the two roles diverge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSL termination&lt;/strong&gt;: Managing TLS certificates on every backend server is a nightmare. A reverse proxy decrypts incoming HTTPS at the edge and forwards plain HTTP across a trusted internal network. If compliance demands end-to-end encryption, you re-encrypt to the backend with &lt;code&gt;proxy_pass https://&lt;/code&gt; and &lt;code&gt;proxy_ssl_verify on&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security and WAF&lt;/strong&gt;: Reverse proxies hide the existence and characteristics of your backend servers. You can run a Web Application Firewall (WAF) at the proxy level to filter SQL injection and XSS before they ever hit your code, and absorb volumetric DDoS traffic at the edge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching&lt;/strong&gt;: By caching static assets or even entire HTML responses, a reverse proxy serves requests without touching the database or the application server. Push that cache out to the network edge and you are effectively running a &lt;a href=&quot;https://ansezz.com/blog/cdn-vs-cache/&quot;&gt;CDN, which is why high-traffic sites need both&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Forward proxy vs reverse proxy: visibility and flow&lt;/h2&gt;
&lt;p&gt;The easiest way to remember the difference is to look at who is being &quot;hidden&quot; from whom.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Forward Proxy&lt;/th&gt;
&lt;th&gt;Reverse Proxy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Who it protects&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The client&lt;/td&gt;
&lt;td&gt;The server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IP hiding&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Hides client IP from server&lt;/td&gt;
&lt;td&gt;Hides server IP from client&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Placement&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Internal network (client-side)&lt;/td&gt;
&lt;td&gt;Edge of the network (server-side)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Privacy, filtering, egress control&lt;/td&gt;
&lt;td&gt;Load balancing, security, performance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Example tool&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Squid, Privoxy&lt;/td&gt;
&lt;td&gt;Nginx, HAProxy, Cloudflare&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In a forward proxy setup, the origin server has no idea who the actual client is. In a reverse proxy setup, the client has no idea which backend server actually processed their request.&lt;/p&gt;
&lt;p&gt;Both are essential for &lt;a href=&quot;https://ansezz.com/blog/category/architecture/&quot;&gt;clean architecture&lt;/a&gt; but solve entirely different problems.&lt;/p&gt;
&lt;h2&gt;Engineering implementations: Nginx and Docker&lt;/h2&gt;
&lt;p&gt;When building modern web applications, you are most likely to interact with reverse proxies. If you are using a tool like &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify or Docker&lt;/a&gt;, the reverse proxy is often the component that manages your containers.&lt;/p&gt;
&lt;p&gt;For instance, an Nginx reverse proxy configuration for a Laravel application might look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;server {
    listen 80;
    server_name myapp.com;

    location / {
        proxy_pass http://app_container:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this setup, Nginx acts as the reverse proxy. It receives the request from the user and forwards it to the &lt;code&gt;app_container&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It also passes along the &lt;code&gt;X-Forwarded-For&lt;/code&gt; header so your application can still know the original user&apos;s IP address if needed.&lt;/p&gt;
&lt;p&gt;This is a critical pattern when building an &lt;a href=&quot;https://ansezz.com/blog/api-gateway-ai-stack/&quot;&gt;API gateway for an AI stack&lt;/a&gt; or managing Shopify app extensions.&lt;/p&gt;

Log `$request-&amp;gt;ip()` in your Laravel app behind the proxy. If it shows the proxy&apos;s address instead of the user&apos;s, your forwarded headers or trusted proxies need fixing.

&lt;h2&gt;Advanced use cases: the mesh approach&lt;/h2&gt;
&lt;p&gt;In complex microservices environments, the lines blur. Service meshes like Istio and Linkerd typically deploy a &quot;sidecar&quot; proxy next to every service.&lt;/p&gt;
&lt;p&gt;Each sidecar acts as both a forward and a reverse proxy depending on whether the traffic is ingress (incoming) or egress (outgoing).&lt;/p&gt;
&lt;p&gt;This gives you fine-grained control over how services talk to each other. You can implement automatic retries, circuit breaking, and mutual TLS without writing a single line of application code.&lt;/p&gt;
&lt;p&gt;While this adds complexity, it provides the level of observability and reliability required for enterprise-grade systems.&lt;/p&gt;

- **Forward proxies protect the user.** Use them when you want to control how your internal network accesses the internet or to maintain user anonymity.
- **Reverse proxies protect the infrastructure.** Use them to scale your applications through load balancing, improve performance via caching, and secure your backend.
- **Direction matters.** A forward proxy handles outbound requests. A reverse proxy handles inbound requests.
- **Nginx is the industry standard.** It is the most common tool for implementing reverse proxies in [Laravel and Docker environments](/blog/category/laravel/).
- **Security is centralized.** Both types of proxies allow you to centralize security policies rather than implementing them on every individual device or server.

&lt;p&gt;Understanding which direction traffic flows is the first step toward building resilient systems.&lt;/p&gt;
&lt;p&gt;If you are managing a growing web application, you should focus on your reverse proxy configuration. It is one of the most useful tools you have for uptime and performance.&lt;/p&gt;
&lt;p&gt;Have you ever found yourself troubleshooting an &quot;IP mismatch&quot; error caused by a misconfigured proxy header?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>networking</category><category>devops</category><category>infrastructure</category><category>security</category><category>docker</category></item><item><title>DNS vs service discovery</title><link>https://ansezz.com/blog/dns-vs-service-discovery/</link><guid isPermaLink="true">https://ansezz.com/blog/dns-vs-service-discovery/</guid><description>DNS was built for servers that live for years; microservices live for minutes. Why service discovery beats stale DNS records for high-churn systems.</description><pubDate>Sun, 21 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;DNS was built for servers that live for years. Your containers live for minutes.&lt;/p&gt;

- DNS maps a name to an IP and leans on caching, so changes are slow to reach clients and it has no idea whether an instance is healthy.
- Service discovery keeps a live catalog of running instances, runs health checks and pushes changes to clients almost instantly.
- The best setup for most teams is hybrid: a dynamic registry (Kubernetes or Consul) that still answers plain DNS queries.

&lt;p&gt;You deploy a new version of your microservice and the old containers are killed instantly. You update your internal DNS records to point to the new IP addresses.&lt;/p&gt;
&lt;p&gt;However, for the next five minutes, your API gateway continues to send 40 percent of your traffic to the dead containers. Your logs fill with connection timeouts and your error rate spikes.&lt;/p&gt;
&lt;p&gt;This is the classic DNS staleness trap that plagues modern distributed systems.&lt;/p&gt;
&lt;p&gt;The problem lies in how we locate resources. In a modern cloud environment, servers might only live for minutes. Relying on static naming for high-churn infrastructure creates a gap between where your traffic goes and where your healthy services actually live.&lt;/p&gt;
&lt;p&gt;This article explores the technical differences between &lt;strong&gt;DNS vs service discovery&lt;/strong&gt;, why the distinction matters for your uptime, and how to choose the right strategy for your &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;DevOps architecture&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;DNS vs service discovery: the map and the radar&lt;/h2&gt;
&lt;p&gt;At its core, DNS is a distributed, hierarchical naming system. It acts like the Yellow Pages for the internet. You give it a hostname, and it returns an IP address.&lt;/p&gt;
&lt;p&gt;It is very efficient and available everywhere. Every programming language and operating system knows how to talk to it.&lt;/p&gt;
&lt;p&gt;Service discovery is a more specialized control plane. Instead of a static map, it acts like a live radar. It tracks the current state of every service instance in your cluster.&lt;/p&gt;
&lt;p&gt;DNS tells you where a service should be. Service discovery tells you where it is right now.&lt;/p&gt;
&lt;h3&gt;The service catalog&lt;/h3&gt;
&lt;p&gt;A service discovery system like Consul, or the internal registry in Kubernetes, maintains a &quot;service catalog.&quot; This catalog is a live database of every running instance.&lt;/p&gt;
&lt;p&gt;When a new container starts, it registers itself with the catalog. When it shuts down, it is removed. This happens in milliseconds, far faster than traditional DNS propagation.&lt;/p&gt;
&lt;figure&gt;

List the internal hostnames your services call each other by. For each one, write down what updates the record when an instance dies. If the answer is &quot;a person,&quot; you have a staleness risk.

&lt;h2&gt;The TTL problem and DNS caching&lt;/h2&gt;
&lt;p&gt;The biggest hurdle in using DNS for microservices is Time-To-Live (TTL). DNS relies on caching so that every request does not hammer the name servers.&lt;/p&gt;
&lt;p&gt;Your operating system caches the result. Your browser caches the result. Your &lt;a href=&quot;https://ansezz.com/blog/api-gateway-ai-stack/&quot;&gt;API gateway&lt;/a&gt; caches the result.&lt;/p&gt;
&lt;h3&gt;Low TTLs are not a fix&lt;/h3&gt;
&lt;p&gt;If you set a high TTL, your service changes are slow to propagate. If you set a very low TTL (like 0 or 1 second), you might overwhelm your DNS server with lookups.&lt;/p&gt;
&lt;p&gt;Even worse, some runtimes ignore the TTL entirely. The JVM, for example, caches a successful lookup for 30 seconds by default and forever when a security manager is set, so it can keep a stale IP until the process restarts.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;DNS&lt;/th&gt;
&lt;th&gt;Service Discovery&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Human-readable name to IP&lt;/td&gt;
&lt;td&gt;Dynamic instance tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Propagation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Slow (TTL dependent)&lt;/td&gt;
&lt;td&gt;Near-instant (Gossip/Streaming)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Metadata&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Very limited (TXT records)&lt;/td&gt;
&lt;td&gt;Rich (tags, version, region)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Client Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Native in all OS&lt;/td&gt;
&lt;td&gt;Often requires API/Agent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Health Awareness&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;None (Static)&lt;/td&gt;
&lt;td&gt;Active monitoring&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Push instead of wait&lt;/h3&gt;
&lt;p&gt;Service discovery solves this by moving away from deep caching. Clients or load balancers often keep a streaming connection to the registry.&lt;/p&gt;
&lt;p&gt;When a service instance moves, the registry pushes a notification to all subscribers. There is no waiting for a cache to expire. The system converges on the new state almost instantly.&lt;/p&gt;

Check the DNS cache settings of your runtime. On the JVM, look at `networkaddress.cache.ttl` in the `java.security` file and set it to a short value if your services resolve internal names.

&lt;h2&gt;Health awareness: the core difference&lt;/h2&gt;
&lt;p&gt;A standard DNS server does not know whether the IP addresses it returns are healthy. If a server rack loses power, the DNS record still points to those IPs.&lt;/p&gt;
&lt;p&gt;You have to update the record by hand or run a custom script to change it.&lt;/p&gt;

  &lt;div&gt;An instance dies. The record still points at it until someone or some script changes it, and caches keep the old answer even longer.&lt;/div&gt;
  &lt;div&gt;An instance fails its health check. The registry marks it unhealthy and stops returning it to clients.&lt;/div&gt;

&lt;h3&gt;Health checks as a first-class feature&lt;/h3&gt;
&lt;p&gt;Service discovery systems run active health checks on every registered instance. A check can be as simple as a TCP probe or as complex as a custom HTTP endpoint that checks database connectivity.&lt;/p&gt;
&lt;p&gt;If a health check fails, the instance is marked &quot;unhealthy&quot; in the registry. The discovery system then stops returning that IP address to clients.&lt;/p&gt;
&lt;p&gt;This gives you a level of self-healing that plain DNS cannot, and it pairs naturally with the signals you already collect through &lt;a href=&quot;https://ansezz.com/blog/logging-vs-monitoring/&quot;&gt;logging and monitoring&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;hosting a SaaS on Docker&lt;/a&gt;, automated health-aware routing is the difference between a minor blip and a major outage.&lt;/p&gt;
&lt;figure&gt;

Add a `/health` endpoint to one service that checks its own dependencies (database, cache), not just &quot;the process is up.&quot; Point your registry or load balancer at it.

&lt;h2&gt;Metadata and rich discovery&lt;/h2&gt;
&lt;p&gt;DNS is built to return one type of data: an IP address. You can use SRV records for port numbers or TXT records for strings, but the interface is clunky. It does not support complex queries.&lt;/p&gt;
&lt;p&gt;Service discovery allows metadata-driven routing. You can ask the registry for &quot;all healthy instances of the &apos;orders&apos; service running version 2.1 in the &apos;us-east-1&apos; region.&quot;&lt;/p&gt;
&lt;h3&gt;Deployment patterns it enables&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Canary Deployments&lt;/strong&gt;: Routing only 5 percent of traffic to a specific version tag.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blue/Green Deployments&lt;/strong&gt;: Swapping traffic between service sets by changing a metadata flag.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locality-Aware Routing&lt;/strong&gt;: Directing traffic to the instance physically closest to the requester to reduce latency.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This level of detail is essential for scaling complex systems where simple round-robin load balancing is not enough.&lt;/p&gt;
&lt;h2&gt;How modern orchestrators bridge the gap&lt;/h2&gt;
&lt;p&gt;In &lt;a href=&quot;https://ansezz.com/blog/docker-vs-kubernetes/&quot;&gt;Kubernetes&lt;/a&gt;, you still use DNS names to talk to services. You might call &lt;code&gt;http://order-service.default.svc.cluster.local&lt;/code&gt;. Does this mean Kubernetes just uses DNS?&lt;/p&gt;
&lt;p&gt;Not exactly. Kubernetes uses a hybrid approach. It runs CoreDNS, but CoreDNS is not backed by static zone files. It is plugged directly into the Kubernetes API.&lt;/p&gt;
&lt;h3&gt;CoreDNS watches the API&lt;/h3&gt;
&lt;p&gt;When a Pod starts or dies, the control plane updates the Service and EndpointSlice objects. CoreDNS watches those objects through the API and updates its answers in real time.&lt;/p&gt;
&lt;p&gt;For a normal ClusterIP Service, the name resolves to one stable virtual IP, and kube-proxy updates the routing behind it as Pods come and go. For a headless Service, the name resolves straight to the current Pod IPs.&lt;/p&gt;
&lt;p&gt;In this model, DNS is just the &quot;wire protocol.&quot; It is the interface your application uses because it is easy and standard. The backend is a fully dynamic service discovery engine.&lt;/p&gt;
&lt;p&gt;That gives you the simplicity of DNS and the speed of service discovery.&lt;/p&gt;

Run `kubectl get endpointslices -l kubernetes.io/service-name=` while you scale a Deployment up and down. Watch the addresses change without touching any DNS record.

&lt;h2&gt;Implementation strategies: when to use which?&lt;/h2&gt;
&lt;p&gt;Choosing between &lt;strong&gt;DNS vs service discovery&lt;/strong&gt; depends on your infrastructure scale and churn rate.&lt;/p&gt;
&lt;p&gt;If you run a monolithic application on a few virtual machines that rarely change, DNS is perfectly fine. You can manage your records with simple automation or even by hand. A dedicated discovery system would cost more than it gives back.&lt;/p&gt;
&lt;p&gt;If you use containers, serverless functions, or microservices, you need a dynamic solution. If your IPs change every time you deploy or scale, DNS will eventually break your traffic flow.&lt;/p&gt;
&lt;h3&gt;A DNS interface on a dynamic registry&lt;/h3&gt;
&lt;p&gt;For many developers, the best path is a tool that provides a DNS interface on top of a dynamic registry. HashiCorp Consul is a popular choice for this.&lt;/p&gt;
&lt;p&gt;It lets you query the registry with a standard DNS lookup, while it handles the health checking and registration logic behind the scenes.&lt;/p&gt;

Count how often your instance IPs changed last week. A few times a month means DNS is fine. Several times a day means you want a registry.


1.  **DNS is for stability**: Use it for external traffic, long-lived resources, and cross-company communication where caching is an advantage.
2.  **Service Discovery is for churn**: Use it for internal microservices, containers, and autoscaling groups where instances appear and disappear frequently.
3.  **Mind the Cache**: Never rely on plain DNS for sub-minute failover because client-side caching will almost always outlive your records.
4.  **Health is Binary**: Without active health checks, your discovery system is just a list of guesses. Always integrate automated liveness and readiness probes.
5.  **Hybrid is Best**: Use a discovery engine (like Kubernetes or Consul) that exposes a DNS interface. This simplifies your application code while keeping your infrastructure dynamic.

&lt;p&gt;If you&apos;re untangling service routing for a high-churn stack, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams ship it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When was the last time a stale DNS record caused a production incident in your environment?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>networking</category><category>kubernetes</category><category>microservices</category><category>devops</category><category>infrastructure</category></item><item><title>Bandwidth vs throughput: a wider pipe won&apos;t fix lag</title><link>https://ansezz.com/blog/bandwidth-vs-throughput/</link><guid isPermaLink="true">https://ansezz.com/blog/bandwidth-vs-throughput/</guid><description>Bandwidth is capacity, throughput is delivery. Why a wider pipe never fixes a throughput bottleneck, and the latency and protocol levers that do.</description><pubDate>Sat, 20 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;You pay for a 1 Gbps fiber line, yet your API calls take 500ms and your backups crawl. You have a throughput problem, not a bandwidth problem.&lt;/p&gt;

- Bandwidth is the capacity of the link. Throughput is the data that actually arrives. Throughput is almost always lower.
- Latency caps throughput: every round trip your app waits on is time the pipe sits idle, no matter how wide it is.
- Smaller payloads, fewer round trips, reused connections and modern protocols raise throughput more than a bigger plan does.

&lt;p&gt;Most engineering teams mistake capacity for performance. They assume that widening the pipe automatically solves the lag.&lt;/p&gt;
&lt;p&gt;This misunderstanding leads to over-provisioned cloud bills and under-performing applications. You are throwing money at a bandwidth problem when you actually have a throughput bottleneck.&lt;/p&gt;
&lt;p&gt;Bandwidth vs throughput is the difference between a theoretical promise and a practical delivery. In high-performance web development and Shopify ecosystems, knowing which one limits you is what lets you scale without overpaying.&lt;/p&gt;
&lt;h2&gt;The capacity promise of bandwidth&lt;/h2&gt;
&lt;p&gt;Bandwidth is the maximum theoretical amount of data that can pass through a network path in a given time. Think of it as the number of lanes on a highway.&lt;/p&gt;
&lt;p&gt;A twelve-lane highway has massive bandwidth. You have the potential to move thousands of cars at once.&lt;/p&gt;
&lt;p&gt;In technical terms, bandwidth is a measure of capacity. It is usually expressed in bits per second (bps), Megabits per second (Mbps), or Gigabits per second (Gbps).&lt;/p&gt;
&lt;p&gt;When a cloud provider like Google Cloud or AWS quotes you a network speed, they are selling you bandwidth. It is a hard ceiling on how much data can move.&lt;/p&gt;
&lt;h3&gt;Bandwidth is passive&lt;/h3&gt;
&lt;p&gt;Bandwidth does not account for the speed of the individual cars or a traffic jam at the exit ramp.&lt;/p&gt;
&lt;p&gt;You can have a 100 Gbps connection, but if the protocol or the destination server cannot keep up, most of that bandwidth stays unused.&lt;/p&gt;
&lt;h2&gt;The reality check of throughput&lt;/h2&gt;
&lt;p&gt;Throughput is the actual amount of data that successfully travels from point A to point B in a specific timeframe. If bandwidth is the number of lanes, throughput is the number of cars that arrive every minute.&lt;/p&gt;

  &lt;div&gt;How many lanes the highway has. The most data the link could carry.&lt;/div&gt;
  &lt;div&gt;How many cars actually arrive each minute. The data that really got delivered.&lt;/div&gt;

&lt;h3&gt;Why throughput is lower&lt;/h3&gt;
&lt;p&gt;Throughput is almost always lower than bandwidth. Protocol overhead, network congestion, hardware limits, and packet loss all cut into the actual flow of data.&lt;/p&gt;
&lt;p&gt;You might have a 1 Gbps link while your application only reaches 200 Mbps because of internal processing delays or inefficient code. To see what that gap means for a real file, try my &lt;a href=&quot;https://ansezz.com/tools/transfer-time-calculator/&quot;&gt;transfer time calculator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Measuring throughput gives you the real picture of your system health. It tells you how your Shopify store or your Laravel backend actually performs under load.&lt;/p&gt;
&lt;p&gt;If your throughput is far lower than your bandwidth, you have a bottleneck that more &quot;lanes&quot; will not fix.&lt;/p&gt;
&lt;figure&gt;

Run `iperf3` between your app server and your database server to measure raw network throughput. Then time a real query or file transfer over the same path. The gap between the two numbers is your application overhead.

&lt;h2&gt;The invisible hand of latency&lt;/h2&gt;
&lt;p&gt;You cannot discuss bandwidth and throughput without latency. Latency is the time it takes for data to travel from the source to the destination; the full trip there and back is the round-trip time (RTT).&lt;/p&gt;
&lt;p&gt;It is the &quot;lag&quot; you feel in a video call or a gaming session.&lt;/p&gt;
&lt;h3&gt;Wide pipe, slow trip&lt;/h3&gt;
&lt;p&gt;High bandwidth does not mean low latency. Consider a geostationary satellite link. It may have massive bandwidth (great for downloading large files), but the round trip is roughly 500ms because the signal has to climb to about 35,786 km and back.&lt;/p&gt;
&lt;p&gt;For a &quot;chatty&quot; application that fires many sequential calls, like a &lt;a href=&quot;https://ansezz.com/blog/picking-the-right-rag-stack/&quot;&gt;RAG-based AI system&lt;/a&gt; chaining retrieval and generation, high latency kills throughput.&lt;/p&gt;
&lt;p&gt;Even if you have infinite bandwidth, your throughput is capped by how many round trips your data has to make.&lt;/p&gt;
&lt;p&gt;Every time your application waits for an acknowledgment from the server, it sits idle. This is why optimizing for latency often matters more than upgrading your network plan.&lt;/p&gt;

Count the sequential network calls in your slowest request (database, cache, external APIs). Multiply by the round-trip time to each. That number is a floor no bandwidth upgrade can lower.

&lt;h2&gt;Why bandwidth vs throughput matters for e-commerce&lt;/h2&gt;
&lt;p&gt;In a Shopify Plus environment, the gap between bandwidth and throughput directly affects conversion rates. When a customer hits your store, their browser makes dozens of requests for images, scripts, and API data.&lt;/p&gt;
&lt;p&gt;If your images are unoptimized, they eat up bandwidth. If your Shopify apps are poorly coded, they add latency. The result is lower throughput: the data does not reach the customer fast enough.&lt;/p&gt;
&lt;p&gt;You can have the fastest hosting in the world, but if your &lt;a href=&quot;https://ansezz.com/blog/shopify-liquid-vs-headless/&quot;&gt;liquid templates&lt;/a&gt; do heavy lifting on every page load, the actual delivery speed stalls.&lt;/p&gt;
&lt;h3&gt;Throughput is user experience&lt;/h3&gt;
&lt;p&gt;For businesses scaling their digital presence, focusing on throughput means focusing on the user experience. It means smaller payloads and fewer round trips.&lt;/p&gt;
&lt;p&gt;It is about making sure the &quot;cars&quot; on your highway move at top speed and arrive without delay.&lt;/p&gt;
&lt;h2&gt;Bottlenecks in the Laravel and DevOps stack&lt;/h2&gt;
&lt;p&gt;In a typical Laravel environment managed with tools like Docker or &lt;a href=&quot;https://ansezz.com/blog/scaling-with-coolify/&quot;&gt;Coolify&lt;/a&gt;, throughput bottlenecks often hide in the database or the cache layer.&lt;/p&gt;
&lt;p&gt;You might have a 10 Gbps internal network between your app server and your database server. On paper, your bandwidth is huge.&lt;/p&gt;
&lt;h3&gt;Slow queries look like slow networks&lt;/h3&gt;
&lt;p&gt;If your queries are not indexed, or you fetch thousands of unnecessary rows, your throughput will tank. The network is fast, but the application is slow to process and deliver the data.&lt;/p&gt;
&lt;p&gt;This is where clean &lt;a href=&quot;https://ansezz.com/blog/category/architecture/&quot;&gt;architecture&lt;/a&gt; and efficient query design become network optimization tools.&lt;/p&gt;
&lt;h3&gt;Deployments have the same gap&lt;/h3&gt;
&lt;p&gt;DevOps engineers also face throughput issues during CI/CD deployments. Moving a large Docker image across a network takes bandwidth. The time it takes to unpack, layer, and verify that image is a throughput concern.&lt;/p&gt;
&lt;p&gt;Optimizing your Dockerfiles to reduce layer size is a direct way to improve the &quot;actual flow&quot; of your deployment pipeline.&lt;/p&gt;

Run `docker history ` on your largest image and look for the biggest layers. Moving one heavy install into a multi-stage build often shrinks the image more than any network change.

&lt;h2&gt;Optimizing for performance: a practical approach&lt;/h2&gt;
&lt;p&gt;Improving network performance needs two things: manage your capacity and optimize your flow. Here are the technical levers you can pull:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Compression and minification&lt;/strong&gt;: Smaller payloads mean fewer bytes and fewer packets for the same content, so more useful data gets through the pipe. Use Gzip or Brotli for your web assets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CDN implementation&lt;/strong&gt;: Moving data closer to the user reduces latency. Shorter distances mean faster round trips and higher throughput, see &lt;a href=&quot;https://ansezz.com/blog/cdn-vs-cache/&quot;&gt;CDN vs cache&lt;/a&gt; for where each layer belongs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connection pooling&lt;/strong&gt;: Reusing existing connections for database or API calls removes the overhead of the &quot;three-way handshake&quot; required for every new TCP connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous processing&lt;/strong&gt;: In Laravel, &lt;a href=&quot;https://ansezz.com/blog/scaling-with-rabbitmq/&quot;&gt;using queues&lt;/a&gt; lets you handle heavy tasks in the background. This keeps your main application throughput high for the end-user.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protocol upgrades&lt;/strong&gt;: HTTP/2 multiplexes many requests over one TCP connection. HTTP/3 goes further, running over QUIC to remove transport-level head-of-line blocking, so a single lost packet no longer stalls every other stream. On lossy mobile links the throughput gain is real.&lt;/li&gt;
&lt;/ol&gt;

Open your site in the browser dev tools, Network tab, and add the &quot;Protocol&quot; column. Any `http/1.1` rows on your own domains are an easy upgrade.

&lt;h2&gt;Measuring the right metrics&lt;/h2&gt;
&lt;p&gt;Stop treating your ISP&apos;s speed test as the only measure of success. To understand your system, monitor both bandwidth utilization and application throughput. Tools like Google Cloud Monitoring or Datadog give detailed insight into both.&lt;/p&gt;
&lt;p&gt;Look for places where available bandwidth is high but delivered throughput is low. These gaps are where your technical debt lives. They point to inefficient protocols, unoptimized assets, or server-side delays.&lt;/p&gt;
&lt;p&gt;Closing this gap is how you get a &quot;snappy&quot; feel for your web applications.&lt;/p&gt;
&lt;h3&gt;Architecture beats raw speed&lt;/h3&gt;
&lt;p&gt;A well-designed system on a moderate 100 Mbps link will often outperform a bloated system on a 1 Gbps link. Focus on the efficiency of the data flow rather than the width of the pipe.&lt;/p&gt;
&lt;figure&gt;

- **Bandwidth is capacity**: It is the maximum potential of your network link, not the actual speed of your data.
- **Throughput is reality**: It is the successful delivery rate of data, always limited by overhead and congestion.
- **Latency is the silent killer**: Even with high bandwidth, high latency will cap your throughput by forcing wait times.
- **Optimize the payload**: Smaller data sizes and fewer round trips are the most effective ways to increase throughput.
- **Monitor the gap**: Use dashboard metrics to identify when your actual performance falls far below your theoretical capacity.
- **Protocol choice matters**: A modern transport like HTTP/3 raises effective throughput over lossy links; query layers like GraphQL help separately by cutting over-fetching and round trips.

&lt;p&gt;If you&apos;re chasing a throughput bottleneck in production, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams ship the fix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you had to choose between doubling your bandwidth or halving your latency for a real-time AI application, which would give the better return for your infrastructure?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>networking</category><category>performance</category><category>devops</category><category>laravel</category><category>shopify</category></item><item><title>Container vs pod: the building blocks</title><link>https://ansezz.com/blog/container-vs-pod/</link><guid isPermaLink="true">https://ansezz.com/blog/container-vs-pod/</guid><description>A container is the package; a Pod is the execution environment. How Kubernetes Pods share networking and storage, and when sidecars earn their keep.</description><pubDate>Sat, 20 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A container is the package. A Pod is the place it runs, and the difference decides whether your sidecars can even reach your app.&lt;/p&gt;

- A container is one isolated process with its own filesystem. A Pod is the smallest unit Kubernetes deploys, and it can hold one or more containers.
- Containers in the same Pod share one IP address, talk over `localhost` and can share Volumes.
- The sidecar pattern uses that sharing to add logging, proxies or config reloads without touching your app code.

&lt;p&gt;When you move from a simple Docker setup to an orchestrated environment like Kubernetes, the terminology starts to blur.&lt;/p&gt;
&lt;p&gt;You wonder why you can&apos;t just deploy a container directly, and why Kubernetes insists on wrapping your perfectly good Docker image in something called a Pod. The container vs Pod distinction is the first thing that trips people up.&lt;/p&gt;
&lt;p&gt;Treat a Pod as merely a &quot;fancy container&quot; and you miss the shared networking and storage that make Kubernetes work.&lt;/p&gt;
&lt;p&gt;You end up with monolithic containers that are hard to scale, or sidecars that can&apos;t actually reach the main application. Understanding how a container relates to a Pod is the difference between a brittle deployment and a scalable, resilient system.&lt;/p&gt;
&lt;h2&gt;The atomic unit: what is a container?&lt;/h2&gt;
&lt;p&gt;A container is a lightweight, standalone executable package. It includes everything needed to run an application: code, runtime, system tools, system libraries, and settings.&lt;/p&gt;
&lt;p&gt;At its core, a container is an isolated process running on a host operating system. It shares the host&apos;s kernel but keeps its own filesystem and environment variables.&lt;/p&gt;
&lt;h3&gt;Consistent, but solitary&lt;/h3&gt;
&lt;p&gt;In the world of &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;DevOps and Docker&lt;/a&gt;, containers solved the &quot;it works on my machine&quot; problem. They give you a consistent environment from development to production.&lt;/p&gt;
&lt;p&gt;Whether you are running a Laravel backend or a Shopify app extension, the container stays the same.&lt;/p&gt;
&lt;p&gt;However, a container is solitary by nature. By default, it has its own IP address and its own isolated filesystem. Communication between two containers usually requires explicit networking configuration or external links.&lt;/p&gt;
&lt;h2&gt;The logical host: why Kubernetes needs Pods&lt;/h2&gt;
&lt;p&gt;Kubernetes does not manage containers directly. This is a common point of friction for beginners. Instead, it manages Pods.&lt;/p&gt;
&lt;p&gt;A Pod is the smallest deployable unit in Kubernetes. Think of a Pod as a &quot;logical host&quot; for one or more containers.&lt;/p&gt;
&lt;h3&gt;The wrapper&lt;/h3&gt;
&lt;p&gt;The Pod acts as a wrapper. It provides a shared execution environment for the containers inside it.&lt;/p&gt;
&lt;p&gt;Most Pods contain a single container, but the ability to group several is a core feature. These containers are always co-located and co-scheduled. They run on the same physical or virtual machine within the cluster.&lt;/p&gt;
&lt;p&gt;This coupling lets them behave as if they were processes on the same server, while each stays isolated in its own container.&lt;/p&gt;
&lt;figure&gt;

Run `kubectl get pod  -o jsonpath=&apos;{.spec.containers[*].name}&apos;` on a few of your Pods. You will see how many of them are really one container, and which already carry a helper.

&lt;h2&gt;Shared network and localhost: one IP per Pod&lt;/h2&gt;
&lt;p&gt;The biggest technical advantage of a Pod is the shared network namespace. Every Pod gets a unique IP address within the Kubernetes cluster. Every container inside that Pod shares this IP address.&lt;/p&gt;
&lt;p&gt;This changes how services communicate. In a standard Docker setup, Container A needs to know the IP of Container B to send a request. Inside a Kubernetes Pod, Container A can talk to Container B simply by using &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;

  &lt;div&gt;Each has its own IP. Container A needs Container B&apos;s address and explicit networking to reach it.&lt;/div&gt;
  &lt;div&gt;Both share the Pod&apos;s IP. Container A calls `localhost` and the port Container B listens on.&lt;/div&gt;

&lt;h3&gt;What that means in practice&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Port management&lt;/strong&gt;: Since they share an IP, containers in the same Pod cannot bind to the same port. If one container uses port 8080, another container in that Pod must use a different port. To check which service usually owns a port, see my &lt;a href=&quot;https://ansezz.com/tools/common-ports/&quot;&gt;common ports list&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Communication over &lt;code&gt;localhost&lt;/code&gt; is extremely fast. There is no need for complex routing or service discovery between the containers within the same Pod.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simplicity&lt;/strong&gt;: You can build modular systems where a helper container provides a service to the main application without exposing that service to the rest of the cluster.&lt;/li&gt;
&lt;/ol&gt;

Before you add a second container to a Pod, list the ports each one binds. Any overlap will make the second container fail to start.

&lt;h2&gt;Shared storage: passing files between containers&lt;/h2&gt;
&lt;p&gt;Just as they share a network, containers in a Pod can share storage. A container&apos;s internal filesystem is ephemeral and isolated, but a Pod can define shared Volumes.&lt;/p&gt;
&lt;p&gt;These volumes are mounted into the filesystem of every container that needs them.&lt;/p&gt;
&lt;p&gt;This is essential for applications that pass data between processes. For example, a main application might write log files, while a separate log-processing container reads those files and ships them to a central server.&lt;/p&gt;
&lt;p&gt;Without the Pod abstraction, you would have to deal with complex network mounts or external storage providers. In a Pod, it is as simple as mounting a shared directory.&lt;/p&gt;
&lt;h2&gt;The sidecar pattern: real-world multi-container Pods&lt;/h2&gt;
&lt;p&gt;The &quot;sidecar pattern&quot; is the main reason we use multi-container Pods.&lt;/p&gt;
&lt;p&gt;The &quot;sidecar&quot; container sits next to the &quot;main&quot; container and performs a supporting task.&lt;/p&gt;
&lt;p&gt;A sidecar lets you add functionality to an application without changing the application code.&lt;/p&gt;
&lt;h3&gt;Common sidecars&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Logging agents&lt;/strong&gt;: A sidecar that watches a log file on a shared volume and sends the data to Elasticsearch or CloudWatch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proxies&lt;/strong&gt;: A service mesh sidecar (like Istio or Envoy) that handles all incoming and outgoing network traffic for the main application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config reloaders&lt;/strong&gt;: A sidecar that watches a configuration source (like a Git repo or ConfigMap) and signals the main application to reload when changes occur.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: A sidecar that handles SSL/TLS termination so the main application only has to deal with plain HTTP.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By separating these concerns into different containers within the same Pod, you keep your main application container clean and focused. This modularity is a pillar of &lt;a href=&quot;https://ansezz.com/blog/docker-vs-kubernetes/&quot;&gt;containers versus orchestration&lt;/a&gt; thinking.&lt;/p&gt;
&lt;h3&gt;Native sidecars&lt;/h3&gt;
&lt;p&gt;Historically you added a sidecar by listing a second entry under &lt;code&gt;spec.containers&lt;/code&gt;, which gave you no control over startup or shutdown order.&lt;/p&gt;
&lt;p&gt;Kubernetes now has first-class sidecar support. An init container with &lt;code&gt;restartPolicy: Always&lt;/code&gt; starts before the main containers, stays running for the Pod&apos;s lifetime, and shuts down after them.&lt;/p&gt;
&lt;p&gt;This feature reached stable in Kubernetes v1.33, so reach for native sidecars over plain co-containers when ordering matters.&lt;/p&gt;
&lt;figure&gt;

If you have a log shipper or proxy that must be up before your app starts, move it from `spec.containers` to `spec.initContainers` with `restartPolicy: Always`.

&lt;h2&gt;Technical comparison: container vs Pod&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Standalone Container&lt;/th&gt;
&lt;th&gt;Containers in a Pod&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Unit of Deployment&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Single process image&lt;/td&gt;
&lt;td&gt;Kubernetes Pod object&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Networking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Unique IP per container&lt;/td&gt;
&lt;td&gt;Unique IP per Pod (shared)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Localhost Access&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Isolated to the container&lt;/td&gt;
&lt;td&gt;Shared across all containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Storage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Isolated filesystem&lt;/td&gt;
&lt;td&gt;Shared Volumes available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scheduling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Manual or via runtime&lt;/td&gt;
&lt;td&gt;Automatic by K8s scheduler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tied to the process&lt;/td&gt;
&lt;td&gt;Tied to the Pod&apos;s status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scaling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Scale individual instances&lt;/td&gt;
&lt;td&gt;Scale the entire Pod unit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;DevOps deployment: GCP and AWS context&lt;/h2&gt;
&lt;p&gt;When you move your workloads to managed cloud providers like Google Cloud (GKE) or AWS (EKS), the container vs Pod distinction becomes operational. These platforms manage the infrastructure, but you still define the Pod specifications.&lt;/p&gt;
&lt;h3&gt;Serverless blurs the line&lt;/h3&gt;
&lt;p&gt;EKS on Fargate still runs real Pods, so multi-container Pods and sidecars work exactly as they do on a self-managed node. Fargate just provisions the compute per Pod instead of per node.&lt;/p&gt;
&lt;p&gt;Cloud Run started as single-container only. Since May 2023 (first in preview, now generally available) it supports multi-container deployments where sidecars share the network namespace and talk over &lt;code&gt;localhost&lt;/code&gt;, just like a Pod.&lt;/p&gt;
&lt;p&gt;So you no longer have to jump to full Kubernetes the moment you need a sidecar. You do once you need &lt;a href=&quot;https://ansezz.com/blog/serverless-vs-containers/&quot;&gt;richer orchestration&lt;/a&gt; like DaemonSets, complex scheduling, or fine-grained networking.&lt;/p&gt;

Write down the one sidecar you need today. If it is a single proxy or log agent, check whether Cloud Run or Fargate already covers it before you stand up a cluster.


- A container is the packaging format, while a Pod is the execution environment.
- Containers in a Pod share the same IP address and can communicate via `localhost`.
- Shared Volumes allow containers within a Pod to exchange data through the filesystem.
- The sidecar pattern uses multiple containers in one Pod to separate concerns like logging and security.
- Kubernetes schedules and scales Pods as a single unit, ensuring all containers land on the same node.
- Understanding Pods matters when you manage complex deployments on GCP, AWS, or [self-hosted tools like Coolify](/blog/coolify-self-hosted-saas/).

&lt;p&gt;If you&apos;re architecting workloads that have outgrown plain Docker, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams ship it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At what point does the overhead of managing a multi-container Pod outweigh the benefits of process separation in your current infrastructure?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>kubernetes</category><category>docker</category><category>devops</category><category>infrastructure</category></item><item><title>Terraform vs Ansible: the real difference in DevOps</title><link>https://ansezz.com/blog/terraform-vs-ansible/</link><guid isPermaLink="true">https://ansezz.com/blog/terraform-vs-ansible/</guid><description>Provisioning vs configuration management: the real difference between Terraform and Ansible, declarative vs procedural logic, and the hybrid workflow.</description><pubDate>Wed, 17 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Terraform builds the servers. Ansible sets up what runs on them. Most pipeline pain comes from asking one to do the other&apos;s job.&lt;/p&gt;

- Terraform is a declarative provisioning tool: you describe the cloud resources you want and it uses a state file to create, change or destroy them.
- Ansible is a configuration management tool: agentless playbooks over SSH install and configure software on servers that already exist.
- The strongest setup uses both: Terraform for the cloud fabric, Ansible for the software layer, wired into one CI/CD pipeline.

&lt;p&gt;You spend six hours clicking through the AWS console to set up a VPC, three subnets, and a load balancer. Then you realize you missed a single security group rule that breaks the entire staging environment.&lt;/p&gt;
&lt;p&gt;Then you have to do it all over again for production. This manual toil is a ticking time bomb for technical debt and human error.&lt;/p&gt;
&lt;p&gt;Infrastructure as Code (IaC) is the industry standard solution, but the market is split between two titans: Terraform and Ansible. Choosing the wrong one for the task leads to fragile pipelines and &quot;snowflake&quot; servers that no one dares to touch.&lt;/p&gt;
&lt;h2&gt;Terraform vs Ansible: provisioning vs configuration&lt;/h2&gt;
&lt;p&gt;The most common misunderstanding in DevOps is treating Terraform and Ansible as interchangeable tools. They are not. At their core, they solve two distinct stages of the infrastructure lifecycle.&lt;/p&gt;
&lt;h3&gt;Terraform provisions&lt;/h3&gt;
&lt;p&gt;Terraform is a &lt;strong&gt;provisioning tool&lt;/strong&gt;. Its main job is to talk to cloud providers like AWS, Google Cloud, or Azure to create the virtualized &quot;hardware&quot; of your stack: VPCs, subnets, IAM roles, and managed databases.&lt;/p&gt;
&lt;p&gt;It builds the foundation your software will live on.&lt;/p&gt;
&lt;h3&gt;Ansible configures&lt;/h3&gt;
&lt;p&gt;Ansible is a &lt;strong&gt;configuration management&lt;/strong&gt; tool. Once the server exists, Ansible takes over to install Nginx, configure the PHP-FPM pool, or deploy your latest Laravel build.&lt;/p&gt;
&lt;p&gt;It is designed to manage the internal state of the operating system and the applications running on it.&lt;/p&gt;
&lt;figure&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Terraform&lt;/th&gt;
&lt;th&gt;Ansible&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Provisioning infrastructure&lt;/td&gt;
&lt;td&gt;Configuration management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Language&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HCL (declarative)&lt;/td&gt;
&lt;td&gt;YAML (procedural/imperative)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;State&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Managed (state file)&lt;/td&gt;
&lt;td&gt;Stateless&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Client-only (API-based)&lt;/td&gt;
&lt;td&gt;Agentless (SSH/WinRM)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VPCs, clusters, databases&lt;/td&gt;
&lt;td&gt;Installing apps, OS hardening&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

List every manual step in your last environment setup. Mark each one &quot;create a cloud resource&quot; (Terraform) or &quot;change something inside a server&quot; (Ansible). That split is your starting automation plan.

&lt;h2&gt;Declarative vs procedural logic&lt;/h2&gt;
&lt;p&gt;The way you talk to these tools defines how you manage your stack. Terraform is strictly &lt;strong&gt;declarative&lt;/strong&gt;. You describe the &quot;end state&quot; you want.&lt;/p&gt;
&lt;p&gt;If you tell Terraform you want five EC2 instances, it compares that with the instances it already manages. If it manages three, it adds two. If it manages seven, it destroys two.&lt;/p&gt;
&lt;p&gt;You don&apos;t tell it &lt;em&gt;how&lt;/em&gt; to do it; you tell it what you want the result to be. Instances created by hand outside Terraform are invisible to it until you import them.&lt;/p&gt;
&lt;h3&gt;Ansible runs steps in order&lt;/h3&gt;
&lt;p&gt;Ansible is mainly &lt;strong&gt;procedural&lt;/strong&gt; (or imperative), though it uses declarative modules. You write playbooks that list a series of steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Update apt-get.&lt;/li&gt;
&lt;li&gt;Install Docker.&lt;/li&gt;
&lt;li&gt;Copy the config file.&lt;/li&gt;
&lt;li&gt;Restart the service.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Ansible modules are idempotent (they won&apos;t re-install Docker if it&apos;s already there), but the workflow follows a specific sequence of commands. This makes Ansible very good at complex application deployments where the order of operations matters.&lt;/p&gt;

  &lt;div&gt;&quot;I want five instances.&quot; Terraform works out what to add or remove to get there.&lt;/div&gt;
  &lt;div&gt;&quot;Update, install Docker, copy the config, restart.&quot; Ansible runs the steps in that order.&lt;/div&gt;

&lt;h2&gt;Immutable vs mutable infrastructure&lt;/h2&gt;
&lt;p&gt;The choice between Terraform vs Ansible often shapes your architectural philosophy.&lt;/p&gt;
&lt;h3&gt;Terraform leans immutable&lt;/h3&gt;
&lt;p&gt;Terraform leans heavily toward &lt;strong&gt;immutable infrastructure&lt;/strong&gt;. In an immutable world, you don&apos;t &quot;fix&quot; a server. If you need to update the base OS image, you destroy the old server and provision a new one from a fresh image.&lt;/p&gt;
&lt;p&gt;This is the same philosophy behind &lt;a href=&quot;https://ansezz.com/blog/docker-vs-kubernetes/&quot;&gt;containers and orchestration&lt;/a&gt;. It removes &quot;configuration drift,&quot; where servers that started identical become different over time because of manual patches.&lt;/p&gt;
&lt;h3&gt;Ansible is the king of mutable&lt;/h3&gt;
&lt;p&gt;Ansible is the king of &lt;strong&gt;mutable infrastructure&lt;/strong&gt;. It is designed to go into existing, long-lived servers and modify them.&lt;/p&gt;
&lt;p&gt;This is often necessary for legacy systems or complex environments where spinning up a fresh cluster for every minor config change is too slow or expensive.&lt;/p&gt;
&lt;p&gt;For teams using self-hosted solutions like &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify for SaaS hosting&lt;/a&gt;, Ansible is a good fit for managing the underlying VPS environment.&lt;/p&gt;

Pick one server you patch by hand today. Write the patch as a small Ansible playbook and run it with `--check --diff` first, so you see what would change before it changes.

&lt;h2&gt;State management: the source of truth&lt;/h2&gt;
&lt;p&gt;Terraform&apos;s superpower (and its greatest complexity) is the &lt;strong&gt;state file&lt;/strong&gt;. This JSON file is a map of your real-world infrastructure.&lt;/p&gt;
&lt;p&gt;When you run a command, Terraform compares your HCL code against this state file and the real resources to work out what needs to change.&lt;/p&gt;
&lt;h3&gt;Drift detection&lt;/h3&gt;
&lt;p&gt;This lets Terraform detect &quot;drift&quot;: when someone manually changes a setting in the AWS console, Terraform sees the difference and offers to revert it.&lt;/p&gt;
&lt;h3&gt;Ansible keeps no record&lt;/h3&gt;
&lt;p&gt;Ansible is &lt;strong&gt;stateless&lt;/strong&gt;. It doesn&apos;t keep a record of what it did yesterday. It simply connects to the IP addresses in your inventory and runs the playbook.&lt;/p&gt;
&lt;p&gt;If a server is down, Ansible reports a failure, but it has no &quot;global view&quot; of your infrastructure the way Terraform does. This makes Ansible easier to start with but harder to use for tracking the full lifecycle of high-level cloud resources.&lt;/p&gt;
&lt;figure&gt;

Run `terraform plan -refresh-only` against production. Anything it reports is drift someone introduced by hand, and a good first list of what to bring back under code.

&lt;h2&gt;Better together: the hybrid workflow&lt;/h2&gt;
&lt;p&gt;In a professional &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;DevOps&lt;/a&gt; pipeline, you rarely choose just one. Most strong teams use both.&lt;/p&gt;
&lt;h3&gt;A typical workflow&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Terraform&lt;/strong&gt; provisions the network (VPC), the security groups, and the base EC2 instances using a clean Ubuntu AMI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Terraform&lt;/strong&gt; outputs the IP addresses of those new instances.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ansible&lt;/strong&gt; picks up those IPs and runs a playbook to install the LEMP stack, configure SSL certificates, and tune the firewall.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Why the split works&lt;/h3&gt;
&lt;p&gt;By separating the &lt;strong&gt;cloud fabric&lt;/strong&gt; (Terraform) from the &lt;strong&gt;software layer&lt;/strong&gt; (Ansible), you create a modular system that is easy to debug and scale.&lt;/p&gt;
&lt;p&gt;If you move from AWS to Google Cloud, you rewrite your Terraform code for the new provider&apos;s resources but keep your Ansible playbooks largely the same.&lt;/p&gt;
&lt;p&gt;Wiring both stages into a single &lt;a href=&quot;https://ansezz.com/blog/ci-vs-cd/&quot;&gt;CI/CD&lt;/a&gt; pipeline turns this into a one-command, reproducible build.&lt;/p&gt;
&lt;h3&gt;The licensing caveat&lt;/h3&gt;
&lt;p&gt;One 2026 caveat worth flagging: HashiCorp moved Terraform to the Business Source License in August 2023, and the community forked it into &lt;a href=&quot;https://opentofu.org/&quot;&gt;OpenTofu&lt;/a&gt; (now a CNCF project under the Linux Foundation).&lt;/p&gt;
&lt;p&gt;OpenTofu is a near drop-in replacement using the same HCL syntax and state format, so &quot;Terraform&quot; in this article applies equally to it. IBM completed its acquisition of HashiCorp in February 2025, which has only sharpened that licensing question for teams.&lt;/p&gt;

Add a `terraform output -json` step to your pipeline and feed it into an Ansible dynamic inventory, so new servers get configured without anyone copying IPs.


- **Terraform** is for building the house (infrastructure). It is declarative, immutable, and stateful.
- **Ansible** is for decorating and maintaining the house (software configuration). It is procedural, mutable, and stateless.
- Use **Terraform** to manage resources with a clear lifecycle, like databases and load balancers.
- Use **Ansible** to manage the &quot;inside&quot; of a VM, such as package updates and application deployments.
- Avoid using Ansible to provision cloud resources; while possible, it lacks the state management and dependency graphing of Terraform.
- Combine both tools in a CI/CD pipeline for a fully automated, reproducible environment.

&lt;p&gt;If you had to rebuild your entire production environment from scratch in 30 minutes, would your current automation tools be enough to restore both the infrastructure and the application state?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>devops</category><category>infrastructure</category></item><item><title>Replication vs backup: why Laravel needs both</title><link>https://ansezz.com/blog/replication-vs-backup-laravel/</link><guid isPermaLink="true">https://ansezz.com/blog/replication-vs-backup-laravel/</guid><description>Replication protects you from hardware failure; backups protect you from your own mistakes. How read/write splitting and point-in-time recovery fit in.</description><pubDate>Sat, 13 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Replication copies your data everywhere in milliseconds, including the mistake that just deleted it. Only a backup lets you go back in time.&lt;/p&gt;

- Replication is for uptime: replicas take over when hardware fails and can serve reads, but they mirror every bad write instantly.
- Backups are for recovery: point-in-time snapshots on separate storage are your only way back from bugs, bad migrations and human error.
- In Laravel, use `read`/`write` connections with `sticky` for replicas, keep real backups beside any Shopify sync, and test your restores.

&lt;p&gt;You deploy a breaking database migration that drops a critical column. Your production database replicates in real time to three nodes across two regions.&lt;/p&gt;
&lt;p&gt;Within milliseconds, that destructive change reaches every one of your &quot;safety&quot; copies. You have zero downtime, and that column is gone from every copy.&lt;/p&gt;
&lt;p&gt;This is the moment you realize that replication is not a backup.&lt;/p&gt;
&lt;p&gt;Engineering teams often confuse high availability with data durability. Both matter, but they solve different problems.&lt;/p&gt;
&lt;p&gt;Replication protects you from hardware failure and latency. Backups protect you from logic errors, corruption, and human mistakes.&lt;/p&gt;
&lt;p&gt;If you are building a Laravel application or a high-volume Shopify Plus integration, knowing where one ends and the other begins is the difference between a minor incident and a company-ending event.&lt;/p&gt;
&lt;h2&gt;The fundamental trade-off: speed vs history&lt;/h2&gt;
&lt;p&gt;Replication is about continuity. Its goal is that if your main database server vanishes, a secondary node is ready to take over immediately.&lt;/p&gt;
&lt;p&gt;This is measured in Recovery Time Objective (RTO). In a well-tuned system, failover happens in seconds. You are mirroring every &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt; as they happen.&lt;/p&gt;
&lt;h3&gt;Backups are history&lt;/h3&gt;
&lt;p&gt;Backups are about recovery. Their goal is a safe version of your data from a specific point in history.&lt;/p&gt;
&lt;p&gt;If a bug corrupts your inventory levels at 2:00 PM, a backup from 1:00 PM is your only lifeline. Backups are usually stored as compressed snapshots on detached storage like Amazon S3 or Google Cloud Storage.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Replication&lt;/th&gt;
&lt;th&gt;Backup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High Availability (HA)&lt;/td&gt;
&lt;td&gt;Disaster Recovery (DR)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data State&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Real-time / Live&lt;/td&gt;
&lt;td&gt;Historical / Snapshot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Propagation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Immediate (including errors)&lt;/td&gt;
&lt;td&gt;None (isolated from live changes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Storage Cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High (hot, identical hardware)&lt;/td&gt;
&lt;td&gt;Low (cold, compressed snapshots)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Recovery Speed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Seconds to Minutes&lt;/td&gt;
&lt;td&gt;Minutes to Hours&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

Write down two numbers for your main database: how long you can be down (RTO) and how much data you can lose to a bad write (RPO: how old your newest restorable backup can be). Replication covers the first. Only backups cover the second.

&lt;h2&gt;Why replication faithfully mirrors your mistakes&lt;/h2&gt;
&lt;p&gt;The greatest strength of replication is also its greatest weakness. It is designed to be a mirror.&lt;/p&gt;
&lt;p&gt;If you run a &lt;code&gt;truncate&lt;/code&gt; command on your primary database, the replication protocol assumes it was intentional. It will purge that data from your replicas before you can even hit &quot;Ctrl+C&quot; in your terminal.&lt;/p&gt;
&lt;h3&gt;A real failure&lt;/h3&gt;
&lt;p&gt;I have seen developers rely solely on RDS Read Replicas as their &quot;safety net.&quot; When a rogue queue job began overwriting customer email addresses with null values, the replicas updated instantly.&lt;/p&gt;
&lt;p&gt;Without a point-in-time backup, those original emails were gone forever. Replication provides infrastructure resilience, not data integrity.&lt;/p&gt;
&lt;h3&gt;Separate the two jobs&lt;/h3&gt;
&lt;p&gt;For a production-grade &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;Coolify self-hosted SaaS&lt;/a&gt;, you must separate your concerns.&lt;/p&gt;
&lt;p&gt;Use replication to scale your reads and handle node failures. Use automated, encrypted backups so you can roll back to a known-good state.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Implementing replication in Laravel&lt;/h2&gt;
&lt;p&gt;Laravel handles read/write splitting through native configuration. By defining &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; connections in your &lt;code&gt;config/database.php&lt;/code&gt;, the framework automatically routes &lt;code&gt;SELECT&lt;/code&gt; statements to your replicas while sending &lt;code&gt;INSERT&lt;/code&gt; and &lt;code&gt;UPDATE&lt;/code&gt; statements to the primary.&lt;/p&gt;
&lt;p&gt;This is the same connection layer you tune when designing a &lt;a href=&quot;https://ansezz.com/blog/laravel-multi-tenancy/&quot;&gt;multi-tenant Laravel architecture&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&apos;mysql&apos; =&amp;gt; [
    &apos;read&apos; =&amp;gt; [
        &apos;host&apos; =&amp;gt; [
            &apos;192.168.1.10&apos;, // Replica 1
            &apos;192.168.1.11&apos;, // Replica 2
        ],
    ],
    &apos;write&apos; =&amp;gt; [
        &apos;host&apos; =&amp;gt; [
            &apos;192.168.1.1&apos;, // Primary
        ],
    ],
    &apos;sticky&apos; =&amp;gt; true,
    &apos;driver&apos; =&amp;gt; &apos;mysql&apos;,
    // ... other settings
],
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Why &lt;code&gt;sticky&lt;/code&gt; matters&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;sticky&lt;/code&gt; option is important here. If you write a record during a request, any later reads during that same request come from the primary.&lt;/p&gt;
&lt;p&gt;This avoids &quot;read-after-write&quot; lag, where a replica is a few milliseconds behind the primary and your application looks as if the data vanished.&lt;/p&gt;

Check your `config/database.php`. If you have `read` hosts but no `&apos;sticky&apos; =&amp;gt; true`, add it, then test a &quot;create and redirect to the new record&quot; flow under load.

&lt;h2&gt;Shopify Plus and the sync fallacy&lt;/h2&gt;
&lt;p&gt;In the world of Shopify Plus, many developers build &quot;replication-style&quot; sync engines. They listen for &lt;code&gt;orders/create&lt;/code&gt; or &lt;code&gt;products/update&lt;/code&gt; webhooks and mirror that data into a local Laravel database.&lt;/p&gt;
&lt;p&gt;This is a useful pattern for custom reporting or complex &lt;a href=&quot;https://ansezz.com/blog/agentic-commerce-shopify/&quot;&gt;agentic commerce workflows&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;The sync deletes too&lt;/h3&gt;
&lt;p&gt;However, this local database is often mistaken for a backup. If an admin deletes a collection of products in the Shopify admin panel, Shopify fires a webhook.&lt;/p&gt;
&lt;p&gt;Your Laravel app receives that webhook and promptly deletes those products from your local DB to stay &quot;in sync.&quot;&lt;/p&gt;

  &lt;div&gt;A delete in Shopify becomes a delete in your local DB. Your copy is as short-lived as the live data.&lt;/div&gt;
  &lt;div&gt;Daily snapshots of the local DB, plus versioned JSON payloads in S3, let you rebuild state even after the sync deletes everything.&lt;/div&gt;

&lt;h3&gt;Build real history&lt;/h3&gt;
&lt;p&gt;If you do not have a separate backup strategy that creates daily snapshots of your local DB, your local data is just as ephemeral as the live Shopify data.&lt;/p&gt;
&lt;p&gt;To build true resilience, store historical JSON payloads of those Shopify resources in a versioned storage system like S3. This lets you reconstruct your state even if the live sync deletes everything.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Cloud infrastructure and the cost of availability&lt;/h2&gt;
&lt;p&gt;Managing replication by hand is a DevOps nightmare. For most Laravel applications, managed services like AWS RDS or Google Cloud SQL are the correct move. They handle the binary log replication, failover orchestration, and monitoring out of the box.&lt;/p&gt;
&lt;h3&gt;Multi-AZ is not a read replica&lt;/h3&gt;
&lt;p&gt;When configuring your cloud DB, you will see &quot;Multi-AZ&quot; (AWS) or &quot;High Availability&quot; (GCP) settings.&lt;/p&gt;
&lt;p&gt;A single-standby Multi-AZ deployment uses synchronous replication. It roughly doubles your database cost, because you run a standby instance in a second Availability Zone that does nothing but wait for the primary to die.&lt;/p&gt;
&lt;p&gt;This standby cannot serve read traffic. To scale reads you need separate read replicas (or RDS Multi-AZ DB clusters), not the HA standby.&lt;/p&gt;
&lt;h3&gt;Backups are cheap, testing is not&lt;/h3&gt;
&lt;p&gt;Backups, by contrast, are very cheap. Storing 500GB of compressed dumps in S3 Standard costs roughly $11 to $12 a month. Archival tiers like Glacier Deep Archive drop that to around 50 cents, at the cost of multi-hour retrieval.&lt;/p&gt;
&lt;p&gt;The cost of a backup is not in the storage; it is in the testing. A backup that has never been restored is just a collection of random bits. You must automate your restore tests.&lt;/p&gt;
&lt;p&gt;Time the download too: my &lt;a href=&quot;https://ansezz.com/tools/transfer-time-calculator/&quot;&gt;transfer time calculator&lt;/a&gt; shows how long 500GB takes on your link.&lt;/p&gt;
&lt;p&gt;I recommend using &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify and Docker&lt;/a&gt; to spin up ephemeral environments where you can test your backup restoration process regularly without touching production.&lt;/p&gt;

Schedule a monthly job that restores last night&apos;s backup into a throwaway container, runs `php artisan migrate:status` and a row count on your key tables, then deletes the container. Alert if any step fails.


- **Replication is for uptime.** It allows your app to stay online during hardware failures or network partitions.
- **Backups are for survival.** They are your only defense against data corruption, malicious attacks, and developer errors.
- **Replication propagates bugs.** If your code breaks the data, the replica will break just as fast.
- **Laravel supports read/write splitting.** Use the `sticky` configuration to prevent consistency issues during web requests.
- **Shopify webhooks are not backups.** A synchronized local database is a replica, not a historical record.
- **Test your restores.** Automate a process to verify that your backup snapshots actually work.

&lt;p&gt;If you&apos;re architecting that resilience layer for production, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams ship it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you had to choose between a system with 99.99% uptime but no backups, and a system with 95% uptime but hourly backups, which one would keep you from losing your business?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>databases</category><category>laravel</category><category>shopify</category><category>infrastructure</category></item><item><title>Rate limiting vs throttling</title><link>https://ansezz.com/blog/rate-limiting-vs-throttling/</link><guid isPermaLink="true">https://ansezz.com/blog/rate-limiting-vs-throttling/</guid><description>The engineering difference between rate limiting and throttling, and how each secures your APIs and keeps infrastructure stable under heavy load.</description><pubDate>Fri, 12 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Rate limiting says &quot;no&quot; once you go over the line. Throttling says &quot;slow down.&quot; Pick the wrong one and your users get errors they didn&apos;t need, or your database melts anyway.&lt;/p&gt;

- Rate limiting is a policy: X requests per Y time, then an instant HTTP 429. Use it for fairness, quotas and blocking abuse.
- Throttling shapes traffic: it delays or queues requests so a spike drains at a pace your backend can handle.
- Use both: rate limit at the edge, throttle inside your app around databases and third-party APIs, and track the counters in Redis.

&lt;p&gt;Your server is screaming, not because of a bug, but because of a success. A viral tweet or a massive batch of automated requests has flooded your API.&lt;/p&gt;
&lt;p&gt;Without rate limiting or throttling in place, your database locks up, your CPU pegs at 100%, and the site goes down for everyone.&lt;/p&gt;
&lt;p&gt;This is the nightmare scenario for any engineering team. To prevent it, you need to control the flow of traffic.&lt;/p&gt;
&lt;p&gt;Engineers often use &quot;rate limiting&quot; and &quot;throttling&quot; interchangeably. Both deal with traffic management, but they solve the problem with different philosophies.&lt;/p&gt;
&lt;p&gt;Choosing the wrong one can lead to a degraded user experience or, worse, a complete system failure under pressure. This guide breaks down both strategies and how to implement them in stacks like Laravel and Shopify.&lt;/p&gt;
&lt;h2&gt;The traffic surge crisis&lt;/h2&gt;
&lt;p&gt;The problem starts with resources. Every server has a finite amount of memory, compute, and bandwidth.&lt;/p&gt;
&lt;p&gt;When requests come in faster than your system can process them, a queue builds up. Once that queue exceeds the system&apos;s capacity, the service fails.&lt;/p&gt;
&lt;h3&gt;Not only attackers&lt;/h3&gt;
&lt;p&gt;This is not only about malicious actors or DDoS attacks. It is often about &quot;noisy neighbors&quot; in a multi-tenant environment, or a poorly optimized loop in a client-side application.&lt;/p&gt;
&lt;p&gt;I have seen production environments crash simply because a mobile app&apos;s &quot;retry&quot; logic was too aggressive during a minor network hiccup.&lt;/p&gt;
&lt;p&gt;Rate limiting and throttling are your tools to enforce discipline. They make sure no single user or service can monopolize your infrastructure. They are the gatekeepers of your &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;cloud infrastructure&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Defining rate limiting: the hard stop&lt;/h2&gt;
&lt;p&gt;Rate limiting is a policy-based approach. It defines a strict contract: &quot;You are allowed exactly X requests per Y amount of time.&quot; Once a user reaches that limit, the gate shuts.&lt;/p&gt;
&lt;p&gt;When a request exceeds the limit, the server rejects it immediately, typically with an HTTP &lt;a href=&quot;https://ansezz.com/tools/http-status-codes/&quot;&gt;429 &quot;Too Many Requests&quot; status code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The server spends no more resources on that request. It does not look up data in the database. It just says &quot;no.&quot;&lt;/p&gt;
&lt;h3&gt;Why use rate limiting?&lt;/h3&gt;
&lt;p&gt;Rate limiting is mainly about fairness and security. It protects your &lt;a href=&quot;https://ansezz.com/blog/api-gateway-ai-stack/&quot;&gt;API gateway&lt;/a&gt; from abuse.&lt;/p&gt;
&lt;p&gt;If you run a SaaS, you might have different tiers. A free user gets 60 requests per minute, while a premium user gets 1,000.&lt;/p&gt;
&lt;h3&gt;Easy to explain&lt;/h3&gt;
&lt;p&gt;Rate limiting is easy to communicate to users. They can check their response headers (like &lt;code&gt;X-RateLimit-Limit&lt;/code&gt; and &lt;code&gt;X-RateLimit-Remaining&lt;/code&gt;) to see exactly where they stand.&lt;/p&gt;
&lt;p&gt;It is a binary state: you are either within your limit or you are blocked.&lt;/p&gt;
&lt;h2&gt;Defining throttling: the gentle brake&lt;/h2&gt;
&lt;p&gt;Throttling is a runtime behavior designed to &quot;shape&quot; traffic. Instead of a hard rejection, throttling slows down the processing of requests.&lt;/p&gt;
&lt;p&gt;Think of it like a funnel. You can pour a bucket of water into it all at once, but it only drips out at a controlled, steady speed.&lt;/p&gt;
&lt;h3&gt;Delay and queue&lt;/h3&gt;
&lt;p&gt;In a throttled system, if you send too many requests, the server might add a delay to each response. It might queue the requests and process them as capacity becomes available.&lt;/p&gt;
&lt;p&gt;The goal is to smooth out spikes and avoid a &quot;jagged&quot; traffic pattern.&lt;/p&gt;
&lt;h3&gt;Why use throttling?&lt;/h3&gt;
&lt;p&gt;Throttling is excellent for protecting backend resources like databases or third-party APIs. If you know your database can only handle 500 writes per second, you might throttle incoming requests to stay just under that limit.&lt;/p&gt;
&lt;p&gt;It gives a better experience during occasional spikes. Instead of a 429 error, the user might just see a slightly longer loading time.&lt;/p&gt;
&lt;p&gt;If the traffic stays high for too long, though, the queue eventually fills up, and the system has to start rejecting requests anyway.&lt;/p&gt;

  &lt;div&gt;Over the limit? Instant 429. The request costs you almost nothing and the client knows exactly why.&lt;/div&gt;
  &lt;div&gt;Over the pace? The request waits in line. The user sees a slower response instead of an error, until the queue fills.&lt;/div&gt;

&lt;figure&gt;
&lt;h2&gt;Key algorithms: token vs leaky bucket&lt;/h2&gt;
&lt;p&gt;To implement these strategies, engineers rely on specific models. Knowing them helps you tune your system.&lt;/p&gt;
&lt;h3&gt;1. Token bucket (common for rate limiting)&lt;/h3&gt;
&lt;p&gt;Imagine a bucket that holds &quot;tokens.&quot; Every time a request comes in, a token is removed. If the bucket is empty, the request is rejected. Tokens are added back to the bucket at a constant rate.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pros:&lt;/strong&gt; It allows for &quot;burstiness.&quot; If the bucket is full, a user can send a quick burst of requests until the tokens run out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cons:&lt;/strong&gt; Hard to manage if the burst is too large for your downstream services.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2. Leaky bucket (common for throttling)&lt;/h3&gt;
&lt;p&gt;Imagine a bucket with a small hole at the bottom. Requests are poured into the bucket. They &quot;leak&quot; out of the hole at a constant rate to be processed. If the bucket overflows, new requests are dropped.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pros:&lt;/strong&gt; It ensures a stable, predictable flow of traffic to your backend.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cons:&lt;/strong&gt; It is very strict. It does not let output burst even if the system has idle capacity.&lt;/li&gt;
&lt;/ul&gt;

Look up the real limit of your most fragile dependency (database writes per second, a partner API&apos;s quota). Set your throttle a little under it, and set your public rate limit so that even every user at their max cannot exceed it.

&lt;h2&gt;Practical implementation: Laravel and Shopify&lt;/h2&gt;
&lt;p&gt;How does this look in the real world? Here are two ecosystems where these patterns matter.&lt;/p&gt;
&lt;h3&gt;Rate limiting in Laravel&lt;/h3&gt;
&lt;p&gt;Laravel makes rate limiting simple through its &lt;code&gt;RateLimiter&lt;/code&gt; facade and the &lt;code&gt;throttle&lt;/code&gt; middleware. The built-in limiter uses a fixed-window counter backed by your cache store.&lt;/p&gt;
&lt;p&gt;In Laravel 11 and 12, you define named limiters in the &lt;code&gt;boot&lt;/code&gt; method of &lt;code&gt;AppServiceProvider&lt;/code&gt; (the old &lt;code&gt;RouteServiceProvider&lt;/code&gt; was dropped from the default skeleton):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;

RateLimiter::for(&apos;api&apos;, function (Request $request) {
    return Limit::perMinute(60)-&amp;gt;by($request-&amp;gt;user()?-&amp;gt;id ?: $request-&amp;gt;ip());
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This tells Laravel to allow 60 requests per minute per user ID or IP address. If the limit is hit, Laravel throws a &lt;code&gt;ThrottleRequestsException&lt;/code&gt;, which results in a 429 response.&lt;/p&gt;
&lt;p&gt;Despite the middleware&apos;s name, this is a classic &quot;hard stop&quot; rate limit.&lt;/p&gt;
&lt;h3&gt;The Shopify API&apos;s leaky bucket&lt;/h3&gt;
&lt;p&gt;Shopify uses a leaky bucket algorithm for its GraphQL Admin API on every plan, not just Plus.&lt;/p&gt;
&lt;p&gt;When you make a GraphQL call, the response carries cost details under &lt;code&gt;extensions.cost&lt;/code&gt;, including the &lt;code&gt;requestedQueryCost&lt;/code&gt; and a &lt;code&gt;throttleStatus&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GraphQL cost:&lt;/strong&gt; Each query is assigned a calculated cost based on the fields and connection sizes you request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The bucket:&lt;/strong&gt; Your app has a bucket of &quot;points&quot; that restores at 100 points per second on Standard, 200 on Advanced, and 1,000 on Plus. Points are spent on each query and restore over time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The wall:&lt;/strong&gt; If you spend points faster than they restore, Shopify rejects the query with a &lt;code&gt;THROTTLED&lt;/code&gt; error.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The throttling is your job&lt;/h3&gt;
&lt;p&gt;Strictly speaking, Shopify itself rejects an over-budget query. The leaky bucket sets the pace, and the throttling (slowing down) is what your client has to do to match it.&lt;/p&gt;
&lt;p&gt;For high-volume commerce, that means building back-off logic into your application. A well-behaved client reads &lt;code&gt;throttleStatus.currentlyAvailable&lt;/code&gt; and slows down before it hits the wall, rather than firing blindly and retrying on every &lt;code&gt;THROTTLED&lt;/code&gt; error.&lt;/p&gt;
&lt;p&gt;When you do get throttled, wait long enough for &lt;code&gt;restoreRate&lt;/code&gt; to refill the points your next query needs.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Rate Limiting (Laravel Default)&lt;/th&gt;
&lt;th&gt;Throttling (Shopify-style leaky bucket)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Action&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Block (HTTP 429)&lt;/td&gt;
&lt;td&gt;Client delays or queues to match the leak rate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Security &amp;amp; Quotas&lt;/td&gt;
&lt;td&gt;Resource Stability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Logic&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fixed Window&lt;/td&gt;
&lt;td&gt;Leaky Bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User Experience&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instant Error&lt;/td&gt;
&lt;td&gt;Latency Spike&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

Log `extensions.cost.throttleStatus.currentlyAvailable` on every Shopify GraphQL call for a day. If it ever drops near zero, add a pause before the next call when the available points are below that query&apos;s cost.

&lt;h2&gt;Architectural impact: security vs experience&lt;/h2&gt;
&lt;p&gt;When designing your system, you must decide where to place these controls.&lt;/p&gt;
&lt;h3&gt;At the edge&lt;/h3&gt;
&lt;p&gt;Implement rate limiting at the WAF or API gateway level. This stops malicious traffic before it even touches your application code, which saves money on compute.&lt;/p&gt;
&lt;h3&gt;Inside the application&lt;/h3&gt;
&lt;p&gt;Implement throttling within your service logic. Use it when calling external APIs or writing to a shared database. Use a queue system like Redis or Amazon SQS to hold requests that exceed your immediate capacity.&lt;/p&gt;
&lt;p&gt;Rate limiting at the perimeter blocks the &quot;bad actors,&quot; while internal throttling keeps your services from melting down during a legitimate surge.&lt;/p&gt;
&lt;p&gt;I have found that the most resilient systems use both. This is especially important when building &lt;a href=&quot;https://ansezz.com/blog/agentic-commerce-shopify/&quot;&gt;agentic commerce systems&lt;/a&gt; that may generate many automated API calls in a short period.&lt;/p&gt;
&lt;p&gt;If those calls hit a paid LLM, the stakes shift from CPU to your bill. See &lt;a href=&quot;https://ansezz.com/blog/rate-limiting-ai-wallet/&quot;&gt;rate limiting and the denial-of-wallet problem&lt;/a&gt; for the token-cost angle.&lt;/p&gt;
&lt;figure&gt;

Check what your 429 responses send back. If there is no `Retry-After` header, add one, so well-behaved clients wait the right amount instead of retrying in a tight loop.


Managing traffic is about balance. You want a fast experience for users while keeping your infrastructure healthy.
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Rate limiting is for policy.&lt;/strong&gt; Use it to enforce subscription tiers and block brute-force attacks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Throttling is for stability.&lt;/strong&gt; Use it to smooth out traffic spikes and protect your database or external API dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Return 429 codes.&lt;/strong&gt; Always let the client know they are being limited. Include a &lt;code&gt;Retry-After&lt;/code&gt; header so they know when they can try again. My &lt;a href=&quot;https://ansezz.com/tools/http-headers/&quot;&gt;HTTP headers cheat sheet&lt;/a&gt; shows example values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor your limits.&lt;/strong&gt; Use dashboards to track how often users hit their limits. If 20% of your users are being limited, your limits might be too low, or your app might be inefficient.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Redis for state.&lt;/strong&gt; Both rate limiting and throttling require a fast, central store to track request counts. Redis is the industry standard for this.
&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;If you&apos;re hardening an API for production, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams ship it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How do you decide between rejecting a request immediately or making the user wait 500ms longer to maintain system stability?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>api-design</category><category>laravel</category><category>shopify</category><category>infrastructure</category><category>devops</category></item><item><title>Logging vs monitoring: a guide for scaling</title><link>https://ansezz.com/blog/logging-vs-monitoring/</link><guid isPermaLink="true">https://ansezz.com/blog/logging-vs-monitoring/</guid><description>Monitoring tells you a system is unhealthy; logging tells you why. How to combine metrics, structured logs, and correlation IDs for fast debugging.</description><pubDate>Mon, 08 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Your dashboard shows a latency spike. It can&apos;t tell you why the database connection is timing out. That gap is the difference between monitoring and logging.&lt;/p&gt;

- Monitoring tracks numbers over time and tells you the system is unhealthy. Logging records events and tells you why.
- Use structured JSON logs with a `request_id` so you can search and trace one request across your whole stack.
- Link the two with correlation IDs, alert on user-focused SLOs, and turn frequent log patterns into metrics.

&lt;p&gt;Your production environment is failing and customers are reporting 500 errors. You check your dashboard and see a latency spike, but the graph doesn&apos;t say why.&lt;/p&gt;
&lt;p&gt;You dive into your text files for the stack trace, but the logs are unstructured and impossible to search during a crisis.&lt;/p&gt;
&lt;h3&gt;Two pillars, often mixed up&lt;/h3&gt;
&lt;p&gt;Engineering teams often blur these two pillars of observability. The result is slow incident response and fragile systems.&lt;/p&gt;
&lt;p&gt;Picking tools is only part of it. You need a clear strategy for your &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;DevOps solutions&lt;/a&gt; that keeps availability high and debugging fast. One is the pulse of your system. The other is the forensic record.&lt;/p&gt;
&lt;h2&gt;Logging vs monitoring: what vs why&lt;/h2&gt;
&lt;p&gt;Monitoring tracks metrics over time to understand the state of a system. It answers &quot;Is the system healthy?&quot; by looking at numbers.&lt;/p&gt;
&lt;p&gt;You monitor CPU usage, memory and request latency. When a metric crosses a threshold, your monitoring system fires an alert.&lt;/p&gt;
&lt;h3&gt;Logs tell the story&lt;/h3&gt;
&lt;p&gt;Logging records discrete events inside an application or infrastructure. It answers &quot;What exactly happened?&quot; by giving context.&lt;/p&gt;
&lt;p&gt;A log entry might hold a user ID, a timestamp and the error message from a failed &lt;a href=&quot;https://ansezz.com/blog/category/laravel/&quot;&gt;Laravel&lt;/a&gt; job. Logs are granular and tell the story of a single request through your stack.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Monitoring&lt;/th&gt;
&lt;th&gt;Logging&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Metrics (numbers/counters)&lt;/td&gt;
&lt;td&gt;Events (text/structured data)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detection and health&lt;/td&gt;
&lt;td&gt;Diagnosis and forensics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frequency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Aggregated over time&lt;/td&gt;
&lt;td&gt;Recorded per occurrence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Alerting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Threshold-based (e.g., CPU &amp;gt; 80%)&lt;/td&gt;
&lt;td&gt;Event-based (e.g., Fatal Error)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Storage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Time-series databases&lt;/td&gt;
&lt;td&gt;Log aggregators/search engines&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Monitoring: the pulse of your infrastructure&lt;/h2&gt;
&lt;p&gt;Monitoring focuses on numbers. It is the first line of defense in any production environment.&lt;/p&gt;
&lt;p&gt;By watching trends, you can predict failures before they happen. A slow rise in memory use over 48 hours might point to a memory leak in a long-running Docker container.&lt;/p&gt;
&lt;h3&gt;The four golden signals&lt;/h3&gt;
&lt;p&gt;In a stack using tools like &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify and Docker&lt;/a&gt;, monitoring shows whether your containers perform as expected. Focus on the &quot;Four Golden Signals&quot;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Latency:&lt;/strong&gt; the time it takes to serve a request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Traffic:&lt;/strong&gt; the demand placed on the system.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Errors:&lt;/strong&gt; the rate of requests that fail.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saturation:&lt;/strong&gt; how &quot;full&quot; your service is.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Alert on what users feel&lt;/h3&gt;
&lt;p&gt;Good monitoring needs meaningful thresholds. An alert that fires every time CPU hits 70% is noise if your app is meant to be CPU-intensive.&lt;/p&gt;
&lt;p&gt;Define Service Level Objectives (SLOs) that match user experience. If users don&apos;t notice a 100ms delay, don&apos;t wake up an engineer for it.&lt;/p&gt;

Pick one alert that fired last week without anyone needing to act. Rewrite it against a user-facing SLO (for example error rate or P95 latency) or delete it.

&lt;h2&gt;Logging: the black box recorder&lt;/h2&gt;
&lt;p&gt;If monitoring tells you the plane is losing altitude, logging tells you why the engine stalled. Logs give you the evidence to debug complex issues.&lt;/p&gt;
&lt;p&gt;In a distributed system, one user action might touch several services. Without central logging, finding the root cause is like finding a needle in a haystack.&lt;/p&gt;
&lt;h3&gt;Structure your logs&lt;/h3&gt;
&lt;p&gt;A common mistake is using unstructured logs. Text lines like &lt;code&gt;[2026-06-21] Error: something went wrong&lt;/code&gt; are hard for machines to parse.&lt;/p&gt;
&lt;p&gt;Modern teams use structured logging, formatting each log as a JSON object. You can then filter and query on fields like &lt;code&gt;user_id&lt;/code&gt;, &lt;code&gt;request_id&lt;/code&gt; or &lt;code&gt;environment&lt;/code&gt;. When a log line won&apos;t parse, my &lt;a href=&quot;https://ansezz.com/tools/json-formatter/&quot;&gt;JSON formatter&lt;/a&gt; points to the exact character.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;timestamp&quot;: &quot;2026-06-21T14:30:05Z&quot;,
  &quot;level&quot;: &quot;error&quot;,
  &quot;message&quot;: &quot;Payment gateway timeout&quot;,
  &quot;context&quot;: {
    &quot;user_id&quot;: 4502,
    &quot;order_id&quot;: &quot;ORD-9921&quot;,
    &quot;gateway&quot;: &quot;stripe&quot;,
    &quot;attempt&quot;: 3
  },
  &quot;request_id&quot;: &quot;req-a1b2c3d4&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Trace one request everywhere&lt;/h3&gt;
&lt;p&gt;Including a &lt;code&gt;request_id&lt;/code&gt; in every log entry lets you trace a single request across your infrastructure. This matters a lot in &lt;a href=&quot;https://ansezz.com/blog/category/shopify/&quot;&gt;Shopify development&lt;/a&gt;, where webhooks and API calls often chain together.&lt;/p&gt;
&lt;p&gt;A dashboard tells you something broke. A searchable log tells you what to fix.&lt;/p&gt;
&lt;figure&gt;

  &lt;div&gt;`Error: something went wrong`. No user, no order, no request ID. You grep text files and hope.&lt;/div&gt;
  &lt;div&gt;A JSON entry with `level`, `user_id`, `order_id` and `request_id`. One query finds every line for that request.&lt;/div&gt;

&lt;h2&gt;Observability in the Laravel ecosystem&lt;/h2&gt;
&lt;p&gt;Laravel has a capable logging system built on the Monolog library. Out of the box, it supports channels such as single files, daily rotated files, syslog and Slack, plus &lt;code&gt;stack&lt;/code&gt; channels that send one message to several channels at once.&lt;/p&gt;
&lt;h3&gt;Ship logs off the server&lt;/h3&gt;
&lt;p&gt;In production, configure Laravel to ship logs to a central service. Sending them to a service like Logstash, Sentry or Datadog means you don&apos;t lose data when a server instance is terminated.&lt;/p&gt;
&lt;h3&gt;Watch your queues&lt;/h3&gt;
&lt;p&gt;Monitoring a Laravel app means more than checking that the web server is up. Watch the health of your background queues too.&lt;/p&gt;
&lt;p&gt;If your Redis queue backs up, customers might not get order confirmation emails or account activation links. Tools like Laravel Pulse or Horizon give real-time monitoring for these app-level metrics.&lt;/p&gt;
&lt;h3&gt;Close the loop&lt;/h3&gt;
&lt;p&gt;A common pattern is to log exceptions to a dedicated tracker while watching the error rate on a dashboard. A spike in the &quot;Error Rate&quot; metric prompts you to check the &quot;Exception Logs&quot; for the actual stack trace.&lt;/p&gt;

Add a middleware that sets a `request_id` with `Log::withContext()` at the start of each request, so every log line in that request carries it.

&lt;h2&gt;Scaling Shopify apps with metrics and logs&lt;/h2&gt;
&lt;p&gt;High-scale Shopify apps need their own approach to logging and monitoring. They live at the mercy of external API &lt;a href=&quot;https://ansezz.com/blog/rate-limiting-vs-throttling/&quot;&gt;rate limits&lt;/a&gt; and webhook delivery speed.&lt;/p&gt;
&lt;p&gt;If your app handles thousands of webhooks per minute, you can&apos;t log every successful event to a text file. You will quickly run out of disk space.&lt;/p&gt;
&lt;h3&gt;Monitor the limits, log the failures&lt;/h3&gt;
&lt;p&gt;Instead, use monitoring to track the &quot;Webhook Success Rate&quot; and your API rate-limit use. Shopify&apos;s GraphQL Admin API meters calls by calculated query cost using a leaky bucket (on the Standard plan, your quota restores at 100 points per second, and a single query can&apos;t cost more than 1,000 points). The REST Admin API uses a request-based bucket. To see how fast a full sync can run inside those limits, use my &lt;a href=&quot;https://ansezz.com/tools/shopify-rate-limit-planner/&quot;&gt;Shopify rate limit planner&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Watch how close you run to those ceilings, then use logging to investigate the specific failed payloads when the success rate drops.&lt;/p&gt;
&lt;h3&gt;Agents need logs too&lt;/h3&gt;
&lt;p&gt;This matters even more for &lt;a href=&quot;https://ansezz.com/blog/agentic-commerce-shopify/&quot;&gt;agentic commerce&lt;/a&gt; apps where AI agents act on behalf of a merchant. If an agent fails to update an inventory count, you need the specific log to understand the logic failure.&lt;/p&gt;
&lt;p&gt;For Shopify Plus merchants, performance matters a lot. Monitoring the &quot;Time to First Byte&quot; (TTFB) of your app&apos;s embedded components makes sure you aren&apos;t slowing down the merchant&apos;s admin.&lt;/p&gt;
&lt;h2&gt;The DevOps synergy: linking logs and metrics&lt;/h2&gt;
&lt;p&gt;Mature engineering teams don&apos;t treat logging and monitoring as separate silos. They link them.&lt;/p&gt;
&lt;p&gt;When an alert fires in your monitoring tool, it should link straight to the logs for that timeframe and service.&lt;/p&gt;
&lt;h3&gt;Correlation IDs&lt;/h3&gt;
&lt;p&gt;This is often done with &quot;Correlation IDs.&quot; When a request enters your system, you give it a unique ID.&lt;/p&gt;
&lt;p&gt;That ID is attached to every log entry and trace written during the request. When a metric spikes, you filter the logs for that time window and follow the IDs to the requests that caused it.&lt;/p&gt;
&lt;h3&gt;Monitor your logs&lt;/h3&gt;
&lt;p&gt;You should also monitor your logs. Counting how often certain log patterns appear gives you new metrics.&lt;/p&gt;
&lt;p&gt;If &quot;Database connection lost&quot; shows up more than five times in a minute, turn that log event into a metric that triggers a high-priority alert.&lt;/p&gt;
&lt;figure&gt;

Pick one error message that always means trouble (for example &quot;Database connection lost&quot;) and create a log-based metric with an alert when it appears more than five times a minute.

&lt;h2&gt;Best practices for technical teams&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Automate everything:&lt;/strong&gt; your monitoring agents and logging drivers belong in your base server image or Dockerfile.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Log levels matter:&lt;/strong&gt; use &lt;code&gt;debug&lt;/code&gt; for local development, &lt;code&gt;info&lt;/code&gt; for general production events, and &lt;code&gt;error&lt;/code&gt; or &lt;code&gt;critical&lt;/code&gt; for things that need a human.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protect PII:&lt;/strong&gt; never log personal data like passwords, credit card numbers or auth tokens. Use log masking to strip sensitive data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Set retention policies:&lt;/strong&gt; metrics are small and can be kept for months. Logs are large and expensive, so balance cost against your need for history.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor the monitors:&lt;/strong&gt; make sure your monitoring system itself is healthy. A silent monitoring system is a dangerous liability.&lt;/li&gt;
&lt;/ol&gt;

- Monitoring detects that a problem exists. Logging explains why it happened.
- Metrics are numbers. Logs are detailed event records.
- Use structured JSON logging to make your data searchable and machine-readable.
- In Laravel, watch your queues so background tasks keep completing.
- In Shopify apps, track API rate limits as a primary health metric.
- Link logs and metrics with correlation IDs to cut Mean Time to Resolution (MTTR).
- Base monitoring on user-focused SLOs to avoid alert fatigue.

&lt;p&gt;If you&apos;re building observability for a Laravel or Shopify app, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams set up structured logs, SLO alerts and correlation IDs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How do you tell a noisy alert from a real system failure in your current production stack?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>observability</category><category>laravel</category><category>shopify</category><category>infrastructure</category></item><item><title>DevOps vs MLOps: key technical differences for 2026</title><link>https://ansezz.com/blog/devops-vs-mlops/</link><guid isPermaLink="true">https://ansezz.com/blog/devops-vs-mlops/</guid><description>The critical differences between DevOps and MLOps. How to automate software delivery and manage machine learning lifecycles for production.</description><pubDate>Fri, 05 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;DevOps ships code that behaves the same every day. MLOps ships models that quietly get worse as the world changes.&lt;/p&gt;

- DevOps treats code as the main artifact and relies on deterministic builds, tests and deployments.
- MLOps adds two moving parts, data and models, so it needs a third loop: Continuous Training (CT) on top of CI and CD.
- MLOps monitoring tracks statistical health (data drift, concept drift, accuracy) as well as system health (latency, errors).

&lt;p&gt;Shipping application code to production is difficult. Shipping a machine learning model that keeps performing accurately over time is much harder.&lt;/p&gt;
&lt;p&gt;You might have a perfectly automated pipeline that builds your Docker images and deploys them to a cluster in seconds.&lt;/p&gt;
&lt;h3&gt;Correct code, broken product&lt;/h3&gt;
&lt;p&gt;If your model starts making wrong predictions because consumer behavior changed, your automated deployment of &quot;correct&quot; code is shipping a broken product. That is the core friction between traditional software operations and machine learning operations.&lt;/p&gt;
&lt;h3&gt;What the comparison is really about&lt;/h3&gt;
&lt;p&gt;DevOps focuses on the reliability and speed of software delivery. It treats code as the primary artifact.&lt;/p&gt;
&lt;p&gt;MLOps takes the same principles and adds two volatile new variables: data and models. DevOps solves &quot;it works on my machine.&quot; MLOps solves &quot;it worked on last month&apos;s training data.&quot;&lt;/p&gt;
&lt;p&gt;Understanding this divide is essential for any team moving beyond simple heuristic-based software and into &lt;a href=&quot;https://ansezz.com/blog/category/ai/&quot;&gt;AI engineering&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;The core philosophy of DevOps&lt;/h2&gt;
&lt;p&gt;DevOps is built on the &lt;a href=&quot;https://ansezz.com/blog/ci-vs-cd/&quot;&gt;continuous integration and continuous delivery (CI/CD)&lt;/a&gt; pipeline. The goal is to shorten the development life cycle and ship changes continuously with high software quality.&lt;/p&gt;
&lt;h3&gt;A deterministic process&lt;/h3&gt;
&lt;p&gt;In a standard DevOps environment, like one running a &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Laravel application on Docker&lt;/a&gt;, the process is fairly deterministic.&lt;/p&gt;
&lt;p&gt;If the source code passes its unit tests, the integration tests succeed and the environment configuration is correct, the application should behave predictably in production.&lt;/p&gt;
&lt;h3&gt;Static artifacts&lt;/h3&gt;
&lt;p&gt;The artifacts are static. Once a binary or a container image is built, its internal logic does not change based on the data flowing through it.&lt;/p&gt;
&lt;p&gt;Technical teams use DevOps to manage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Source code:&lt;/strong&gt; versioning application logic in Git.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build automation:&lt;/strong&gt; compiling code and packaging it into artifacts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Infrastructure as Code (IaC):&lt;/strong&gt; using tools like Terraform or Pulumi to define servers and networks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Testing:&lt;/strong&gt; running automated suites to catch regressions in logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The emergence of MLOps&lt;/h2&gt;
&lt;p&gt;MLOps, or Machine Learning Operations, is a set of practices for deploying and maintaining machine learning models in production reliably and efficiently.&lt;/p&gt;
&lt;p&gt;Calling it &quot;DevOps for AI&quot; misses the point. It borrows the automation mindset, but the artifacts in MLOps are fundamentally different.&lt;/p&gt;
&lt;h3&gt;Three moving parts&lt;/h3&gt;
&lt;p&gt;A machine learning system has three distinct components: code, data and the model. In DevOps, you mostly care about the code.&lt;/p&gt;
&lt;p&gt;In MLOps, a change in the data can break the system even if the code is untouched. That brings a level of non-determinism traditional CI/CD pipelines are not designed to handle.&lt;/p&gt;
&lt;h3&gt;Data drift in the real world&lt;/h3&gt;
&lt;p&gt;If you are building &lt;a href=&quot;https://ansezz.com/blog/agentic-commerce-shopify/&quot;&gt;agentic commerce solutions on Shopify&lt;/a&gt;, your recommendation engine might fail without any bug in the Python script. The cause could be a shift in the distribution of customer purchases during a holiday sale.&lt;/p&gt;
&lt;p&gt;This is known as data drift, and it requires a lifecycle with continuous monitoring and retraining.&lt;/p&gt;
&lt;p&gt;The code didn&apos;t change. The world did, and the model never noticed.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Key technical differences at a glance&lt;/h2&gt;
&lt;p&gt;Here are the main technical distinctions between the two methodologies.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;DevOps&lt;/th&gt;
&lt;th&gt;MLOps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary artifact&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Source code and binaries&lt;/td&gt;
&lt;td&gt;Code, datasets, and model weights&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lifecycle&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Build, test, deploy&lt;/td&gt;
&lt;td&gt;Data prep, train, evaluate, deploy, monitor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Unit and integration tests&lt;/td&gt;
&lt;td&gt;Model validation, accuracy metrics, bias checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Static (service/binary)&lt;/td&gt;
&lt;td&gt;Dynamic (model endpoint or batch job)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Monitoring&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Latency, CPU, error rates&lt;/td&gt;
&lt;td&gt;Data drift, model decay, precision, recall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Feedback loop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Code bug fixes&lt;/td&gt;
&lt;td&gt;Continuous retraining (CT)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;The CI/CD/CT pipeline&lt;/h2&gt;
&lt;p&gt;The main architectural difference is a third loop. DevOps relies on CI (Continuous Integration) and CD (Continuous Delivery). MLOps adds CT (Continuous Training).&lt;/p&gt;
&lt;h3&gt;Continuous Integration (CI) in MLOps&lt;/h3&gt;
&lt;p&gt;CI here tests the data as well as the code. You must validate the schema of incoming datasets and make sure feature engineering logic is the same in the training environment and in production.&lt;/p&gt;
&lt;p&gt;A mismatch leads to training-serving skew, a common reason for model failure.&lt;/p&gt;
&lt;h3&gt;Continuous Delivery (CD) in MLOps&lt;/h3&gt;
&lt;p&gt;CD covers the automated deployment of the model service. This often means deploying a prediction API or updating a weights file in a running inference engine.&lt;/p&gt;
&lt;p&gt;Because models are large and expensive to run, MLOps pipelines often use canary deployments or shadow testing to check performance on live data before a full rollout.&lt;/p&gt;
&lt;h3&gt;Continuous Training (CT)&lt;/h3&gt;
&lt;p&gt;This is the signature of MLOps. A CT pipeline triggers a retraining job when certain conditions are met, either on a schedule or when performance degrades.&lt;/p&gt;
&lt;p&gt;The pipeline pulls new data, runs the training script, evaluates the new model version against a benchmark and registers it in a model registry if it passes.&lt;/p&gt;

  &lt;div&gt;Commit, build, test, deploy. A new release only happens when someone changes the code.&lt;/div&gt;
  &lt;div&gt;Commit, build, test, deploy, plus validate data, retrain, evaluate and register. A new model can ship because the data changed.&lt;/div&gt;


Add one data check to your existing CI: validate the schema of the training or feature dataset (column names, types, null rates) and fail the build when it changes unexpectedly.

&lt;h2&gt;Monitoring and the problem of drift&lt;/h2&gt;
&lt;p&gt;In traditional &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;DevOps&lt;/a&gt;, monitoring centers on system health. You watch memory usage, response times and HTTP 500 errors. If the server is up and the code runs, the system is usually considered &quot;healthy.&quot;&lt;/p&gt;
&lt;h3&gt;Healthy server, failing model&lt;/h3&gt;
&lt;p&gt;In MLOps, system health is only half the story. You also need to monitor statistical health.&lt;/p&gt;
&lt;p&gt;A model might return a &quot;200 OK&quot; status code with 50ms latency, but if its predictions are nonsensical, the system is failing.&lt;/p&gt;
&lt;h3&gt;Two kinds of drift&lt;/h3&gt;
&lt;p&gt;There are two main types of drift that MLOps engineers must track:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Data drift:&lt;/strong&gt; the input data distribution changes. For example, a model trained on high-end fashion data might struggle if the store expands into budget streetwear.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concept drift:&lt;/strong&gt; the relationship between input and output changes. For instance, what counted as a &quot;normal&quot; credit card transaction in 2019 might look very different during a global supply chain crisis.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Close the feedback loop&lt;/h3&gt;
&lt;p&gt;Detecting drift requires careful logging of every prediction and its eventual outcome. That creates a feedback loop that informs the next training cycle, a step often missed in early-stage &lt;a href=&quot;https://ansezz.com/blog/ai-vs-traditional-development/&quot;&gt;AI development&lt;/a&gt;.&lt;/p&gt;

Start logging every prediction with its input features and a request ID, then join the real outcome back to it later. Without that table, you can&apos;t measure drift at all.

&lt;h2&gt;Tooling and infrastructure&lt;/h2&gt;
&lt;p&gt;The toolsets for these two fields are moving apart. Docker and Kubernetes are shared, but the special needs of machine learning have created a new stack.&lt;/p&gt;
&lt;h3&gt;Standard DevOps tools&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GitHub Actions / GitLab CI:&lt;/strong&gt; pipeline orchestration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker:&lt;/strong&gt; containerization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Terraform:&lt;/strong&gt; infrastructure provisioning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prometheus / Grafana:&lt;/strong&gt; system monitoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;What MLOps adds&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MLflow / Weights &amp;amp; Biases:&lt;/strong&gt; experiment tracking and model versioning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kubeflow / Vertex AI:&lt;/strong&gt; ML-specific orchestration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feature stores:&lt;/strong&gt; central repositories for pre-processed data features.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Evidently AI / Arize:&lt;/strong&gt; statistical monitoring and drift detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Building a bridge between these tools is the mark of a mature technical organization. You need the stability of DevOps to host the infrastructure and the flexibility of MLOps to manage the intelligence layer.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Bridging the gap in production&lt;/h2&gt;
&lt;p&gt;For teams running complex web applications, the goal is integration, not picking one side.&lt;/p&gt;
&lt;p&gt;A modern stack might use a Laravel backend for user management, hosted on a &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;Coolify-managed VPS&lt;/a&gt;, while calling an MLOps-managed &lt;a href=&quot;https://ansezz.com/blog/training-vs-inference/&quot;&gt;inference endpoint&lt;/a&gt; for personalized content.&lt;/p&gt;
&lt;h3&gt;Version your data&lt;/h3&gt;
&lt;p&gt;One practical way to start is versioning your datasets. You would never deploy code without a commit hash, so never train a model without knowing exactly which version of the data was used.&lt;/p&gt;
&lt;p&gt;This makes results reproducible, which is the first step toward a working MLOps workflow.&lt;/p&gt;
&lt;h3&gt;Treat retrieval as infrastructure&lt;/h3&gt;
&lt;p&gt;The same rigor applies to retrieval systems. Treat vector databases and retrieval pipelines as managed infrastructure inside your DevOps workflow, not as ad-hoc scripts.&lt;/p&gt;
&lt;p&gt;That discipline alone heads off many of the &lt;a href=&quot;https://ansezz.com/blog/7-rag-mistakes-production/&quot;&gt;RAG failures&lt;/a&gt; teams hit in production.&lt;/p&gt;

Tag your next training run with the dataset version or hash it used, and store that tag in the model registry entry. If you can&apos;t reproduce a model from its tag, fix that before adding more tooling.


- **DevOps is about code reliability:** CI/CD pipelines, automated testing and deterministic deployments.
- **MLOps is about model reliability:** data validation, experiment tracking and statistical monitoring.
- **The CT loop is essential:** continuous training keeps models from going stale as real-world data changes.
- **Monitoring must cover two layers:** system metrics (latency, errors) and model metrics (drift, accuracy).
- **Tooling is specialized:** standard DevOps tools for hosting, MLOps tools for training and the registry.
- **Data is an artifact:** version your training data with the same rigor you apply to source code.

&lt;p&gt;If you&apos;re adding models to a product that already ships with CI/CD, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams build MLOps pipelines with drift monitoring and retraining&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How do you plan to handle the statistical monitoring of your models once they move from a static environment into the unpredictable flow of production data?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>devops</category><category>machine-learning</category><category>ai-engineering</category><category>ci-cd</category></item><item><title>CDN vs cache: why your high-traffic site needs both</title><link>https://ansezz.com/blog/cdn-vs-cache/</link><guid isPermaLink="true">https://ansezz.com/blog/cdn-vs-cache/</guid><description>CDN and cache solve different problems: distance vs repeated work. How to layer edge delivery and server-side caching for high-traffic sites.</description><pubDate>Tue, 02 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A cache stops your server from doing the same work twice. A CDN stops your data from crossing the world twice. A high-traffic site needs both.&lt;/p&gt;

- Caching is a technique: store the result of expensive work (queries, rendered fragments, assets) so you don&apos;t repeat it.
- A CDN is a global network of edge servers that applies caching close to the user, which cuts the distance and latency of each request.
- Layer them (browser, CDN edge, server cache, database) and plan purging from day one, or users will see stale data.

&lt;p&gt;High-traffic applications often collapse under the weight of redundant data requests.&lt;/p&gt;
&lt;p&gt;Every time a user in London requests a file from a server in New York, the latency hurts the user experience and drains your server resources.&lt;/p&gt;
&lt;p&gt;If you do not optimize how data is stored and delivered, your infrastructure costs will climb while your performance plateaus.&lt;/p&gt;
&lt;h3&gt;Two tools, two jobs&lt;/h3&gt;
&lt;p&gt;Many developers use &quot;CDN&quot; and &quot;cache&quot; interchangeably, but they serve different masters in the stack.&lt;/p&gt;
&lt;p&gt;The CDN-vs-cache decision is rarely either/or. Getting a global CDN and local caching to work together is what keeps a high-traffic site fast under load.&lt;/p&gt;
&lt;h2&gt;The fundamental speed gap&lt;/h2&gt;
&lt;p&gt;Latency is the silent killer of conversion rates. A standard request involves multiple round-trips between the client and the origin server.&lt;/p&gt;
&lt;p&gt;If the data has to cross the Atlantic, physical distance imposes a speed limit that no amount of code optimization can fix.&lt;/p&gt;
&lt;p&gt;This is a latency problem, not a bandwidth one. A &lt;a href=&quot;https://ansezz.com/blog/bandwidth-vs-throughput/&quot;&gt;wider pipe won&apos;t fix the lag&lt;/a&gt; when the bottleneck is round-trip distance.&lt;/p&gt;
&lt;h3&gt;Closer to the work, closer to the user&lt;/h3&gt;
&lt;p&gt;Caching keeps data closer to the execution point. A CDN keeps that cache closer to the user.&lt;/p&gt;
&lt;p&gt;When the two work together, they form a multi-layered shield that protects your origin server from unnecessary load.&lt;/p&gt;
&lt;p&gt;Code can&apos;t beat the speed of light. Only a closer server can.&lt;/p&gt;
&lt;h2&gt;Understanding the cache hierarchy&lt;/h2&gt;
&lt;p&gt;Caching is the temporary storage of data for faster retrieval. It is not limited to one location. In a modern stack, caching happens at several layers so the most expensive operations are never repeated.&lt;/p&gt;
&lt;p&gt;The most common layers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Browser cache.&lt;/strong&gt; Assets like CSS, JS and images are stored on the user&apos;s device. Repeat visits feel instant.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server cache.&lt;/strong&gt; Tools like Redis or Memcached keep database query results and computed objects in memory, so the app doesn&apos;t hit the database for every request. The same in-memory layer powers more advanced patterns too, like &lt;a href=&quot;https://ansezz.com/blog/redis-semantic-caching-rag/&quot;&gt;semantic caching in RAG pipelines&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application cache.&lt;/strong&gt; Frameworks like &lt;a href=&quot;https://ansezz.com/blog/category/laravel/&quot;&gt;Laravel&lt;/a&gt; have built-in ways to cache entire HTML fragments or API responses.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The trade&lt;/h3&gt;
&lt;p&gt;The goal of caching is to reduce the workload on your primary infrastructure. By storing the result of a complex calculation or a heavy query, you trade a small amount of memory for a large gain in response time.&lt;/p&gt;

Turn on slow query logging for a day and list the five queries that run most often with the same parameters. Those are your first server-cache candidates.

&lt;h2&gt;The global reach of CDNs&lt;/h2&gt;
&lt;p&gt;A CDN is a specialized cache that lives at the &quot;edge&quot; of the network.&lt;/p&gt;
&lt;p&gt;A standard cache might live on your main server. A CDN is a globally distributed network of servers that hosts your content in dozens of locations at once.&lt;/p&gt;
&lt;h3&gt;How a CDN request works&lt;/h3&gt;
&lt;p&gt;When a user visits your site, the CDN intercepts the request, acting as a &lt;a href=&quot;https://ansezz.com/blog/forward-proxy-vs-reverse-proxy/&quot;&gt;reverse proxy&lt;/a&gt; in front of your origin.&lt;/p&gt;
&lt;p&gt;If the requested asset is already stored at the edge server closest to the user, it is served immediately, without the trip back to your origin. This matters most for static assets like images, video files and large JavaScript bundles.&lt;/p&gt;
&lt;h3&gt;Shopify&apos;s built-in CDN&lt;/h3&gt;
&lt;p&gt;For businesses on &lt;a href=&quot;https://ansezz.com/blog/category/shopify/&quot;&gt;Shopify&lt;/a&gt;, the platform handles much of this CDN logic automatically. Its CDN (backed by Cloudflare) ships on every plan, not only Plus.&lt;/p&gt;
&lt;p&gt;Even so, understanding how to manage cache headers and purge cycles remains a key skill for custom development.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Technical comparison: CDN vs cache&lt;/h2&gt;
&lt;p&gt;To choose the right tool, you need to know where each one excels.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Local/Server Cache&lt;/th&gt;
&lt;th&gt;Content Delivery Network (CDN)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reduce CPU and database load.&lt;/td&gt;
&lt;td&gt;Reduce network latency and distance.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;On or near the origin server.&lt;/td&gt;
&lt;td&gt;At the network edge (Points of Presence).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scope&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Often specific to a single server or user.&lt;/td&gt;
&lt;td&gt;Shared across many users globally.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ownership&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Part of your application infrastructure.&lt;/td&gt;
&lt;td&gt;Typically a third-party service provider.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best For&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;DB queries, session data, fragments.&lt;/td&gt;
&lt;td&gt;Images, JS, CSS, static HTML, video.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Caching is about how data is stored. A CDN is about where that data is distributed.&lt;/p&gt;
&lt;h2&gt;Implementation in Laravel and Shopify&lt;/h2&gt;
&lt;p&gt;How you implement this depends on your stack.&lt;/p&gt;
&lt;h3&gt;Laravel&lt;/h3&gt;
&lt;p&gt;In a &lt;a href=&quot;https://ansezz.com/blog/category/laravel/&quot;&gt;Laravel environment&lt;/a&gt;, you manage caching through a unified API that supports multiple drivers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Example of caching a database query in Laravel
$users = Cache::remember(&apos;active_users&apos;, 3600, function () {
    return DB::table(&apos;users&apos;)-&amp;gt;where(&apos;active&apos;, true)-&amp;gt;get();
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This queries the database only once per hour for this data.&lt;/p&gt;
&lt;p&gt;To go further, configure your web server to set &lt;code&gt;Cache-Control&lt;/code&gt; headers that a CDN like Cloudflare or Akamai can interpret. My &lt;a href=&quot;https://ansezz.com/tools/http-headers/&quot;&gt;HTTP headers cheat sheet&lt;/a&gt; lists the caching headers with real example values.&lt;/p&gt;

Run `curl -I` against one image, one JS bundle and one HTML page on your site. Check the `Cache-Control` value and the CDN&apos;s cache status header on each, and fix any static asset that says `no-cache`.

&lt;h3&gt;Shopify&lt;/h3&gt;
&lt;p&gt;In &lt;a href=&quot;https://ansezz.com/blog/category/shopify/&quot;&gt;Shopify development&lt;/a&gt;, you rely heavily on the platform&apos;s native CDN. Shopify uses a large edge network to serve product images and storefront assets.&lt;/p&gt;
&lt;p&gt;When you build custom apps or headless storefronts, though, you must manage how your API responses are cached yourself to avoid performance bottlenecks.&lt;/p&gt;
&lt;h2&gt;Using both for maximum scale&lt;/h2&gt;
&lt;p&gt;The most resilient architectures combine a &quot;cache-aside&quot; pattern with an edge delivery strategy. This creates a multi-step defense for your origin server:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The edge shield.&lt;/strong&gt; The CDN handles most incoming traffic for static files and common public pages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The server shield.&lt;/strong&gt; For requests that reach the origin, a server-side cache (like Redis) returns data without hitting the database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The database shield.&lt;/strong&gt; Proper indexing and internal database caching provide a final layer of optimization.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This layered approach is essential for &lt;a href=&quot;https://ansezz.com/blog/category/devops/&quot;&gt;modern DevOps&lt;/a&gt;. Even during a massive traffic spike, like a Black Friday sale or a viral product launch, your core application stays responsive. For the application tier itself, see how &lt;a href=&quot;https://ansezz.com/blog/laravel-octane-high-traffic/&quot;&gt;Laravel Octane handles high traffic&lt;/a&gt;.&lt;/p&gt;

  &lt;div&gt;Every visitor&apos;s request travels to the origin, runs the same queries and renders the same page. A traffic spike hits the database directly.&lt;/div&gt;
  &lt;div&gt;The CDN answers most requests at the edge, Redis answers most of the rest, and only cache misses reach an indexed database.&lt;/div&gt;

&lt;figure&gt;
&lt;h2&gt;Common pitfalls to avoid&lt;/h2&gt;
&lt;p&gt;Running two caching systems brings the challenge of cache invalidation.&lt;/p&gt;
&lt;p&gt;If you update a product price in your database but the CDN still serves a cached version of the page, you will face customer service issues.&lt;/p&gt;
&lt;h3&gt;Build a purge strategy&lt;/h3&gt;
&lt;p&gt;When data changes on your origin, you need a way to clear both your internal cache and the matching edge cache on your CDN.&lt;/p&gt;
&lt;p&gt;Many developers use webhooks or event listeners to automate this. Users then see accurate data without you giving up speed.&lt;/p&gt;

Change one product price in staging and time how long it takes to show up on the live page through the CDN. If the answer is &quot;until the TTL expires,&quot; wire a purge call into the save event.


- **Caching** is the technique of storing data temporarily to avoid repeating expensive operations.
- **A CDN** is a network of servers that use caching to deliver content from a location physically close to the user.
- **Distance matters.** A CDN reduces the travel time of data, while a local cache reduces the processing time.
- **Use both.** Cache database results on the server and serve static assets from a CDN.
- **Invalidation is key.** Make sure you can purge outdated data from all layers together to keep data accurate.

&lt;p&gt;If your site slows down every time traffic spikes, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams layer CDN and server caching for high traffic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How do you handle cache invalidation across multiple edge locations when your application data changes in real time?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>networking</category><category>redis</category><category>performance</category><category>laravel</category><category>shopify</category><category>infrastructure</category></item><item><title>CI vs CD: automating quality and delivery</title><link>https://ansezz.com/blog/ci-vs-cd/</link><guid isPermaLink="true">https://ansezz.com/blog/ci-vs-cd/</guid><description>Continuous Integration vs Continuous Delivery explained. How to automate the path from commit to production for Laravel backends and Shopify storefronts.</description><pubDate>Tue, 02 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;CI proves your code works. CD gets that working code to users without a human copying files at midnight.&lt;/p&gt;

- Continuous Integration builds and tests every push, so integration bugs show up in minutes instead of at release time.
- Continuous Delivery keeps every passing build ready to ship behind a manual button. Continuous Deployment removes the button.
- For Laravel, that means a clean-room test pipeline. For Shopify, it means theme checks and deploying to an unpublished theme before you swap it live.

&lt;p&gt;Shipping a broken build to production is an expensive way to learn your local environment isn&apos;t a mirror of reality.&lt;/p&gt;
&lt;p&gt;For developers on Laravel backends or Shopify storefronts, the gap between &quot;it works on my machine&quot; and a stable release is often filled with manual steps that invite human error.&lt;/p&gt;
&lt;p&gt;Manual FTP uploads, SSHing into servers to run migrations, or publishing Shopify themes by hand are risks modern engineering cannot afford.&lt;/p&gt;
&lt;h3&gt;Two pillars&lt;/h3&gt;
&lt;p&gt;Continuous Integration (CI) and Continuous Delivery (CD) remove this uncertainty. By automating the path from a commit to a live environment, teams ship faster while making their applications more stable.&lt;/p&gt;
&lt;p&gt;This guide breaks down the core differences between CI and CD and how to apply them to modern stacks.&lt;/p&gt;
&lt;h2&gt;Defining Continuous Integration (CI)&lt;/h2&gt;
&lt;p&gt;Continuous Integration is the practice of merging every developer&apos;s working copy into a shared mainline several times a day.&lt;/p&gt;
&lt;p&gt;In a Laravel or Vue.js environment, every push to a branch makes an automated system build the application and run a suite of tests.&lt;/p&gt;
&lt;h3&gt;Catching integration hell early&lt;/h3&gt;
&lt;p&gt;The goal of CI is to catch &quot;integration hell&quot; before it happens. Instead of finding out at a weekly release that two developers changed the same core service, the pipeline flags the conflict within minutes.&lt;/p&gt;
&lt;p&gt;A standard CI pipeline for a Laravel application includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dependency management:&lt;/strong&gt; installing Composer and NPM packages so the environment is fresh.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Static analysis:&lt;/strong&gt; running tools like PHPStan or Laravel Pint to enforce code quality and style.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated testing:&lt;/strong&gt; running unit and feature tests with PHPUnit or Pest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security audits:&lt;/strong&gt; scanning third-party dependencies for known vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the time a pull request is ready for review, CI has already given a &quot;green light&quot; that the code is syntactically correct and doesn&apos;t break any behavior your tests cover.&lt;/p&gt;

Open your last five merged pull requests and check which of the four steps above actually ran on each. Any missing step is the next job to add to your pipeline.

&lt;h2&gt;Defining Continuous Delivery and Deployment (CD)&lt;/h2&gt;
&lt;p&gt;CI focuses on the quality of the code. CD focuses on the delivery of that code. Two flavors of CD often get confused.&lt;/p&gt;
&lt;h3&gt;Continuous Delivery&lt;/h3&gt;
&lt;p&gt;Every build that passes the CI pipeline is ready to deploy to production, but the actual release needs a manual trigger.&lt;/p&gt;
&lt;p&gt;This is common in regulated industries, or for high-stakes storefronts where a marketing manager wants to time a release.&lt;/p&gt;
&lt;h3&gt;Continuous Deployment&lt;/h3&gt;
&lt;p&gt;This removes the manual trigger. Every change that passes the pipeline goes to production automatically.&lt;/p&gt;
&lt;p&gt;It demands deep confidence in your test suite and the &lt;a href=&quot;https://ansezz.com/blog/logging-vs-monitoring/&quot;&gt;observability to catch regressions fast&lt;/a&gt;. Without it, a bad commit reaches users before anyone notices.&lt;/p&gt;

  &lt;div&gt;Every green build is packaged and ready. A person presses the release button when the timing is right.&lt;/div&gt;
  &lt;div&gt;Every green build goes live on its own. Tests and monitoring are the only gate.&lt;/div&gt;

&lt;h3&gt;Self-hosted CD with Coolify&lt;/h3&gt;
&lt;p&gt;For developers using &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;Coolify for self-hosted SaaS&lt;/a&gt;, CD is the engine behind rapid iteration. Once CI passes, Coolify can pull the latest Docker image and update the running containers with zero downtime.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;CI vs CD: the core differences&lt;/h2&gt;
&lt;p&gt;The main difference is scope and goal. CI is about the developer&apos;s experience and code integrity. CD is about the user&apos;s experience and the release process.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Continuous Integration (CI)&lt;/th&gt;
&lt;th&gt;Continuous Delivery (CD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detect bugs and integration issues early.&lt;/td&gt;
&lt;td&gt;Ensure code is always in a releasable state.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Trigger&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Triggered by every code commit or push.&lt;/td&gt;
&lt;td&gt;Triggered after CI passes successfully.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Key output&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A validated code base and test reports.&lt;/td&gt;
&lt;td&gt;A deployable artifact (Docker image, ZIP, etc.).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Manual step&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fully automated process.&lt;/td&gt;
&lt;td&gt;Manual approval (Delivery) or fully automated (Deployment).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In 2026, the lines are blurring as tools become more integrated. Most teams treat CI and CD as one pipeline where code flows from a developer&apos;s IDE into staging or production.&lt;/p&gt;
&lt;p&gt;CI asks &quot;is this code good?&quot; CD asks &quot;can users have it now?&quot;&lt;/p&gt;
&lt;h2&gt;Implementing CI for Laravel applications&lt;/h2&gt;
&lt;p&gt;Laravel gives you a solid base for CI because of its built-in testing tools. When you set up a pipeline, aim for a &quot;clean room&quot; environment: pin the same PHP and MySQL versions you run in production.&lt;/p&gt;
&lt;p&gt;A typical GitHub Actions workflow for Laravel might look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: Laravel CI

on: [push, pull_request]

jobs:
  laravel-tests:
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:8.4
        env:
          MYSQL_DATABASE: testing
          MYSQL_ALLOW_EMPTY_PASSWORD: &quot;yes&quot;
        ports:
          - 3306:3306
        options: &amp;gt;-
          --health-cmd=&quot;mysqladmin ping&quot;
          --health-interval=10s --health-timeout=5s --health-retries=5

    steps:
      - uses: actions/checkout@v7
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: &quot;8.5&quot;
      - name: Install Dependencies
        run: composer install --prefer-dist --no-interaction
      - name: Execute Tests
        run: vendor/bin/phpunit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With branch protection requiring this check, no code merges into main unless it passes every test case. That safety net lets the team move fast without fear of breaking core application logic.&lt;/p&gt;

Turn on branch protection for `main` and mark your CI job as a required status check. Until you do, a red build is only a suggestion.

&lt;h2&gt;CD best practices for Shopify storefronts&lt;/h2&gt;
&lt;p&gt;Shopify development has traditionally meant editing themes in the browser. With the rise of &lt;a href=&quot;https://ansezz.com/blog/agentic-commerce-shopify/&quot;&gt;agentic commerce on Shopify&lt;/a&gt;, the need for real CI/CD is much higher.&lt;/p&gt;
&lt;p&gt;For Shopify, CD is about managing &quot;theme versions&quot; rather than server binaries. With the Shopify CLI, you can automate theme deployments to different environments:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Staging stores.&lt;/strong&gt; Always deploy to a development or staging store first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Theme checks.&lt;/strong&gt; Run &lt;code&gt;shopify theme check&lt;/code&gt; in your CI pipeline to catch Liquid errors before they go live.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atomic deploys.&lt;/strong&gt; Push your code to a new, unpublished theme ID. Once verified, use the CLI to publish it as the live theme.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Why the atomic swap matters&lt;/h3&gt;
&lt;p&gt;The cutover is instant, so customers never see a half-deployed storefront. It is a blue-green style of deployment for e-commerce.&lt;/p&gt;
&lt;p&gt;A broken layout or a missing &quot;Add to Cart&quot; button caused by a Liquid syntax error never reaches the live store.&lt;/p&gt;

Add `shopify theme check` as a CI step on your theme repo, then do your next release by pushing to an unpublished theme and publishing it from the CLI instead of the theme editor.

&lt;figure&gt;
&lt;h2&gt;Going beyond unit tests&lt;/h2&gt;
&lt;p&gt;CI/CD pays off most when you move past simple tests and add more advanced checks.&lt;/p&gt;
&lt;p&gt;Modern pipelines in 2026 often include visual regression testing. The system takes screenshots of the UI and compares them to the previous version to catch unintended layout shifts.&lt;/p&gt;
&lt;h3&gt;Pipelines for AI-backed apps&lt;/h3&gt;
&lt;p&gt;For teams building &lt;a href=&quot;https://ansezz.com/blog/api-gateway-ai-stack/&quot;&gt;API gateways for the AI stack&lt;/a&gt;, CI/CD is non-negotiable.&lt;/p&gt;
&lt;p&gt;When your application relies on LLMs or external APIs, the pipeline must include integration tests that confirm those connections still work and behave as expected. If agents write part of your code, see the &lt;a href=&quot;https://ansezz.com/blog/testing-ai-generated-code/&quot;&gt;gate I run on AI-authored PRs&lt;/a&gt;.&lt;/p&gt;

- **CI is for quality.** Run tests, lint code and check for security vulnerabilities on every push.
- **CD is for delivery.** Automate packaging and deployment to staging or production.
- **Speed is a feature.** A CI pipeline that takes 30 minutes is a pipeline developers will try to bypass.
- **Immutable artifacts.** Build once (e.g., a Docker image) and promote that same artifact through staging and production.
- **Zero downtime.** Use blue-green deployments or symlink swaps so users aren&apos;t interrupted during a release.
- **Shift left.** Move security and quality checks as early as possible to cut the cost of fixing bugs.

&lt;p&gt;If your deployment process still involves a checklist a human has to follow, you aren&apos;t doing CD. Automation is the only way to scale a software business without scaling production outages.&lt;/p&gt;
&lt;p&gt;If you want your Laravel or Shopify releases to go from commit to production without the manual checklist, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams automate delivery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;How much time does your team spend manually verifying releases before they go live?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>devops</category><category>ci-cd</category><category>laravel</category><category>shopify</category></item><item><title>Ditch expensive cloud providers for self-hosted SaaS</title><link>https://ansezz.com/blog/coolify-self-hosted-saas/</link><guid isPermaLink="true">https://ansezz.com/blog/coolify-self-hosted-saas/</guid><description>The cloud tax kills SaaS margins early. How self-hosted Coolify on cheap ARM instances at Hetzner or Oracle slashes a $500 AWS bill toward zero.</description><pubDate>Sat, 30 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Most SaaS founders overpay their cloud provider without noticing. The &quot;cloud tax&quot; eats your margins before you even find product-market fit.&lt;/p&gt;

- Managed cloud starts cheap with credits, then bills you for idle databases, NAT gateways and complexity you don&apos;t need yet.
- Coolify gives you a self-hosted, git-push PaaS on your own server, with automatic SSL, one-click databases and PR previews.
- ARM servers make it cheaper still: a small app can run on a Hetzner ARM box for about $13.50 a month, or on Oracle&apos;s Always Free tier.

&lt;p&gt;We have been conditioned to believe that unless our small CRUD app runs on a multi-region, auto-scaling AWS EKS cluster, we are doing it wrong.&lt;/p&gt;
&lt;p&gt;That is a lie designed to keep you paying for complexity you do not need.&lt;/p&gt;
&lt;h2&gt;The architecture of a trap&lt;/h2&gt;
&lt;p&gt;It starts innocently enough. You sign up for AWS or GCP because they give you $1,000 in credits.&lt;/p&gt;
&lt;p&gt;You spin up an RDS instance for your database, a few S3 buckets for storage, and maybe a managed Kubernetes service because it feels &quot;professional.&quot;&lt;/p&gt;
&lt;p&gt;Then the credits run out.&lt;/p&gt;
&lt;h3&gt;The bill after the credits&lt;/h3&gt;
&lt;p&gt;Suddenly you are paying $200 a month for a database that is 99% idle. You are paying for NAT gateways, provisioned IOPS and &quot;management fees&quot; for services that could easily run on a cheap VPS.&lt;/p&gt;
&lt;p&gt;You are stuck in a web of proprietary APIs and IAM roles that need a full-time DevOps engineer just to update an environment variable.&lt;/p&gt;
&lt;h3&gt;A golden cage&lt;/h3&gt;
&lt;p&gt;Managed services feel like a superpower at the start, but they become a golden cage as you scale. The complexity overhead alone can slow your development velocity to a crawl.&lt;/p&gt;
&lt;p&gt;When I look at how &lt;a href=&quot;https://ansezz.com/blog/ai-vs-traditional-development/&quot;&gt;AI is changing traditional development&lt;/a&gt;, it is clear we need to move faster, not get bogged down in infrastructure molasses.&lt;/p&gt;

Sort your cloud bill by service and flag anything you pay for that runs under 10% utilization most of the month. That list is what a single self-hosted server can absorb.

&lt;h2&gt;Enter Coolify: Heroku&apos;s open-source soulmate&lt;/h2&gt;
&lt;p&gt;The tool I have moved my entire stack to is Coolify.&lt;/p&gt;
&lt;p&gt;Coolify is an open-source, self-hostable alternative to Vercel, Heroku and Netlify. It gives you the same &quot;git push to deploy&quot; experience, but it runs on your own hardware.&lt;/p&gt;
&lt;p&gt;Whether you have a small ARM VPS on Hetzner (the CAX11 starts around €6/month) or a free ARM instance on Oracle Cloud, Coolify turns it into a private PaaS.&lt;/p&gt;
&lt;h3&gt;A mindset shift&lt;/h3&gt;
&lt;p&gt;I recently wrote about how &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify and Docker are changing SaaS hosting&lt;/a&gt;, but the shift goes deeper than a tool change. It is a move toward technical sovereignty.&lt;/p&gt;
&lt;h3&gt;Why Coolify works for engineers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero vendor lock-in.&lt;/strong&gt; Your configurations are stored on your server. If Coolify disappeared tomorrow, your Docker containers would keep running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic SSL.&lt;/strong&gt; It handles Let&apos;s Encrypt out of the box. No more messing with Nginx configs or certbot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database management.&lt;/strong&gt; You can spin up Postgres, MySQL, Redis or MongoDB in one click. They run as containers on your server, so you pay $0 in additional managed service fees.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pull request deployments.&lt;/strong&gt; It creates temporary environments for every PR, like Vercel, but without the &quot;team seat&quot; tax.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;h2&gt;The magic of ARM (Graviton and OCI)&lt;/h2&gt;
&lt;p&gt;Once you have self-hosting in place, ARM is the multiplier that takes the bill from &quot;cheap&quot; to &quot;almost free.&quot; Stop renting x86 and start renting ARM.&lt;/p&gt;
&lt;h3&gt;What AWS says about Graviton&lt;/h3&gt;
&lt;p&gt;AWS says its Graviton instances cost up to 20% less than comparable x86 instances.&lt;/p&gt;
&lt;h3&gt;Oracle&apos;s Always Free tier&lt;/h3&gt;
&lt;p&gt;The real &quot;cheat code&quot; right now is Oracle Cloud Infrastructure (OCI). Its &quot;Always Free&quot; tier gives you 2 ARM Ampere A1 OCPUs and 12 GB of RAM at no cost, forever.&lt;/p&gt;
&lt;p&gt;(Oracle halved this from 4 OCPUs / 24 GB in mid-2026, so size accordingly.) I can run a small production workload (frontend, backend, database and Redis) on that single free instance using Coolify.&lt;/p&gt;
&lt;h3&gt;The math changes&lt;/h3&gt;
&lt;p&gt;When you pair ARM efficiency with a self-hosted orchestrator, the math changes. A startup paying $500/month on AWS can often move that entire workload to a sub-$15/month ARM instance on Hetzner, or to OCI&apos;s free tier outright.&lt;/p&gt;
&lt;p&gt;That difference goes straight back into your runway or your marketing budget.&lt;/p&gt;
&lt;p&gt;Rent ARM, run Coolify, and keep the difference as runway.&lt;/p&gt;
&lt;h2&gt;Docker and Nix: the engine room&lt;/h2&gt;
&lt;p&gt;Coolify relies heavily on Docker, which is the industry standard for a reason. It makes sure that what works on my machine works on the server.&lt;/p&gt;
&lt;p&gt;As I move deeper into the &quot;vibe coding&quot; era, I&apos;m also looking at how technologies like Nix can make our environments even more stable.&lt;/p&gt;
&lt;h3&gt;Reproducible environments for agents&lt;/h3&gt;
&lt;p&gt;Using Nix flakes to define the development environment and Docker to package the runtime gives you a repeatable deployment pipeline.&lt;/p&gt;
&lt;p&gt;When I use tools like the &lt;a href=&quot;https://ansezz.com/blog/mcp-context-aware-agents/&quot;&gt;Model Context Protocol (MCP)&lt;/a&gt;, I want my AI agents to have a clear, reproducible environment to work in. Self-hosting doesn&apos;t mean &quot;unprofessional.&quot; It means total control over the stack.&lt;/p&gt;
&lt;h2&gt;Comparison: the hidden cost of &quot;easy&quot;&lt;/h2&gt;
&lt;p&gt;Let&apos;s look at the numbers for a standard Laravel or Node.js app with a database and a background worker.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line item&lt;/th&gt;
&lt;th&gt;Managed path (Vercel + Supabase + AWS S3)&lt;/th&gt;
&lt;th&gt;Coolify path (Hetzner VPS)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hosting&lt;/td&gt;
&lt;td&gt;Vercel Pro: $20/month per developer seat&lt;/td&gt;
&lt;td&gt;4 vCPU ARM / 8GB RAM (CAX21): ~$12.50/month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;Supabase Pro: $25/month&lt;/td&gt;
&lt;td&gt;Included (container on the VPS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage / backups&lt;/td&gt;
&lt;td&gt;AWS S3 + bandwidth: $15/month&lt;/td&gt;
&lt;td&gt;Backups to S3-compatible storage: $1/month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform&lt;/td&gt;
&lt;td&gt;Included&lt;/td&gt;
&lt;td&gt;Coolify: $0 (open source)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$60+/month (and rising with every user/teammate)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~$13.50/month&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;The gap keeps growing&lt;/h3&gt;
&lt;p&gt;The &quot;managed&quot; path costs roughly 4x more before you even have your first 100 users, and the gap widens with every teammate and every GB of egress. To run the numbers for your own stack, including the hours you will spend on upkeep, try my &lt;a href=&quot;https://ansezz.com/tools/self-hosting-cost-calculator/&quot;&gt;self-hosting cost calculator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The half hour it takes to install Coolify on a fresh Linux box is worth the thousands of dollars saved over the life of the project.&lt;/p&gt;

Rebuild this table with your own invoices: list each managed service you pay for and the line it would become on one Coolify server. If the right column is under a third of the left, you have your business case.

&lt;h2&gt;Practical steps to a self-hosted SaaS stack&lt;/h2&gt;
&lt;p&gt;If you are tired of the cloud tax, here is my recommended path to freedom:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Grab a VPS.&lt;/strong&gt; I recommend Hetzner for raw performance per price, or OCI for its generous free tier. Pick an ARM-based instance (Ubuntu 24.04).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install Coolify.&lt;/strong&gt; Run the one-line install command from their documentation. It takes about 5 minutes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connect your Git.&lt;/strong&gt; Link your GitHub or GitLab account.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dockerize your app.&lt;/strong&gt; If you are using Laravel, it is as simple as adding a &lt;code&gt;Dockerfile&lt;/code&gt;. For Vite or Next.js, Coolify has built-in builders that don&apos;t even need a &lt;code&gt;Dockerfile&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Move your DB.&lt;/strong&gt; Export your managed DB and import it into a Coolify-managed container. Set up S3 backups immediately.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure&gt;

Do step 1 to 3 on a spare ARM instance this week with one small side project. Moving a real app is much easier once you have shipped a throwaway one.

&lt;h2&gt;The bottom line&lt;/h2&gt;
&lt;p&gt;We are entering a cycle where efficiency matters more than ever. The days of &quot;VC-subsidized&quot; infrastructure are over. Whether you are building a small tool or a large enterprise SaaS, you owe it to your bottom line to look at self-hosting.&lt;/p&gt;
&lt;h3&gt;Who holds the keys&lt;/h3&gt;
&lt;p&gt;Coolify has matured to the point where the developer experience is close to the big players. The real difference is who owns the keys to the castle.&lt;/p&gt;
&lt;p&gt;When you do outgrow a single box, the platform scales with you. I cover that in &lt;a href=&quot;https://ansezz.com/blog/scaling-with-coolify/&quot;&gt;advanced Coolify deployment strategies&lt;/a&gt;.&lt;/p&gt;

- Cloud credits hide the real cost: idle databases, NAT gateways and complexity you don&apos;t need yet.
- Coolify gives you git-push deploys, automatic SSL, one-click databases and PR previews on your own server.
- ARM instances on Hetzner or Oracle&apos;s Always Free tier cut the bill further.
- For a typical small app, the managed path costs roughly 4x more, and the gap grows with your team.
- Start with one throwaway project, then move your real app and its database.

&lt;p&gt;If your cloud bill is growing faster than your users, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams move to self-hosted Coolify on ARM&lt;/a&gt;, or drop a note via &lt;a href=&quot;https://ansezz.com/contact/&quot;&gt;contact&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What is the most &quot;expensive&quot; mistake you have ever made on a cloud bill: a forgotten NAT gateway or a runaway Lambda function?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>coolify</category><category>self-hosting</category><category>devops</category><category>docker</category><category>multi-tenancy</category></item><item><title>Self-hosted SaaS with Coolify and Docker</title><link>https://ansezz.com/blog/coolify-docker-saas-hosting/</link><guid isPermaLink="true">https://ansezz.com/blog/coolify-docker-saas-hosting/</guid><description>Get Heroku-grade DX on your own server. How Coolify and Docker on a cheap VPS deliver one-click databases, automatic SSL, and zero-downtime deploys.</description><pubDate>Sun, 19 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;You don&apos;t have to choose between overpaying for simplicity and overworking for control. Coolify and Docker give you the managed-platform experience on a server you own.&lt;/p&gt;

- Managed platforms charge per seat and per usage, and they lock your databases, env vars and build pipelines into their ecosystem.
- Coolify is an open source, self-hosted control plane (think Heroku or Vercel) built on Docker: git-push deploys, one-click databases and automatic SSL.
- A production setup adds your own Dockerfile (or Nixpacks), off-box database backups and health checks for zero-downtime deploys.

&lt;p&gt;Shipping a SaaS is hard enough without the constant worry of a &quot;surprise&quot; bill from your hosting provider.&lt;/p&gt;
&lt;p&gt;I have seen developers start on a managed platform and find that as soon as they add a second team member or cross a bandwidth threshold, their costs jump.&lt;/p&gt;
&lt;h3&gt;Stuck between two bad options&lt;/h3&gt;
&lt;p&gt;You are stuck choosing between paying a &quot;convenience tax&quot; that eats your margins and spending your weekend fighting Nginx configurations and manual SSH commands. It feels like you are either overpaying for simplicity or overworking for control.&lt;/p&gt;
&lt;h3&gt;The lock-in problem&lt;/h3&gt;
&lt;p&gt;It gets worse when you realize most managed platforms are wrappers around the same open source tools you could run yourself. You are paying for a pretty dashboard and an easy git-push flow.&lt;/p&gt;
&lt;p&gt;When you try to leave, you find yourself deep in vendor lock-in. Your databases, environment variables and build pipelines are all tied to a proprietary ecosystem. If the platform goes down or changes its pricing, your business is at the mercy of their support team.&lt;/p&gt;
&lt;h3&gt;A better way&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Coolify&lt;/strong&gt; combined with &lt;strong&gt;Docker&lt;/strong&gt; gives you the same developer experience as high-end managed platforms, but on your own infrastructure. You get the one-click deploy feel and a clean dashboard while keeping full control over your servers.&lt;/p&gt;
&lt;p&gt;If you want the business case first, I make it in &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;why I ditch expensive cloud providers for self-hosted SaaS&lt;/a&gt;. This guide is the hands-on build.&lt;/p&gt;
&lt;h2&gt;Why the cloud is getting more expensive&lt;/h2&gt;
&lt;p&gt;Early on, a $20-per-month plan feels reasonable. But as you grow, those costs multiply instead of adding up.&lt;/p&gt;
&lt;p&gt;Many platforms now charge per seat. With a team of five engineers, you might pay a hundred dollars a month before you deploy a single line of code.&lt;/p&gt;
&lt;h3&gt;Usage fees you can&apos;t predict&lt;/h3&gt;
&lt;p&gt;Then come the usage fees. Bandwidth, image optimization and serverless function execution costs are often opaque and hard to predict.&lt;/p&gt;
&lt;h3&gt;What owning the server changes&lt;/h3&gt;
&lt;p&gt;I have seen stacks move from managed services to a self-hosted Coolify setup and cut the monthly infrastructure bill by about ninety percent, with the same performance and reliability.&lt;/p&gt;
&lt;p&gt;When you own the server, you own the resources. There are no &quot;hidden&quot; charges for extra build minutes or database connections.&lt;/p&gt;

Add up last month&apos;s hosting invoices and split them into seats, usage fees and base plans. The seat and usage lines are what a self-hosted setup removes.

&lt;h2&gt;What exactly is Coolify?&lt;/h2&gt;
&lt;p&gt;Think of Coolify as an open source, self-hosted version of Heroku or Vercel. It is a control plane that sits on your server and manages everything for you.&lt;/p&gt;
&lt;p&gt;It handles your deployments, your reverse proxies, your SSL certificates and your databases. It turns a raw Linux VPS into a full hosting platform.&lt;/p&gt;
&lt;h3&gt;Built on Docker&lt;/h3&gt;
&lt;p&gt;Coolify is built on Docker, so every application you deploy is containerized. Your environment stays consistent across development, staging and production.&lt;/p&gt;
&lt;p&gt;No more &quot;it works on my machine&quot; excuses. If it runs in a container on your laptop, it will run the same way on your Coolify server.&lt;/p&gt;
&lt;p&gt;You keep the git-push workflow. You drop the per-seat bill.&lt;/p&gt;
&lt;h2&gt;Why Docker containerization matters&lt;/h2&gt;
&lt;p&gt;Docker is the quiet engine that makes this whole workflow possible. Instead of installing PHP, Node.js or Python directly on your server, you package them into a container image.&lt;/p&gt;
&lt;p&gt;That gives SaaS founders several key benefits:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Isolation.&lt;/strong&gt; Each app runs in its own sandbox. A memory leak in one app won&apos;t crash your entire server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Portability.&lt;/strong&gt; You can move your containers from Hetzner to DigitalOcean to AWS in minutes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version control.&lt;/strong&gt; Your infrastructure is defined as code. You can version your Dockerfile just like your application code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability.&lt;/strong&gt; Adding more instances of your app is as simple as spinning up another container.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Easy handoffs&lt;/h3&gt;
&lt;p&gt;I use Docker on every build I ship. It makes handoffs easy: whoever runs the app next doesn&apos;t need to worry about the underlying server configuration, only a Docker-compatible environment.&lt;/p&gt;
&lt;p&gt;Coolify deliberately stays at the single-host Docker layer rather than orchestrating clusters. If you&apos;re weighing that trade-off, see &lt;a href=&quot;https://ansezz.com/blog/docker-vs-kubernetes/&quot;&gt;Docker vs Kubernetes: containers vs orchestration&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Setting up your control plane&lt;/h2&gt;
&lt;p&gt;Getting started is simple. Coolify&apos;s documented minimum is 2 CPU cores, 2 GB of RAM and 10 GB of free disk, plus extra space for Docker images, volumes and backups. I&apos;d budget 4 GB of RAM if you plan to run more than a couple of apps alongside it.&lt;/p&gt;
&lt;p&gt;I usually recommend Ubuntu for the operating system. Once you have your server, run the single installation command from the Coolify documentation.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# the only command you need to bootstrap Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;What the installer does&lt;/h3&gt;
&lt;p&gt;The script installs Docker, sets up the Traefik reverse proxy and launches the Coolify dashboard. Within minutes, you can log in to your own private hosting panel.&lt;/p&gt;
&lt;p&gt;From there, connect your GitHub or GitLab account. Coolify listens for webhooks and triggers a new build whenever you push code to your main branch.&lt;/p&gt;
&lt;h3&gt;The same feedback loop&lt;/h3&gt;
&lt;p&gt;It feels magical. You get the same feedback loop as the big-name platforms: build logs in real time and a preview URL for your feature branches. And you do it all on a cheap VPS.&lt;/p&gt;
&lt;h2&gt;Handling databases and state&lt;/h2&gt;
&lt;p&gt;Managing databases is one of the hardest parts of self-hosting. Nobody wants to hand-configure Postgres clusters or worry about backing up Redis instances. Coolify solves this with &quot;one-click&quot; services.&lt;/p&gt;
&lt;h3&gt;One-click services&lt;/h3&gt;
&lt;p&gt;You can spin up a Postgres, MySQL, MongoDB or Redis instance in seconds. Coolify generates secure credentials and gives you the connection strings.&lt;/p&gt;
&lt;p&gt;It also handles persistent volumes, so your data stays safe when your container restarts or you update the image.&lt;/p&gt;
&lt;h3&gt;Volumes are not backups&lt;/h3&gt;
&lt;p&gt;Persistent volumes are not a backup strategy, though. Schedule automated dumps and keep them off-box, because &lt;a href=&quot;https://ansezz.com/blog/replication-vs-backup-laravel/&quot;&gt;replication and backup solve different failure modes&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Split out the database as you grow&lt;/h3&gt;
&lt;p&gt;For a SaaS, I usually recommend a dedicated server for your databases once traffic climbs. Coolify supports multi-server setups: one server acts as your control plane and other servers act as worker nodes where your apps and databases live.&lt;/p&gt;
&lt;p&gt;(I cover that scaling pattern in more depth in &lt;a href=&quot;https://ansezz.com/blog/scaling-with-coolify/&quot;&gt;scaling SaaS with advanced Coolify deployment strategies&lt;/a&gt;.)&lt;/p&gt;

For each database you run in Coolify, write down where its last backup lives and when it was taken. If the answer is &quot;on the same server,&quot; schedule an off-box dump today.

&lt;h2&gt;Security and SSL by default&lt;/h2&gt;
&lt;p&gt;Security shouldn&apos;t be an afterthought. Setting up SSL with Let&apos;s Encrypt used to mean cron jobs and manual certificates. With Coolify and Traefik, it is fully automated.&lt;/p&gt;
&lt;h3&gt;Certificates without a terminal&lt;/h3&gt;
&lt;p&gt;When you point a domain to your server and add it to your app configuration, Coolify requests and installs an SSL certificate. It also handles renewal, so your SaaS is always served over HTTPS without you touching a terminal.&lt;/p&gt;
&lt;h3&gt;Secrets out of git&lt;/h3&gt;
&lt;p&gt;Coolify also helps you manage environment variables securely. You don&apos;t need to hardcode secrets in your git repository. Define them in the dashboard and they are injected into your containers at runtime.&lt;/p&gt;
&lt;p&gt;This is a standard best practice that many developers skip when they are in a rush. Need a strong value for one of those secrets? My &lt;a href=&quot;https://ansezz.com/tools/secret-generator/&quot;&gt;secret generator&lt;/a&gt; makes one in your browser.&lt;/p&gt;
&lt;h2&gt;A production deployment workflow&lt;/h2&gt;
&lt;p&gt;If you want to do this the &quot;pro&quot; way, here is how I structure my deployments.&lt;/p&gt;
&lt;h3&gt;Use a Dockerfile&lt;/h3&gt;
&lt;p&gt;Coolify can detect many frameworks like Laravel or Node.js, but I always recommend writing your own Dockerfile. It gives you total control over the build.&lt;/p&gt;
&lt;p&gt;Use multi-stage builds to shrink your image. That makes deployments faster and saves disk space.&lt;/p&gt;
&lt;h3&gt;Use Nixpacks&lt;/h3&gt;
&lt;p&gt;If you don&apos;t want to write a Dockerfile, Coolify supports Nixpacks. It is a tool built by Railway that inspects your code and builds an optimized container image, with detection for 20-plus languages.&lt;/p&gt;
&lt;p&gt;Railway itself has since moved to a successor called Railpack, but Nixpacks remains a solid zero-config option inside Coolify. Coolify also offers Railpack as a beta build pack for Git-based apps.&lt;/p&gt;
&lt;h3&gt;Set up health checks&lt;/h3&gt;
&lt;p&gt;Never deploy without a health check. You want your app to actually respond before the reverse proxy sends traffic to it.&lt;/p&gt;
&lt;p&gt;Coolify lets you define a health check endpoint. If the check fails, the old container keeps running and the new one isn&apos;t promoted. This is the foundation of zero-downtime deployments.&lt;/p&gt;

  &lt;div&gt;The new container goes live as soon as it starts, even if the app inside is still booting or broken.&lt;/div&gt;
  &lt;div&gt;Traffic only moves when the health endpoint answers. A failed check leaves the old container serving users.&lt;/div&gt;

&lt;figure&gt;
&lt;h2&gt;Is self-hosting right for you?&lt;/h2&gt;
&lt;p&gt;Self-hosting isn&apos;t for everyone. If you are a solo developer with no interest in learning how a server works, paying the &quot;convenience tax&quot; might be worth it.&lt;/p&gt;
&lt;p&gt;Your time is valuable. If a managed platform saves you five hours of frustration a month, it might pay for itself. My &lt;a href=&quot;https://ansezz.com/tools/self-hosting-cost-calculator/&quot;&gt;self-hosting cost calculator&lt;/a&gt; puts those hours next to the server bill.&lt;/p&gt;
&lt;h3&gt;Owning your stack&lt;/h3&gt;
&lt;p&gt;If you are building a real business, though, you need to understand your stack. Owning your infrastructure is about more than saving money. It is about autonomy: no matter what happens to a specific provider, you can move your business elsewhere quickly.&lt;/p&gt;
&lt;p&gt;Whether the app is an e-commerce engine on Shopify or a custom Laravel application, the goal is the same: high performance and long-term stability.&lt;/p&gt;

Add a `/health` route to your app that checks the database connection, set it as the health check in Coolify, then deploy a deliberately broken build to staging and confirm the old container keeps serving.


- **Start with a clean VPS** and install Coolify using the official script.
- **Containerize your application** with a Dockerfile for full control, or use Nixpacks for zero config.
- **Use one-click services** for your databases and keep automated backups off the server.
- **Set up your domain** and let Coolify handle the SSL certificates.
- **Add health checks** so updates never take the app down.

&lt;p&gt;When you stop worrying about the &quot;how&quot; of deployment, you can spend more time on the &quot;what&quot; of your product. If you want to move your SaaS onto Coolify without losing a weekend to it, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams set up self-hosted deployments&lt;/a&gt;, or &lt;a href=&quot;https://ansezz.com/contact/&quot;&gt;tell me about it&lt;/a&gt; directly.&lt;/p&gt;
&lt;p&gt;What is the one thing stopping you from moving your SaaS to a self-hosted setup today?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>coolify</category><category>docker</category><category>self-hosting</category><category>devops</category><category>multi-tenancy</category><category>deployment</category><category>networking</category></item><item><title>Scaling SaaS with Coolify: deployment strategies</title><link>https://ansezz.com/blog/scaling-with-coolify/</link><guid isPermaLink="true">https://ansezz.com/blog/scaling-with-coolify/</guid><description>Move past the single-server trap. Multi-node Coolify, rolling deploys with real health checks, dedicated build servers, and GitHub Actions wiring for production.</description><pubDate>Sun, 11 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;One server running Coolify, your database, three apps and every build is fine for an MVP. For real customers, split the control plane, the builds and the data apart.&lt;/p&gt;

- Run Coolify on its own small server and deploy apps to separate app servers you add over SSH.
- Rolling updates only protect users when a health check reports real readiness and the app shuts down gracefully.
- Move builds to a dedicated build server with a registry, keep production data on a managed database, and deploy from CI with a deploy-only token.

&lt;p&gt;You moved your apps off a messy manual VPS and into Coolify. Everything is in one place. Then traffic spikes.&lt;/p&gt;
&lt;p&gt;Hosting your production database, three web apps and a memory-heavy build on a single $10 DigitalOcean droplet is a recipe for trouble.&lt;/p&gt;
&lt;h3&gt;The single-server trap&lt;/h3&gt;
&lt;p&gt;It&apos;s fine for a side project. With paying customers, you need a plan for what happens when that one server hits 100% CPU, or when a deploy takes the whole site down for five minutes.&lt;/p&gt;
&lt;p&gt;Coolify can handle larger workloads. You need to set it up the right way.&lt;/p&gt;
&lt;h3&gt;What this guide covers&lt;/h3&gt;
&lt;p&gt;Multi-server nodes, rolling deployments, dedicated build servers and CI wiring. If you&apos;re just getting started, my walkthroughs on &lt;a href=&quot;https://ansezz.com/blog/coolify-docker-saas-hosting/&quot;&gt;Coolify and Docker for SaaS hosting&lt;/a&gt; and running a &lt;a href=&quot;https://ansezz.com/blog/coolify-self-hosted-saas/&quot;&gt;fully self-hosted SaaS on Coolify&lt;/a&gt; cover the foundations.&lt;/p&gt;
&lt;h2&gt;Beyond the single server&lt;/h2&gt;
&lt;p&gt;The most common mistake I see is keeping everything on one node. When a build starts, it eats CPU and RAM. The web app lags and the database gets starved.&lt;/p&gt;
&lt;h3&gt;Split control plane from workloads&lt;/h3&gt;
&lt;p&gt;Run the Coolify instance on one small server of its own. That&apos;s mission control. Then add separate app servers where your containers live.&lt;/p&gt;
&lt;p&gt;In Coolify, open &lt;strong&gt;Servers&lt;/strong&gt;, add a server over SSH, and choose which server each resource deploys to. That gives you &lt;a href=&quot;https://ansezz.com/blog/horizontal-vs-vertical-scaling/&quot;&gt;horizontal scalability&lt;/a&gt;: when one server fills up, add another and point the next app there.&lt;/p&gt;
&lt;p&gt;It&apos;s the same separation I use when building &lt;a href=&quot;https://ansezz.com/work/&quot;&gt;custom web applications&lt;/a&gt;, and it keeps one machine from taking everything down.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Rolling deploys that don&apos;t drop requests&lt;/h2&gt;
&lt;p&gt;Nothing hurts user trust faster than a &lt;a href=&quot;https://ansezz.com/tools/http-status-codes/&quot;&gt;&quot;502 Bad Gateway&quot;&lt;/a&gt; every time you push a small CSS fix. Many self-hosted setups kill the old container and then start the new one, and users fall into the gap.&lt;/p&gt;
&lt;h3&gt;How Coolify rolls&lt;/h3&gt;
&lt;p&gt;For Nixpacks, Railpack, Static, Dockerfile and Docker Image apps, Coolify starts the replacement container while the old one keeps running. It waits for the new container&apos;s health check, then stops and removes the old one. Docker Compose apps don&apos;t get this rolling sequence.&lt;/p&gt;
&lt;p&gt;Without a health check, Coolify treats a container that started as ready, even if the app inside is still booting.&lt;/p&gt;
&lt;h3&gt;The workflow I use&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create a readiness endpoint.&lt;/strong&gt; In your Laravel, Vue or Node app, add a route like &lt;code&gt;/healthz&lt;/code&gt; that returns 200 only when the app can serve real requests.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure the check.&lt;/strong&gt; In the app, open &lt;strong&gt;Configuration &amp;gt; Healthcheck&lt;/strong&gt;, choose HTTP, set the path to &lt;code&gt;/healthz&lt;/code&gt; and an interval of about 5 seconds. The check runs inside the container, so the image needs &lt;code&gt;curl&lt;/code&gt; or &lt;code&gt;wget&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shut down gracefully.&lt;/strong&gt; Under &lt;strong&gt;Configuration &amp;gt; Advanced &amp;gt; Operations&lt;/strong&gt;, set the stop grace period (30 seconds by default) to how long the app needs to finish in-flight requests.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;On the default Traefik proxy, unhealthy containers are removed from routing, so traffic stays on the old container until the new one passes.&lt;/p&gt;

  &lt;div&gt;The new container starts, Coolify counts it as ready and stops the old one while Laravel is still warming up. Users see errors for a few seconds.&lt;/div&gt;
  &lt;div&gt;`/healthz` fails until the app can serve requests. Coolify keeps the old container live until the new one passes, then gives it time to finish its work.&lt;/div&gt;

&lt;p&gt;Coolify&apos;s own docs are clear that rolling updates don&apos;t guarantee zero downtime. Both versions run side by side for a moment, so migrations, queues and sessions have to work with old and new code.&lt;/p&gt;

Open your app&apos;s health check settings in Coolify. If the endpoint returns 200 before the database connection is up, change it to check the database and cache first, then redeploy and watch the logs.

&lt;h2&gt;A dedicated build server&lt;/h2&gt;
&lt;p&gt;Docker builds are heavy. Compiling assets, installing npm packages and building images can push a server&apos;s usage through the roof. If that build runs on the server serving your customers, they feel it.&lt;/p&gt;
&lt;h3&gt;How it works&lt;/h3&gt;
&lt;p&gt;Mark a high-CPU server as a build server in Coolify. On deploy, Coolify builds the image there, pushes it to a container registry, and the app server pulls the finished image.&lt;/p&gt;
&lt;h3&gt;What you need&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A registry:&lt;/strong&gt; Docker Hub, GitHub Container Registry or a self-hosted one. Run &lt;code&gt;docker login&lt;/code&gt; on the build server, and on the app server too if the registry is private.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A dedicated machine:&lt;/strong&gt; a server marked as a build server can&apos;t be a deployment destination.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Matching CPU architecture:&lt;/strong&gt; build on the same architecture your app servers run.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Your production server never feels the build. It just pulls a ready-to-run image.&lt;/p&gt;
&lt;p&gt;Keep your builds away from your traffic and your data away from your compute.&lt;/p&gt;
&lt;h3&gt;What about the database?&lt;/h3&gt;
&lt;p&gt;Coolify makes &quot;New Database&quot; one click, but running production Postgres or MySQL in a container on the same server as your app is risky.&lt;/p&gt;
&lt;p&gt;For production I usually recommend a managed database like AWS RDS or Google Cloud SQL, with backups and point-in-time recovery handled for you.&lt;/p&gt;
&lt;p&gt;In Coolify you pass the connection string as an environment variable. State stays separate from compute, the same &lt;a href=&quot;https://ansezz.com/blog/stateless-vs-stateful-apps/&quot;&gt;stateless app&lt;/a&gt; discipline that makes horizontal scaling possible.&lt;/p&gt;
&lt;h2&gt;CI/CD with deploy webhooks&lt;/h2&gt;
&lt;p&gt;For a professional workflow, code should move from GitHub to production without anyone clicking in the Coolify UI.&lt;/p&gt;
&lt;p&gt;I prefer GitHub Actions. Coolify&apos;s GitHub App integration works well, but Actions let you run tests and linting first and trigger the deploy only when everything passes.&lt;/p&gt;
&lt;h3&gt;Wire the webhook&lt;/h3&gt;
&lt;p&gt;Create an API token with only the &lt;strong&gt;deploy&lt;/strong&gt; permission under &lt;strong&gt;Keys &amp;amp; Tokens &amp;gt; API Tokens&lt;/strong&gt;, and store it as a CI secret. Copy the app&apos;s deploy webhook from &lt;strong&gt;Configuration &amp;gt; Webhooks&lt;/strong&gt;. On a self-hosted instance, API access must be turned on in &lt;strong&gt;Settings &amp;gt; Advanced&lt;/strong&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: deploy to production
on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: trigger coolify webhook
        run: |
          curl --fail -X GET &quot;${{ secrets.COOLIFY_WEBHOOK_URL }}&quot; \
            -H &quot;Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Put your test job before this step and broken code never reaches your servers.&lt;/p&gt;
&lt;figure&gt;
&lt;h2&gt;Configuration tips&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Resource limits:&lt;/strong&gt; set CPU and memory limits for every app so one leaky container can&apos;t take the whole server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;External backups:&lt;/strong&gt; if you run databases inside Coolify, use S3-compatible backups. I use Backblaze B2 or Cloudflare R2. Never rely on local backups alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker cleanup:&lt;/strong&gt; large images fill disks fast. Use Coolify&apos;s automated Docker cleanup or a cron job (my &lt;a href=&quot;https://ansezz.com/tools/cron-explainer/&quot;&gt;cron explainer&lt;/a&gt; checks the schedule).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;External monitoring:&lt;/strong&gt; Coolify tells you a container is running. A tool like Better Stack or GlitchTip tells you whether a human can use the site.&lt;/li&gt;
&lt;/ul&gt;

List every resource on your busiest Coolify server: apps, databases and builds. Anything that isn&apos;t serving traffic is a candidate to move to a build server or a managed service first.


- **Split the control plane.** Coolify on its own small server, apps on separate nodes.
- **Make health checks honest.** Rolling updates are only as safe as your readiness endpoint and graceful shutdown.
- **Offload builds.** A dedicated build server plus a registry keeps builds off production.
- **Separate data from compute.** Managed databases for production state.
- **Deploy from CI.** A deploy-only token and a webhook after your tests pass.

&lt;p&gt;Scaling well means a system that behaves predictably. Whether you&apos;re building a Shopify app or a Laravel SaaS, the principles are the same. If you&apos;re moving a growing app onto Coolify, &lt;a href=&quot;https://ansezz.com/services/&quot;&gt;here&apos;s how I help teams set up multi-server deploys and CI&lt;/a&gt;, or &lt;a href=&quot;https://ansezz.com/contact/&quot;&gt;drop me a line&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Have you ever had a build crash your production server in the middle of the day?&lt;/p&gt;
&lt;/figure&gt;&lt;/figure&gt;</content:encoded><category>devops</category><category>coolify</category><category>deployment</category><category>devops</category><category>docker</category><category>self-hosting</category><category>ci-cd</category><category>scaling</category></item></channel></rss>