<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ivan Vulovic on Medium]]></title>
        <description><![CDATA[Stories by Ivan Vulovic on Medium]]></description>
        <link>https://medium.com/@vulke?source=rss-813c7942ca45------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*d1STy62e4k7luj72</url>
            <title>Stories by Ivan Vulovic on Medium</title>
            <link>https://medium.com/@vulke?source=rss-813c7942ca45------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:56:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vulke/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What Building APIs Taught Me About Teachers]]></title>
            <link>https://vulke.medium.com/what-building-apis-taught-me-about-teachers-92027c128700?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/92027c128700</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[edtech]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 22:06:03 GMT</pubDate>
            <atom:updated>2026-01-02T22:06:03.305Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s Start</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJUZ3EOujb0jO_3CjXl1ig.png" /><figcaption>Education doesn’t need braver teachers. It needs safer systems.</figcaption></figure><p>For most of my career, I worked behind the scenes.</p><p>Not as a product visionary.<br>Not as a marketer.</p><p>But as a backend architect and engineering lead — designing systems that other people’s work depended on.</p><p>I led development teams, designed architectures, and spent years building and maintaining APIs that had to work every single day. Not in greenfield startups, but in real production environments — often in education technology, where failures are not tolerated and “we’ll fix it later” is not an option.</p><p>When you build systems for schools, ministries, and publishers, you learn something very quickly:</p><p><strong>Stability beats novelty, and trust beats cleverness.</strong></p><p>APIs were just one part of that work.<br>But they were the most unforgiving one.</p><p>An API doesn’t care about intentions.<br>If it’s unclear, people misuse it.<br>If it’s unstable, people stop relying on it.<br>And once trust is lost, no amount of documentation or new features will bring users back.</p><p>Over time, I started noticing something unexpected.</p><p>The same patterns that make APIs succeed or fail<br>also determine whether teachers trust — or abandon — digital tools.</p><p>That realization changed how I look at education technology.</p><h3>Trust Is a Technical Problem</h3><p>In education, lack of trust is usually described as a human problem.</p><p>Teachers don’t trust platforms.<br>Institutions don’t trust teachers.<br>Publishers don’t trust distribution channels.</p><p>But coming from a systems background, this framing always felt wrong to me.</p><p>In software, we don’t explain broken systems through emotions.<br>We explain them through architecture.</p><p>When users don’t trust a system, it’s usually because the system behaves unpredictably.</p><p>Education technology is no different.</p><p>Teachers operate in environments where:</p><ul><li>Information changes without clear versioning</li><li>Rules differ depending on who you ask</li><li>Responsibility is pushed onto the user to “figure it out.”</li></ul><p>From a technical standpoint, that’s not a usability issue.<br>That’s a <strong>contract violation</strong>.</p><h3>Single Source of Truth (or Everything Breaks)</h3><p>Every backend architect learns this lesson the hard way:</p><blockquote><em>The moment you allow multiple sources of truth,<br>you stop controlling the system.</em></blockquote><p>In software, this leads to:</p><ul><li>Race conditions.</li><li>Inconsistent states.</li><li>Endless bug reports that are “impossible to reproduce”.</li></ul><p>In schools, it leads to something very similar.</p><p>The same teacher might receive:</p><ul><li>one schedule from the school,</li><li>another update from a ministry,</li><li>a third notification from a publisher,</li><li>and a fourth reminder in a messaging app.</li></ul><p>None of them are wrong in isolation.<br>Together, they are unusable.</p><p>So teachers do what experienced engineers do when systems are unreliable:</p><p><strong>They stop trusting automation and switch to manual control.</strong></p><p>Printouts.<br>Personal notes.<br>Spreadsheets.<br>Memory.</p><p>That’s not resistance to technology.<br>That’s a rational response to bad system design.</p><h3>Backward Compatibility Matters More Than Innovation</h3><p>In engineering teams, we treat backward compatibility as sacred.</p><p>You don’t introduce breaking changes lightly.<br>You don’t move fast at the expense of production users.<br>And you certainly don’t surprise people who rely on your system to do their job.</p><p><strong>Teachers are production users.</strong></p><p>They plan lessons days or weeks ahead.<br>They depend on calendars, materials, and schedules being stable.<br>A “small change” can mean a real-world failure in front of a classroom.</p><p>Yet many education tools behave like experimental APIs:</p><ul><li>Interfaces change without warning</li><li>Workflows shift mid-year</li><li>Information is restructured without migration paths</li></ul><p>Over time, this creates a simple outcome:<br><strong>Teachers disengage.</strong></p><p>Not because they dislike technology, but because they cannot afford unpredictability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bOqq5pDbRPkzyA1-Ik9Qw.png" /></figure><h3>When “Smart” Becomes Risky</h3><p>At some point, every system reaches a moment where intelligence becomes a liability.</p><p>In engineering, this usually happens when a system starts doing things <em>for</em> the user — without making its rules explicit.</p><p>Education is reaching that moment now.</p><p>AI can already:</p><ul><li>generate lesson plans,</li><li>explain complex topics,</li><li>summarize materials,</li><li>answer student questions.</li></ul><p>Technically, it’s impressive.</p><p>Practically, it creates a new kind of risk.</p><p>Because the question teachers now face is no longer:</p><blockquote><em>Can I do this?</em></blockquote><p>But:</p><blockquote><em>If I do this — who stands behind it?</em></blockquote><p>That’s not a pedagogical question.<br>That’s a system design question.</p><h3>The Missing Layer</h3><p>In backend systems, we don’t expose raw intelligence directly to production users.</p><p>We put layers in between:</p><ul><li>validation,</li><li>authorization,</li><li>versioning,</li><li>auditability.</li></ul><p>Not to slow things down — <br>but to make smart behavior safe.</p><p>Most education tools skipped that step.</p><p>They introduced intelligence without governance.<br>Speed without guarantees.<br>Power without accountability.</p><p>The result isn’t innovation.<br>It’s hesitation.</p><h3>A Moment That Made It Obvious</h3><p>I remember a conversation during an edtech project that, at the time, felt trivial.</p><p>A teacher asked a simple question:</p><blockquote><em>If I use this material, can someone later tell me it wasn’t allowed?</em></blockquote><p>There was a short pause in the room.</p><p>Technically, the content was correct.<br> Pedagogically, it made sense.<br> The platform worked exactly as designed.</p><p>But no one could give a clear answer.</p><p>Not because the answer didn’t exist — <br>But because the system had no way to express authority.</p><p>That was the moment it clicked for me:<br>The problem wasn’t missing features or a better UX.<br>It was the absence of a layer that could say, <em>“yes — and this is why.”</em></p><h3>The Shift</h3><p>This is the point where my perspective changed.</p><p>The problem wasn’t that education lacked technology.<br> Or even that it lacked AI.</p><p>It lacked <strong>infrastructure-level thinking</strong>.</p><p>The same thinking we apply when systems must be trusted:<br> by banks,<br> by governments,<br> by large platforms.</p><p>Education deserves the same standard.</p><h3>Let’s finish</h3><p>This is the kind of problem that doesn’t get solved by another feature.</p><p>It gets solved when we stop treating education tools as apps — <br> and start treating them as systems people depend on.</p><p>That’s the space I’m working in now.</p><p>Not building “smarter tools”,<br>but designing the layer that makes smart systems trustworthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92027c128700" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Compiled vs Interpreted Nonsense — What Really Matters When Choosing a Language]]></title>
            <link>https://vulke.medium.com/the-compiled-vs-interpreted-nonsense-what-really-matters-when-choosing-a-language-26174506ea1b?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/26174506ea1b</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 11:13:51 GMT</pubDate>
            <atom:updated>2025-08-12T11:13:51.984Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>The Compiled vs Interpreted Nonsense — What Really Matters When Choosing a Language</strong></h3><p>The internet is full of “compiled vs interpreted” comparisons — endless blog posts, forum debates, and YouTube videos obsessing over which one is “faster” or “better.” I keep bumping into them, and every time, I roll my eyes.</p><p>Why? Because in 90% of the real-world projects I’ve seen, this so-called debate is completely irrelevant. Performance is dragged into the conversation even when it has no practical impact. Teams waste time discussing whether a language is compiled or interpreted while ignoring the things that will actually make or break their project — architecture, maintainability, developer expertise, or even basic requirements.</p><p>And it’s not just beginners. I’ve seen architecture planning sessions derailed by “but compiled is faster” or “interpreted is more flexible,” as if these broad generalizations are still true in the modern world of JIT compilers, bytecode, and hybrid runtimes.</p><p>So let’s clear the air. In this article, I’ll explain why the “compiled vs interpreted” label is outdated, what <em>really</em> matters when choosing a language, and how to make that decision without getting trapped in this pointless debate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*junpCgSxcd7rhjZ-csTelw.jpeg" /><figcaption>Stop comparing tools as if they’re playing the same game</figcaption></figure><h3>Why the Debate Is Outdated</h3><p>Once upon a time, the “compiled vs interpreted” distinction was simple:</p><ul><li><strong>Compiled languages</strong> (like C) were turned directly into machine code before running, which meant blazing-fast execution at runtime.</li><li><strong>Interpreted languages</strong> (like early versions of BASIC or Perl) read and executed code line by line, making them slower but more flexible for quick changes.</li></ul><p>That was the theory. It made sense… <strong>in the 1980s</strong>.</p><p>Today? That neat separation barely exists. Most modern languages use <strong>hybrid models</strong> that borrow techniques from both worlds:</p><ul><li><strong>Just-In-Time (JIT) compilation</strong>: Languages like Java and C# — and even traditionally “interpreted” ones like Node.js (through the V8 engine) — compile frequently executed code into machine code <em>at runtime</em> to boost performance. This alone shows that the old compiled vs interpreted distinction is no longer a clean split.</li><li><strong>Bytecode and virtual machines</strong>: Python, PHP, Node and Ruby are “interpreted” in name only — in practice, they compile to bytecode first, then run on a VM.</li><li><strong>Ahead-of-Time (AOT) compilation for interpreted languages</strong>: PHP can be compiled into machine code with tools like Opcache or JIT.</li></ul><p>The line between “compiled” and “interpreted” has blurred so much that using it as a hard label in 2025 is like dividing transportation into “horses” and “cars” — technically true in some cases, but completely missing the point for most modern scenarios.</p><p>This is why I cringe when I hear statements like <em>“We should use Go because it’s compiled”</em> or <em>“Python is interpreted so it’s slow.”</em> These comments ignore decades of progress in runtime optimizations and give a false impression of what really impacts performance in real-world projects.</p><p>And here’s the key takeaway for backend developers:<br>In the age of <strong>AI, microservice architectures, and polyglot systems</strong>, it’s worth learning <strong>at least one interpreted</strong> and <strong>one compiled</strong> language. That way, you can pick the right tool for each microservice instead of forcing the same technology everywhere.</p><p>A perfect real-world example? <strong>Go and PHP working together</strong>:</p><ul><li><a href="https://frankenphp.dev/"><strong>FrankenPHP</strong></a>, a modern PHP server, is written in Go — because in that part of the stack, raw performance and concurrency matter.</li><li><a href="https://mercure.rocks/"><strong>Mercure</strong></a>, used for real-time communication (e.g., <a href="https://symfony.com/doc/current/messenger.html">Symfony Messenger</a> integration), is also built in Go for the same reasons.</li><li>Your business logic and APIs can still be in PHP — because developer productivity, ecosystem, and maintainability matter there more than raw execution speed.</li></ul><p>The “compiled vs interpreted” wall has already fallen — the best systems combine both.</p><blockquote>A backend developer who knows only one side of the compiled–interpreted divide is building with half a toolbox</blockquote><h3>The Problem With Using It as a Decision Factor</h3><p>The biggest issue with the “compiled vs interpreted” obsession is that it assumes <strong>raw execution speed</strong> is the single most important factor when choosing a language.</p><p><strong>Spoiler</strong>: for 99% of projects, it isn’t.</p><p>In the real world, the majority of applications aren’t CPU-bound — they’re <strong>I/O-bound</strong>. Your bottlenecks are more likely to be:</p><ul><li>Network latency when calling APIs.</li><li>Database queries waiting for results.</li><li>File system operations and external service calls.</li></ul><p>In these cases, saving a few milliseconds off code execution is meaningless if your app spends hundreds of milliseconds just waiting for a response from somewhere else.</p><p>Even in performance-sensitive projects, execution speed is just <strong>one variable</strong> among many. Choosing a “faster” language on paper but with poor ecosystem support or a steep learning curve for your team will slow development, increase bugs, and drive up costs.</p><p>And yet, I’ve sat in architecture meetings where entire technology choices were made on the shaky ground of <em>“but compiled is faster”</em> or <em>“interpreted is easier to debug.”</em></p><blockquote>The result? Teams end up with mismatched tools, painful onboarding, and in the worst cases — rewrites.</blockquote><p>If your project’s requirements don’t demand squeezing every ounce of performance from the CPU, using “compiled vs interpreted” as the deciding factor is like choosing a house based solely on the color of the roof.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*YSg4OipW8dBHPAEmyUqt3g.jpeg" /><figcaption>We’ll just argue on Reddit for 3 weeks</figcaption></figure><h3>The Real Pros and Cons</h3><p>Before we throw the entire “compiled vs interpreted” debate into the trash bin, let’s be fair — each approach does have strengths and weaknesses.</p><p><strong>Compiled languages</strong> (C, C++, Java, Go, Rust)</p><ul><li><strong>Performance</strong>: Directly translated to machine code, they can take full advantage of the CPU and optimizations done at compile time.</li><li><strong>Optimizations</strong>: The compiler can catch many errors before runtime and heavily optimize code paths.</li><li><strong>Slower iteration</strong>: Changes require recompilation, which can slow down the development feedback loop.</li><li><strong>Less forgiving</strong> for quick experiments — you can’t just “run the file” without building.</li></ul><p><strong>Interpreted languages</strong> (PHP, Python, Ruby, Node)</p><ul><li><strong>Faster development cycles</strong>: No compilation step means immediate execution — perfect for scripting, prototyping, and iterative work.</li><li><strong>Dynamic flexibility</strong>: Easier to modify at runtime, ideal for certain types of automation and glue code.</li><li><strong>Potentially slower execution</strong> — but this gap is often reduced by JIT compilation or bytecode caching.</li><li><strong>Errors at runtime</strong>: Certain mistakes aren’t caught until you actually execute the code.</li></ul><p>Here’s the thing:</p><p>While compiled languages can still outperform interpreted ones in raw benchmarks — especially in CPU-heavy workloads — <strong>that doesn’t mean one category is “better” in every scenario</strong>. They are fundamentally different tools, and choosing between them should be about <strong>fit for purpose</strong>, not ideology.</p><p>Which brings us to the real question…</p><h3>What Really Matters When Choosing a Language</h3><p>When it comes to picking the right language for a project, you’re not choosing between “fast” and “slow” — you’re choosing between a set of trade-offs that should align with your <strong>actual goals</strong>.</p><p>Here’s what should drive that decision far more than whether the language is compiled or interpreted:</p><h4><strong>Ecosystem and Libraries</strong></h4><p>A language’s speed on paper means little if you’re forced to reinvent the wheel for every feature. A rich ecosystem with actively maintained libraries can save months of development time. For example, while you <em>could</em> write a machine learning pipeline in C++, the sheer number of ready-to-use, production-tested Python libraries (like TensorFlow, PyTorch, scikit-learn) make Python the obvious choice for that domain.</p><blockquote>The best language is often the one with the tools that let you build faster</blockquote><h4><strong>Team Expertise</strong></h4><p>Your team’s skills can outweigh raw performance differences by orders of magnitude. A “faster” language that no one on your team knows well will slow you down with training, mistakes, and refactoring. Conversely, a “slower” language that your team has mastered can lead to higher productivity, fewer bugs, and quicker delivery. A web team experienced in PHP + Laravel can build a custom CMS in weeks.</p><blockquote><strong><em>A language your team knows well will usually beat a ‘faster’ one they don’t</em></strong></blockquote><h4><strong>Maintainability</strong></h4><p>Projects live for years, not weeks. Clean, readable, and well-structured code is easier to maintain and onboard new developers into. Choosing a language just because it’s compiled or interpreted means little if your future self (or someone else) can’t understand or modify the code without breaking everything.</p><blockquote><strong><em>Write for the next developer — even if that developer is you in six months</em></strong></blockquote><h4><strong>Deployment Environment</strong></h4><p>Sometimes the choice isn’t about technical purity but about what’s practical for your hosting environment, client infrastructure, or integration points. A language that fits naturally into your deployment pipeline will save headaches in CI/CD, scaling, and support. For example, deploying Go binaries in a minimal container might be easier than setting up a full runtime for a language your environment doesn’t support.</p><blockquote><strong><em>Choose a language that fits your environment, not the other way around.</em></strong></blockquote><h4>Community and Support</h4><p>Even the most elegant language can be painful without a strong community. Tutorials, forums, Stack Overflow answers, and open-source contributions are invaluable. A niche language might be perfect technically, but if you can’t find help when something breaks, you’re stuck. PHP + Symfony has thousands of reusable bundles and a strong Stack Overflow presence, backward compatibility, LTS releases, upgrade guides...</p><blockquote><strong><em>A strong community is worth more than a theoretical performance edge.</em></strong></blockquote><h4>Performance — When It Actually Matters</h4><p>There are cases where raw performance matters: real-time video processing, high-frequency trading, and massive-scale simulations. In those situations, compiled languages may shine. But even then — <strong>profile first</strong>. Many “slow” languages can reach acceptable performance levels with the right optimizations, JIT compilation, or by offloading heavy computation to native modules.</p><blockquote><strong><em>Don’t chase speed until you know you actually need it</em></strong></blockquote><h3>The 99% Reality</h3><p>The truth is, in <strong>99% of projects</strong>, even if your product scales to millions of users, <strong>choosing a language because of performance</strong> will not be what saves — or sinks — your budget, user experience, or stability.</p><p>Infrastructure costs, development time, and maintenance complexity almost always outweigh the raw execution speed of your language.</p><blockquote><strong><em>Choose a language because it solves your problem, not because it wins a benchmark.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*7CMtaHesNOHHEuKVK2X8zA.jpeg" /></figure><h3>Conclusion — It Was Never About Compiled vs Interpreted</h3><p>The “compiled vs interpreted” debate made sense decades ago, when the technical gap was wide and the choice had an obvious impact on how your application ran. But in 2025, the lines are blurred. We have JIT compilers, hybrid runtimes, bytecode, and optimization layers that make this binary distinction almost meaningless for most real-world projects.</p><p>The real question isn’t <em>“Which one is faster?”</em> — it’s <em>“Which one is right for what we’re building, with the team we have, and the problems we need to solve?”</em></p><p>So the next time someone asks you whether they should choose a compiled or interpreted language, remember this:</p><blockquote><strong><em>In most cases, compiled vs interpreted is not a decision — it’s a distraction.</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26174506ea1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This isn’t an IT recession — AI just slammed the pedal to the metal.]]></title>
            <link>https://vulke.medium.com/this-isnt-an-it-recession-ai-just-slammed-the-pedal-to-the-metal-34d4263adaef?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/34d4263adaef</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Sun, 10 Aug 2025 23:08:19 GMT</pubDate>
            <atom:updated>2025-08-10T23:08:19.671Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>This isn’t an IT recession — AI just slammed the pedal to the metal.</strong></h3><p>A few years ago, delivering one major feature a year felt like an achievement. We’d plan it, budget for it, and carefully roll it out. Now, with AI in the mix, I’ve seen teams build in a month what used to take us half a year.</p><p>The strange part? While speed and capability have exploded, many companies are still planning their roadmaps as if it’s 2015. And in that gap between <em>what’s possible</em> and <em>how fast you adapt</em> — that’s where layoffs happen.</p><blockquote>Not because there’s no work, but because the pace has changed, and they haven’t.</blockquote><p>We’re living in a paradox.<br>AI is automating repetitive work so efficiently that fewer people can deliver the same results — or better. At the same time, it’s unlocking the ability to ship five, ten, even twenty features in the time it once took to ship one.</p><p>For companies that adapt, this is a golden era: faster releases, more innovation, stronger market position. For those that don’t, it’s a slow bleed — projects stagnate, competitors pull ahead, and the “cost-cutting” starts.</p><h3>The AI Speed Shift</h3><p>When I first started in IT, we measured delivery speed in quarters. You could spend three months on planning, another three on development, and still be considered “fast” if you shipped something before the year was over.</p><p>Today, AI has collapsed those timelines. I’ve watched documentation drafts appear in seconds, prototype code generated in minutes, and production-ready features delivered in weeks — sometimes by teams half the size. Tasks that once required manual testing are now run through AI-assisted pipelines that flag issues before a human even logs in.</p><p>It’s tempting to think this means less work. The reality is: there’s <strong>more</strong> work than ever — just packed into a fraction of the time.</p><h3>The Paradox: Fewer People, More Features</h3><p>Here’s the uncomfortable truth: automation and AI have made many entry-level tasks redundant. Writing boilerplate code, generating test cases, even producing initial UI designs — these are no longer full-time jobs for teams of people. They’re buttons you click.</p><p>But the flip side is explosive growth in opportunity. With AI, teams can now push five major releases a year instead of one. The bottleneck isn’t skill anymore — it’s how quickly leadership can recognize and act on the possibilities.</p><p>This paradox means two things happen at once:</p><ul><li><strong>Layoffs</strong> in companies that don’t adjust fast enough.</li><li><strong>Rapid scaling</strong> in companies that do.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*lJvTjn8I-4PL4ytF0_jqbA.jpeg" /></figure><h3>Companies Winning</h3><h4>Look at Canva</h4><p>They could have stayed “just” a design tool. Instead, they built AI-powered design suggestions, instant background removal, and even text-to-image tools — all in under a year. These features weren’t gimmicks; they directly addressed user pain points and kept competitors scrambling to catch up.</p><h4>Then there’s <strong>Duolingo</strong></h4><p>Language learning is perfect for AI personalization. Duolingo quickly rolled out AI tutors and adaptive exercises, which not only improved learning outcomes but also created a premium upsell path. And it’s not just about AI — in the past two years, Duolingo has launched <em>three to four times more new features</em> than in the years before: new lesson types, gamified challenges, streak rewards, seasonal events, and even entire new learning verticals like <strong>Duolingo Math</strong> and <strong>Duolingo Music</strong>.</p><h4>Or take <strong>Zoom</strong></h4><p>When the pandemic boom started fading, they could have stayed “just” a video conferencing app. Instead, they pushed out a wave of new features in under two years — email and calendar integration, AI-powered meeting summaries, collaboration whiteboards, persistent team chat, and even event hosting tools. This aggressive expansion helped them stay relevant in a market crowded with competitors like Microsoft Teams and Google Meet.</p><blockquote>The winners didn’t just <strong>add AI</strong> — they adapted their <strong>entire speed of execution</strong>.</blockquote><blockquote>The losers treated AI as a side project.</blockquote><h3>Companies Losing</h3><p>Now compare that to a few large enterprise software vendors who took 18 months just to “evaluate” how AI might fit into their roadmap. By the time their pilot programs were ready, faster-moving startups had already launched, iterated, and taken their market share.</p><h4>Look at <strong>Stack Overflow</strong></h4><p>Traffic dropped sharply — by some estimates over 35% — as developers started asking ChatGPT for answers instead of browsing Q&amp;A threads. By the time Stack Overflow announced <strong>OverflowAI</strong>, they were already fighting to win back both users and relevance.</p><h4>Take <strong>Evernote</strong></h4><p>Once the go-to app for note-taking and productivity, it spent years focusing on incremental UI tweaks while competitors like Notion and OneNote shipped major updates, collaboration features, and — more recently — AI-powered organization tools. Evernote’s slow product velocity cost them dearly: in 2023, they were acquired by Bending Spoons, who promptly laid off most of their staff and moved the product’s operations overseas.</p><h4>Or <strong>Peloton</strong></h4><p>After their pandemic-era boom, Peloton faced a sharp decline in demand. Instead of aggressively expanding into new product lines or rolling out AI-driven personalization (think adaptive workout plans, predictive health tracking), they stuck to their existing formula for too long. By the time they diversified with new content types and features, growth had stalled, multiple rounds of layoffs had been announced, and revenue had fallen — even though their core brand recognition was still strong.</p><p>The pattern here is clear:<br>It’s not about whether a product “needs” AI. It’s about whether your release cadence keeps pace with the market. When competitors launch and iterate at three times your speed, even a beloved product can become irrelevant.</p><p>And these aren’t isolated cases. There are countless examples across industries where companies lost their edge simply because they didn’t move fast enough in the AI era.</p><h3>Why the 2020 Roadmap Doesn’t Work in 2025</h3><p>In 2020, it was acceptable to plan a 12–18 month development cycle for a major release. AI has shattered that model. Today, a product that takes 18 months to launch will be outdated before it hits the market — not because the tech is bad, but because competitors will have shipped three better versions in that time.</p><p>The pace of innovation has shifted from <em>annual</em> to <em>continuous</em>.<br>The gap isn’t about <em>technology readiness</em> — it’s about <strong>organizational readiness</strong>.</p><p>If your company still runs projects as if nothing has changed, here’s what’s going to happen:</p><ul><li>You’ll under-deliver compared to competitors.</li><li>You’ll justify cuts to “reduce costs” instead of fixing speed.</li><li>You’ll slowly lose your top talent to companies that move faster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*FI1XIISq7xFPghFtHVBWYA.jpeg" /></figure><h3>What Companies Can Do</h3><p>The companies that thrive in the AI era aren’t the ones with the most funding, the biggest teams, or the longest histories — they’re the ones that can adapt their <strong>execution speed</strong> without losing product quality.</p><blockquote>AI isn’t just a technology shift; it’s a tempo shift.</blockquote><p>When the market moves from shipping one major release a year to shipping multiple significant updates every quarter, <strong>your organization either adapts to that rhythm or gets left behind</strong>. The hardest part isn’t building the tech — it’s aligning leadership, processes, and culture to move at that new pace.</p><p>Here’s how companies can not only survive this shift, but use it to outpace their competitors:</p><ol><li><strong>Shorten your planning cycles</strong><br>Move from annual or semi-annual planning to quarterly — or even rolling — roadmaps. Today&#39;s markets evolve too fast for a 12-month commitment to remain accurate. Treat your plan as a living document, not a fixed contract.</li><li><strong>Adopt “build–measure–adapt” as a default</strong><br>The AI era rewards speed of iteration. Ship smaller increments more often, measure results immediately, and adapt based on real-world feedback. The old “big bang” release model is now a slow-motion failure.</li><li><strong>Make AI a core enabler where it matters</strong><br>Not every product needs AI in its features. But if AI can speed up your development process, improve testing, automate repetitive work, or help you deliver more features in less time, it shouldn’t be left in a lab or a single “innovation team.” Treat it as a core enabler in the areas where it directly increases output or quality. The fastest movers aren’t adding AI for the sake of it — they’re using it strategically to accelerate the roadmap.</li><li><strong>Continuously upskill your teams</strong><br>Engineers, designers, and product managers must stay hands-on with AI tools relevant to their domain. Provide dedicated training budgets, hackathon days, and safe spaces for experimentation — otherwise, they’ll fall behind and so will your product.</li><li><strong>Protect high-impact teams from bureaucracy</strong><br>Your most capable people can’t spend 80% of their week in alignment meetings. Give them autonomy, decision-making authority, and direct access to the resources they need to move at AI speed.</li><li><strong>Measure execution velocity as a business metric</strong><br> “On-time delivery” is no longer enough. Track <em>time to market</em> from concept to launch. In a world where AI allows competitors to ship faster, speed itself is a competitive advantage — and should be treated as one.</li><li><strong>Reinvest the gains from AI efficiency</strong><br> If AI allows you to ship faster with fewer resources, don’t just cut headcount. Redirect that capacity into innovation and market expansion. The companies that win will use AI savings to build more, not simply spend less.</li></ol><h3>What Individuals Can Do</h3><p>The AI era has permanently raised the baseline for speed and output. Competing at a 2019 pace against people and teams who deliver five times faster with AI assistance is no longer sustainable. This isn’t about replacing your entire workflow with automation — it’s about learning where AI can help you move faster and freeing up your focus for the work that matters most.</p><p>Here’s how individuals can stay ahead:</p><ol><li><strong>Acknowledge the new baseline</strong><br>Delivering slowly but “thoroughly” is no longer a competitive advantage. The market now values speed <em>and</em> quality together. Accept that faster delivery is the expectation, not the exception.</li><li><strong>Integrate AI into your workflow where it adds value</strong><br>You don’t have to use AI for everything — but identify the repetitive, time-consuming, or low-leverage parts of your work and automate them. Whether it’s code generation, test writing, documentation, or data prep, free your time for higher-level problem solving.</li><li><strong>Double down on high-leverage skills</strong><br>AI can assist with syntax and boilerplate, but it can’t replace deep architectural thinking, system design trade-offs, or navigating complex human and business factors. Strengthen the skills that AI amplifies but doesn’t replace.</li><li><strong>Continuously learn the tools relevant to your domain</strong><br>You don’t need to chase every AI trend, but you should know which tools affect your work directly — and be able to use them effectively before they become industry standard.</li><li><strong>Make adaptability a core career skill</strong><br>The most valuable professionals will be those who can switch tools, workflows, or even roles as technology evolves. Treat adaptability like a technical skill — practice it intentionally.</li><li><strong>Show visible impact quickly</strong><br>In a high-velocity environment, it’s not enough to be productive — you need to make your contributions visible. Ship small improvements often, share your wins, and make it easy for others (especially leadership) to see your value.</li></ol><h3>Conclusion: Full Throttle or Fall Behind</h3><blockquote><strong>This isn’t an IT recession — AI just slammed the pedal to the metal.</strong></blockquote><p>The market didn’t slow down — it sped up. The companies and individuals who understand this will use AI not as a gimmick, but as a force multiplier to deliver more value in less time. The ones who don’t will keep planning like it’s 2015, watching their roadmaps slip while their competitors ship feature after feature.</p><p>Whether you’re leading a company or building as an individual contributor, the reality is the same: the baseline has shifted. AI isn’t replacing all of us — but it’s replacing the pace we used to work at.</p><blockquote>You don’t have to put AI into every feature. You don’t have to automate everything. But you do have to move faster.</blockquote><p>Because in this market, it’s not the size of your team or the depth of your funding that decides who wins — it’s who adapts first, and who adapts best.</p><p>So ask yourself — are you still driving at last decade’s speed limit while the rest of the highway is going full throttle?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*lPQ9wsZkBMzpST1DaovS7A.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34d4263adaef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FrankenPHP vs PHP-FPM (Part 3): CPU, Memory, and the Hidden Cost of Doing Nothing]]></title>
            <link>https://vulke.medium.com/frankenphp-vs-php-fpm-part-3-cpu-memory-and-the-hidden-cost-of-doing-nothing-92bfee7b00a5?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/92bfee7b00a5</guid>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[frankenphp]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 22:51:36 GMT</pubDate>
            <atom:updated>2025-08-03T23:00:15.576Z</atom:updated>
            <content:encoded><![CDATA[<p>In <a href="https://vulke.medium.com/frankenphp-vs-php-fpm-benchmarks-surprises-and-one-clear-winner-173231cb1ad5">Part 1</a>, we compared FrankenPHP and PHP-FPM using raw “Hello World”-style benchmarks. Even in those simple cases, FrankenPHP surprised us with significantly faster responses.</p><p><a href="https://vulke.medium.com/frankenphp-vs-php-fpm-part-2-symfony-real-workloads-and-bigger-projects-9ee2f2025350">Part 2</a> raised the stakes: real Symfony apps, full service autowiring, controllers, middleware, and larger payloads. Once again, FrankenPHP — especially in worker mode — outperformed FPM under load.</p><p>But raw performance isn’t the full story. What happens <em>between</em> requests? When no one is actively using your site, what’s going on under the hood? What are the hidden costs of just keeping things online?</p><p>In this third part, we explore an often-overlooked angle:<br><strong>Memory, CPU usage, and idle behavior over time.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*K75zOugTiEN5AaBDry9chw.jpeg" /></figure><h3>Let’s Start: Why This Test Matters</h3><p>For many production apps, traffic isn’t constant. You might have spikes in the morning and evening, followed by long quiet periods. If your server holds onto memory unnecessarily or spins the CPU even when idle, those hidden inefficiencies add up.</p><p>In large-scale environments, this matters for <strong>server consolidation and cost optimization.</strong> In smaller projects or VPS setups, it can be the difference between stability and memory exhaustion.</p><p>So we asked:</p><ul><li>How much memory and CPU do these runtimes use while serving traffic?</li><li>What about when they’re idle?</li><li>Do any of them “calm down” when the load drops, or do they keep holding onto everything?</li></ul><h3>Test Setup: Minimal Resources, Realistic Pressure</h3><p>To expose these behaviors clearly, we constrained our environment intentionally.</p><ul><li><strong>Each container was limited to 2 CPUs and 1 GB RAM</strong>, simulating a cheap VPS or small Docker host.</li><li>The same heavy Symfony app from Part 2 was used for all tests.</li><li><strong>Three scenarios were tested:<br>- </strong>PHP-FPM (classic setup)<br>- FrankenPHP without worker mode<br>- FrankenPHP with native worker mode enabled</li></ul><p>These were <strong>not cloud load tests</strong>. Everything ran <em>inside one AWS VM</em>, but tools like wrk and psrecord were run locally, without external traffic or proxies interfering.</p><p>We used:</p><ul><li><a href="https://github.com/wg/wrk">wrk</a> for HTTP stress testing (multiple threads, high concurrency)</li><li><a href="https://github.com/astrofrog/psrecord">psrecord</a> to monitor per-process CPU and memory usage, producing time-based graphs</li><li>Additional observations using Symfony profiler and various other logs</li></ul><p>The goal wasn’t to simulate traffic from millions of users — but rather to understand <em>how each engine behaves under repeated pressure and idle recovery</em> on constrained hardware.</p><blockquote>You’ll see wrk stats and <a href="https://github.com/astrofrog/psrecord">psrecord</a>charts throughout this article — not because it’s the only tool we used, but because it’s one of the easiest ways to make performance differences visually obvious.</blockquote><blockquote>Behind the scenes? Let’s just say wrk was the tip of the iceberg. We also ran tests using wrk2, k6, and Blackfire, experimented with various durations (some lasting hours), and hit the servers with both normal and pathological loads.</blockquote><blockquote>The results you see here are the cleanest snapshots of those experiments — but the trends were consistent no matter what we threw at them.</blockquote><h3>Load Tests: Memory and CPU Under Pressure</h3><p>When placed under sustained traffic, PHP-FPM and FrankenPHP (in worker mode) behave fundamentally differently — not only in terms of raw performance, but in how they consume CPU and memory. This section explores what those differences look like in practice.</p><h3>How PHP-FPM Handles Load</h3><p>PHP-FPM (FastCGI Process Manager) manages a pool of worker processes, each running in isolation. For every incoming request:</p><ul><li>A process is assigned (or created dynamically).</li><li>The full Symfony kernel is bootstrapped.</li><li>Services are instantiated.</li><li>The request is handled, and the response is returned.</li></ul><p>Depending on your FPM configuration (dynamic, ondemand, or static), these processes may stick around for a few more requests — but they’re short-lived by design. Crucially, every single request goes through the full boot cycle.</p><blockquote>This architecture provides strong stability: memory leaks are less likely to accumulate, and rogue requests are isolated by design. However, it comes at a cost — each request incurs startup overhead and burns CPU just to get Symfony up and running.</blockquote><h3>PHP-FPM Load Test Setup</h3><p>We simulated steady traffic using:</p><pre>wrk -t4 -c100 -d90s localhost:8080</pre><p>That’s 4 threads and 100 concurrent connections, sustained over 90 seconds.</p><h3>PHP-FPM Results</h3><p>Here’s what we observed during the load test (container-level metrics):</p><ul><li><strong>Peak memory usage:</strong> ~25 MB</li><li><strong>Average CPU usage:</strong> ~150–200%</li><li><strong>Average latency:</strong> 416 ms</li><li><strong>Throughput:</strong> ~240 requests/sec</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*2v6V6dR9X9C5jjyEFc9NAw.png" /></figure><p><strong>Interpretation</strong>:<br>FPM handled the load reliably. Memory stayed stable — thanks to the isolated nature of FPM workers — and CPU was high but not extreme. However, the average latency was substantial, and throughput was modest. Much of the performance cost goes into bootstrapping the framework again and again.</p><h3>FrankenPHP (Without Worker): Minimalist, But Still Costly?</h3><p>You might expect FrankenPHP — when running <strong>without</strong> worker mode — to behave similarly to FPM. After all, in this mode, FrankenPHP spins up a fresh Symfony application per request, just like PHP-FPM does.</p><p>However, in practice, things are slightly different.</p><p>Despite the similarity in architecture, FrankenPHP still keeps more memory in use over time. This may be due to how it internally manages the HTTP stack (since it’s also acting as a full web server), or differences in how processes are spawned and reused under the hood.</p><h3>How FrankenPHP (Without Worker) Handles Load</h3><p>When not using worker mode, FrankenPHP behaves more like a traditional PHP-FPM stack. For every request:</p><ul><li>A new PHP process is forked (internally by the FrankenPHP binary).</li><li>The Symfony kernel is booted fresh.</li><li>Services are rebuilt.</li><li>The response is served.</li></ul><p>Unlike worker mode, there is <strong>no in-memory kernel reuse</strong>. Each request starts from scratch — similar to FPM — but handled inside the FrankenPHP binary without FastCGI overhead.</p><p>This mode benefits from simplicity and better compatibility with legacy workflows. However, it <strong>loses most of the performance and resource advantages</strong> of FrankenPHP’s full worker setup.</p><h3>FrankenPHP (No Worker) Load Test Setup</h3><p>We used the same test parameters for a fair comparison:</p><pre>wrk -t4 -c100 -d90s http://localhost:8081</pre><p>FrankenPHP was explicitly <strong>run without worker mode enabled</strong>, so each request was bootstrapped from zero.</p><h3>FrankenPHP (No Worker) Results</h3><p>During the 90-second test, container-level monitoring showed:</p><ul><li><strong>Peak memory usage</strong>: ~110 MB</li><li><strong>Average CPU usage</strong>: ~200%</li><li><strong>Average latency</strong>: ~324 ms</li><li><strong>Throughput</strong>: ~310 requests/sec</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ozAX5___3JwV9eN8Xve3Ng.png" /></figure><p><strong>Interpretation:</strong><br>Despite not using workers, FrankenPHP handled significantly more requests than FPM — with <strong>lower latency and better throughput</strong>. However, this came at a price: <strong>higher CPU and much higher memory usage</strong>.</p><p>Unlike FPM, which isolates workers and tends to release memory quickly, FrankenPHP’s monolithic process retains significantly more memory between requests — even when <strong>worker mode is turned off</strong>. This suggests that internal optimizations (like static data, caching layers, or Symfony bootstrapping) are handled differently under the hood.</p><p>And that leads to a surprising question:</p><blockquote>If FrankenPHP without workers behaves <em>similarly</em> to FPM in how it boots the framework per request…<br><strong>Why does it consume so much more memory and CPU over time?</strong></blockquote><p>The answer lies in how the two execution models are architected.</p><p><strong>PHP-FPM</strong> uses a traditional FastCGI model where incoming requests are handled by a pool of <strong>isolated worker processes</strong>. Depending on the configuration (dynamic, ondemand, static), a worker may either be spawned fresh or <strong>reused for a few requests</strong> before being recycled. In either case, memory is frequently released back to the OS — either when the worker dies or when its lifecycle ends.</p><p><strong>FrankenPHP</strong>, on the other hand, operates as a <strong>monolithic HTTP server</strong>. Even with workers disabled, it <strong>does not fork a new process per request</strong>. Instead, all requests are handled inside a <strong>single long-running process</strong> — similar to how Go or Node.js servers operate.</p><p>In short:</p><blockquote><strong><em>FPM behaves like a script runner. FrankenPHP behaves like a server.</em></strong></blockquote><p>Even in non-worker mode, FrankenPHP doesn’t reset the way FPM does — and that architectural distinction explains the higher resource usage.</p><h3>How FrankenPHP Handles Load (Worker Enabled)</h3><p>When running in its <strong>native worker mode</strong>, FrankenPHP unlocks one of its biggest advantages: <strong>persistent, warm application memory</strong> across requests.</p><p>Instead of bootstrapping Symfony from scratch every time, each worker:</p><ul><li>Boots the Symfony kernel once.</li><li>Holds it in memory between requests.</li><li>Serves subsequent requests from that already-initialized state.</li></ul><p>This approach is similar to what RoadRunner, Swoole, and other persistent PHP runtimes aim to do — but FrankenPHP integrates it directly into the HTTP layer, without extra dependencies or side processes.</p><p>This makes a <strong>huge</strong> difference in performance… but what about <strong>resource usage</strong>?</p><h3>FrankenPHP (Worker Mode) Load Test Setup</h3><p>We used the same load scenario as in previous tests:</p><pre>wrk -t4 -c100 -d90s http://localhost:8081</pre><p>This hit the server with 4 threads, 100 concurrent connections, over 90 seconds of continuous pressure — identical to the PHP-FPM scenario.</p><h3>FrankenPHP (Worker Mode) Results</h3><p>From the 2-minute stress test:</p><ul><li><strong>Peak memory usage</strong>: ~100–120 MB</li><li><strong>Average CPU usage</strong>: ~200% (2x100%)</li><li><strong>Average latency</strong>: ~140 ms</li><li><strong>Throughput</strong>: ~711 requests/sec</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*S5EkhRbdBAJV7oCwvHqRpQ.png" /></figure><p><strong>Interpretation:</strong></p><p>This is where <strong>FrankenPHP truly shines</strong>:</p><ul><li>It’s <strong>almost 3× faster than PHP-FPM</strong> in raw throughput.</li><li><strong>Latency drops by more than 60%</strong> compared to FPM.</li><li>Even with more requests, <strong>memory usage stays modest</strong> and predictable.</li></ul><p>Why is this possible? Because worker mode allows FrankenPHP to:</p><ul><li><strong>Reuse the Symfony kernel</strong> across requests.</li><li>Keep services, routes, and caches <strong>warm and ready</strong>.</li><li>Avoid constant reboots or unnecessary I/O.</li></ul><p>While the memory usage looks similar to the non-worker version in charts, the difference is architectural:</p><ul><li><strong>Non-worker mode</strong> still bootstraps the app each time.</li><li><strong>Worker mode</strong> keeps the full app alive and ready — which explains the huge performance gains without any extra RAM cost.</li></ul><p>In many ways, this is what people wanted PHP to become for modern web workloads: fast, persistent, predictable — and efficient even under stress.</p><p>So those are the <em>under-load</em> behaviors. But how do they behave when the traffic stops? That’s what we tested next.</p><h3>Idle State: What Happens When Nobody’s Home?</h3><p>Performance under load is important — but in reality, most servers spend the majority of their time <strong>waiting</strong>. During nights, weekends, or periods of inactivity, what happens to system resources?</p><p>Do memory and CPU usage drop to near-zero? Or do some engines keep “holding on” to more than they should?</p><p>This section explores how <strong>PHP-FPM</strong>, <strong>FrankenPHP without worker mode</strong>, and <strong>FrankenPHP with worker mode</strong> behave when left completely idle — right after boot, with no requests sent.</p><p>All containers were launched fresh, with the same resource constraints (2 CPUs, 1 GB RAM), and allowed to settle before recording.</p><h3>PHP-FPM in Idle</h3><p>As expected, PHP-FPM uses very few resources when idle:</p><ul><li><strong>Peak memory usage</strong>: ~20–25 MB</li><li><strong>CPU usage</strong>: &lt; 1%</li><li>Processes are forked, but sit in sleep mode unless invoked.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*EkqPBcWdtml2ghiT70mhlg.png" /></figure><blockquote><strong>PHP-FPM is Ideal for bursty or infrequent workloads</strong>, like cron-driven tasks, legacy CMS sites, or low-traffic WordPress installs. Resource usage is minimal when inactive.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*pUcgjD5VT4nZJQ8hvoySJQ.jpeg" /><figcaption>This also applies where your current architecture is doing great job</figcaption></figure><h3>FrankenPHP (No Worker Mode) in Idle</h3><p>FrankenPHP without workers also stays relatively modest when idle:</p><ul><li><strong>Peak memory usage</strong>: ~60 MB</li><li><strong>CPU usage</strong>: ~1–3% (occasionally spikes, probably some internal checks)</li><li>The Symfony app isn’t persistently running, but the server binary itself is more complex and likely holds shared resources.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*FL3eDZ6Vfib0Tsg343ID1g.png" /></figure><p>This may not seem like much, but compared to FPM, it’s 2<strong>–3× higher memory usage</strong>, even when doing nothing.</p><p>This hints that <strong>even without workers</strong>, FrankenPHP keeps more in memory — likely for internal routing, precompiled logic, or optimization layers.</p><h3>FrankenPHP (With Worker Mode) in Idle</h3><p>Once the worker mode is enabled, FrankenPHP essentially runs as a <strong>long-lived application</strong>. As a result:</p><ul><li><strong>Peak memory usage</strong>: ~85 MB</li><li><strong>CPU usage</strong>: ~1-3% idle (occasionally spikes, probably some internal checks)</li><li>The Symfony kernel remains fully loaded and “hot” in memory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*jXvNwakaX9evgkwBTSavHg.png" /></figure><p>This is the cost of keeping your app always ready — <strong>zero boot time</strong>, but a persistent memory footprint.</p><blockquote>This is <strong>great </strong>for modern apps, APIs, or real-time systems. But it could be overkill for static sites or admin dashboards used once a week.</blockquote><h3>Which One Should You Use and When?</h3><p>After weeks of testing, experiments, Docker tweaks, and way too many wrk wrk2, Blackfire profiles, k6… here’s where I landed:</p><p>There’s no silver bullet. But there is a pattern.</p><p><strong>Use PHP-FPM if:</strong></p><ul><li>Your application receives <strong>low or sporadic traffic</strong> (e.g. admin dashboards, internal tools, small WordPress sites).</li><li>You host <strong>multiple small projects</strong> on the same server, most of which are idle most of the time.</li><li>You prefer <strong>stability and isolation</strong> over raw performance.</li><li>You already have <strong>infrastructure built around Nginx/Apache + PHP-FPM</strong> and don’t need major changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*M3ptYODJc8_WMWnCC2B2MQ.jpeg" /></figure><p><strong>Use FrankenPHP (especially with workers) if:</strong></p><ul><li>You’re running <strong>high-traffic applications</strong> or <strong>APIs that receive constant traffic</strong>.</li><li>You want <strong>lower latency and higher throughput</strong> per container or per VM.</li><li>You benefit from <strong>built-in server capabilities</strong> (like static file serving, Caddy integrations, HTTP/2/3).</li><li>You’re building <strong>modern, containerized applications</strong> and want to reduce server complexity.</li></ul><p>The tradeoff is clear:</p><ul><li>FrankenPHP <strong>delivers performance</strong> — but retains memory and uses CPU more aggressively.</li><li>PHP-FPM <strong>saves resources when idle</strong> — but pays the price on every single request.</li></ul><p>Choose based on your workload, not your instincts.</p><h3>Cost Efficiency (Rough Estimation)</h3><p>While performance benchmarks are insightful, it’s often raw cost efficiency that matters most.</p><p>The chart below shows a <strong>very rough approximation</strong> based on our own internal testing. It assumes a pricing model reflecting compute usage under load.</p><p>FrankenPHP starts cheaper and scales more gracefully as traffic increases. FPM might be more cost-effective if your apps sit mostly idle (e.g., WordPress admin sites, legacy dashboards, or infrequent APIs), but beyond a few thousand requests per hour, <strong>FrankenPHP becomes the financially smarter choice</strong>.</p><p>If you’re building for scale, here’s a rough cost model based on hourly request volumes — it shows where FPM starts costing more due to scaling inefficiencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6eo9R9oDC7G0ha8D92zdOw.png" /><figcaption>Very rough estimation, but the point stays, more trafic, more reasons to go on FrankenPHP</figcaption></figure><blockquote>To handle the same amount of requests, PHP-FPM needs more machines, more memory, and more CPU — because every request is “expensive”.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*2LL6VY9ucRsm4dEA3siVlQ.jpeg" /><figcaption>When you realize FrankenPHP with workers saves more money in cloud costs<br> than your entire dev team’s coffee budget</figcaption></figure><h3>One Final Note on Long-Term Behavior</h3><p>While these tests focused on short-term benchmarks, real-world apps live for weeks or months — and this is where <strong>FrankenPHP’s design becomes especially interesting</strong>.</p><p>FrankenPHP offers:</p><ul><li>The ability to <strong>auto-restart worker processes</strong> after X requests or Y time</li><li>The ability to <strong>restart worker processes</strong> via an API call</li><li>The ability to <strong>restart worker processes</strong> after X failed requests</li><li>Memory usage limits and crash recovery for rogue requests</li><li>Options to fine-tune <strong>how and when resources are released</strong></li><li>A smaller surface for memory leaks to hide, compared to traditional FPM pools</li></ul><p>But here’s the catch:</p><blockquote><em>These features </em><strong><em>only help if you use them</em></strong><em>.<br>And long-term stability still depends on your app, your framework, and your code.</em></blockquote><p>So if you’re running long-lived containers or processes, don’t just benchmark — monitor. Use Blackfire, Prometheus, Grafana, etc. to catch issues before they cost you money or uptime.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92bfee7b00a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Frameworks Die — And How to Choose Technologies That Won’t Fail You]]></title>
            <link>https://vulke.medium.com/why-frameworks-die-and-how-to-choose-technologies-that-wont-fail-you-9c367db4d226?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c367db4d226</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 21:50:08 GMT</pubDate>
            <atom:updated>2025-07-30T21:50:08.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Frameworks Die — And How to Choose Technologies That Won’t Fail You</h3><h3>Let&#39;s start: The Frameworks We Loved — And Had to Bury</h3><p>As developers, we tend to form strange attachments to the tools we use. A good framework can feel like a superpower — it makes us faster, more confident, and in control. But unlike programming languages or design principles, <strong>frameworks are fragile</strong>. They rise quickly, fall silently, and often leave behind a mess for someone else to clean up.</p><p><strong>I’ve seen this happen more than once.</strong></p><p>Early in my career, I stumbled upon a PHP framework called <a href="https://kohanaframework.org/"><strong>Kohana</strong></a>. It was lightweight, elegant, and way ahead of its time — full OOP, HMVC architecture, zero configuration. It felt like the perfect tool. But before I knew it, Kohana was gone. No clear end-of-life announcement, no migration strategy, just abandonment.</p><p>And then, almost a decade after it had effectively died, I had the misfortune of encountering it again — buried inside a legacy system I had to maintain. Same folder structure. Same undocumented logic. Same feeling of: <em>“How did we ever think this was sustainable?”</em></p><p>Another example was <strong>FuelPHP</strong>, a promising framework that emerged around 2010 with modern ideas and a dedicated community. It looked like the future — until it didn’t. Development slowed, core contributors moved on, and the ecosystem faded into irrelevance. Like Kohana, it quietly vanished from the PHP landscape, leaving behind unfinished projects and difficult decisions.</p><p>So I wrote this article to unpack something we rarely talk about directly:</p><ol><li>Why once-popular frameworks fade or die,</li><li>How Kohana — my own cautionary tale — rose and fell,</li><li>And what to actually look for when choosing technology that <em>won’t</em> fail you in two years.</li></ol><p>If you’ve ever inherited a ghost of a framework wrapped in business-critical logic — this one’s for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*PAZZZnzue0tfsQzj124RHg.jpeg" /><figcaption>Ten years later, you’re still the only one who knows how it works.</figcaption></figure><h3>Graveyard of Frameworks: The Rise and Quiet Fall</h3><p>Frameworks rarely die in one dramatic moment.<br>Instead, they fade — slowly and quietly.</p><p>One day, you’re building confidently on a clean and promising foundation. The next, the documentation hasn’t been updated in a year, the GitHub issues go unanswered, and your dependencies are breaking with every PHP upgrade.</p><p>Unlike programming languages or protocols, <strong>frameworks rely on momentum</strong>, community, and ongoing trust. When those break — it’s only a matter of time.</p><p>There are many reasons a framework can fall apart:</p><ul><li>a complete rewrite without a migration path,</li><li>stagnation while the ecosystem moves on,</li><li>or simply being outpaced by better-documented, more community-driven alternatives.</li></ul><p>And no framework captures all of those pitfalls quite like <strong>Kohana</strong>.</p><h3>The Rise of Kohana: CodeIgniter’s Smarter, Leaner Successor</h3><p>In 2007, a group of developers forked <a href="https://www.codeigniter.com/">CodeIgniter</a> — one of the most popular PHP frameworks at the time — with a bold goal: to modernize it. CodeIgniter had always been simple and approachable, but it had limitations. It wasn’t fully object-oriented, lacked namespaces, and resisted many of the improvements arriving with PHP 5.</p><p>The fork was called <strong>Kohana</strong>.</p><p>And for a while, it was everything the PHP world needed.</p><h4>Framework Ahead of Its Time</h4><p>Kohana introduced:</p><ul><li><strong>Full OOP architecture</strong>, long before it became standard in PHP frameworks.</li><li>A <strong>modular system</strong> that made it easy to isolate and reuse logic.</li><li><strong>Autoloading</strong>, so you didn’t have to manually include files.</li><li>An elegant implementation of <strong>HMVC</strong> (Hierarchical Model-View-Controller) — which felt like magic for structuring large applications.</li></ul><p>It was fast, minimal, and had no external dependencies. You downloaded the zip file, dropped it into your project folder, and you were ready to build. No vendor directory, no Composer, no configuration jungle.</p><p>For developers tired of bloated or rigid systems, Kohana felt clean and powerful — like PHP the way it <em>should</em> be.</p><h4>Real Adoption, Real Momentum</h4><p>From around <strong>2009 to 2012</strong>, Kohana was widely used in small-to-medium projects and even some startups. You’d often see it recommended on forums or Reddit threads like:</p><blockquote><em>I need something faster and more modern than CodeIgniter — try Kohana.</em></blockquote><p>It had traction.<br>It had contributors.<br>It had… potential.</p><h3>The Fall of Kohana: Death by Neglect</h3><p>And then it started to slip.</p><h4>A Rewrite Without a Path</h4><p>The transition from <strong>Kohana 2 to Kohana 3</strong> was not just an upgrade — it was a complete rewrite.<br>Classes, folder structure, syntax — nearly everything changed.</p><p>But here’s the problem: there was <strong>no official migration strategy</strong>, no tooling, and only sparse documentation. Developers who had committed to Kohana 2 were left stranded. New developers didn’t know which version to start with. The result: fragmentation and confusion.</p><h4>Documentation Lagged Behind</h4><p>Kohana always had a reputation for poor documentation — even during its peak.<br>Much of the learning process came from reading source code or blog posts from early adopters. The official docs were incomplete or outdated, especially as versions evolved. For many, that became a dealbreaker.</p><p>When <a href="https://symfony.com/">Symfony</a> improved its documentation and <a href="https://laravel.com/">Laravel</a> entered the scene with beautifully written docs and a growing community, it was game over.</p><h4>A Community Without a Leader</h4><p>Kohana was community-driven — and that was both its strength and its downfall.<br>There was no single company or figure pushing it forward, no long-term roadmap, no official team behind the scenes. As contributors burned out or moved on, there was no one left to keep the lights on.</p><ul><li>By <strong>2014</strong>, development had slowed to a crawl.</li><li>By <strong>2016</strong>, the last release was published.</li><li>By <strong>2017</strong>, the official website went offline.</li></ul><p>And yet, Kohana never really left — not entirely.</p><p>Years after its death, it kept showing up in legacy systems. I encountered it almost <strong>a decade later</strong>, embedded deep in a project that still depended on it. Same cryptic file structure. Same missing docs. Same sense of unease.</p><p>It was like finding a ghost in the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*9vPH9AaOgpIWZLB_l23ImQ.jpeg" /><figcaption>The docs still load, so I think we’re good.</figcaption></figure><h3>Others That Followed: FuelPHP, Backbone, Pylons, Silverlight…</h3><h4>FuelPHP (PHP)</h4><ul><li><strong>Launched:</strong> ~2010</li><li><strong>Pitch:</strong> A modern, OOP PHP framework with HMVC and namespaces, created by former CodeIgniter and Kohana contributors.</li><li><strong>What went wrong:</strong> Weak documentation, slow adoption of Composer/PSRs, and Laravel’s rise pulled the community away.</li><li><strong>Status:</strong> Dead — no major updates in years.</li></ul><h4>Backbone.js (JavaScript)</h4><ul><li><strong>Launched:</strong> 2010</li><li><strong>Pitch:</strong> A lightweight JavaScript framework for giving structure to jQuery-heavy apps.</li><li><strong>What went wrong:</strong> Minimal innovation post-launch. Lacked component model, state management, and tooling. React, Vue, and Angular took over.</li><li><strong>Status:</strong> Technically maintained, but functionally obsolete.</li></ul><h4>Pylons (Python)</h4><ul><li><strong>Launched:</strong> Mid-2000s</li><li><strong>Pitch:</strong> A flexible, full-stack web framework combining WSGI, Routes, and SQLAlchemy.</li><li><strong>What went wrong:</strong> Community fragmented, merged into Pyramid. Lost identity and relevance.</li><li><strong>Status:</strong> Abandoned — Pyramid continues, but Pylons is gone.</li></ul><h4>Silverlight (C# / .NET)</h4><ul><li><strong>Launched:</strong> 2007 (Microsoft)</li><li><strong>Pitch:</strong> A rich web application platform — Microsoft’s answer to Adobe Flash.</li><li><strong>What went wrong:</strong> Proprietary, plugin-based, no mobile support. HTML5 won the standards war.</li><li><strong>Status:</strong> Dead — official support ended in 2021.</li></ul><h4>Apache Flex (ActionScript / Flash)</h4><ul><li><strong>Launched:</strong> 2004 (Macromedia, later Adobe)</li><li><strong>Pitch:</strong> A full UI framework for building Flash-based RIA (Rich Internet Applications).</li><li><strong>What went wrong:</strong> Flash died, Apple rejected plugins, the web moved to JavaScript.</li><li><strong>Status:</strong> Dead — long live HTML5.</li></ul><p>And the list goes on and on…</p><h3>What We Learned: How to Choose Tech That Won’t Die on You</h3><p>Technology moves fast — but it forgets just as fast.</p><p>Frameworks rise with blog hype and early <a href="https://github.com/">GitHub</a> stars, only to disappear quietly when documentation stalls, contributors leave, or the next shiny tool comes along. If you’ve ever had to rewrite a stable but unmaintainable system just to escape a dead framework, you know how painful that is.</p><p>So how do you protect yourself from choosing the <em>next</em> Kohana?</p><h3>Active Community: The Heartbeat of a Healthy Framework</h3><p>A framework without a community is a framework on life support.</p><p>It’s easy to get excited by a shiny GitHub repo with clever code — but if no one else is actively using it, supporting it, or talking about it, you’re signing up for a lonely ride. An active community is your safety net: they’ll answer your StackOverflow question at 2AM, write tutorials you didn’t know you needed, create plugins that solve your edge case, and push maintainers to keep improving the project.</p><p>Here’s what a truly active community looks like:</p><ul><li><strong>GitHub activity:</strong> Issues are created, commented on, and closed regularly. Pull requests are reviewed within days, not months.</li><li><strong>Multiple contributors:</strong> Look at the <strong>number of unique commenters</strong>, committers, and people opening PRs — if it’s just one or two people doing everything, that’s a red flag.</li><li><strong>Discussions in public:</strong> Discord, Slack, Reddit, forums — people are sharing patterns, troubleshooting bugs, and helping each other.</li><li><strong>Third-party content:</strong> Blog posts, YouTube tutorials, conference talks, and open-source integrations are clear signs that people are investing time and knowledge into the ecosystem.</li><li><strong>Meetups or conferences:</strong> Even digital-only communities thrive when there’s a sense of shared mission and regular knowledge exchange.</li></ul><p><strong>Why it matters:<br></strong> When you hit a wall (and you will), a healthy community is often more valuable than official documentation. And if the core team disappears, the community is what keeps the project alive — or forks it into something better.</p><blockquote><strong>Tip:</strong> Don’t just look at the GitHub star count. Check the <strong>activity feed</strong>, the <strong>diversity of contributors</strong>, and how often issues are responded to by <em>different people</em> — not just one dedicated maintainer.</blockquote><h3>Ecosystem &amp; Tooling: More Than Just the Core</h3><p>A framework is never just the core codebase — it’s the ecosystem around it that defines how productive (or painful) your experience will be.</p><p>You’re not just building with a framework. You’re:</p><ul><li>Writing tests</li><li>Handling migrations</li><li>Working with APIs</li><li>Integrating authentication</li><li>Deploying to cloud infrastructure</li><li>Debugging weird edge cases at 3am</li></ul><p>If the framework doesn’t have solid tooling or you constantly find yourself writing your own wrappers, libraries, or boilerplate for basic things, it becomes a time sink — no matter how “clean” or “elegant” its core is.</p><h4>What to look for:</h4><ul><li><strong>CLI tools</strong> for generating code, running tasks, debugging, seeding databases, etc.</li><li><strong>Rich plugin ecosystem</strong> (e.g. packages for auth, queues, caching, file storage, API docs…)</li><li><strong>Integration with modern workflows</strong> (Docker, CI/CD pipelines, testing frameworks)</li><li><strong>Standardized structure</strong> that works well with IDEs, linters, and static analysis tools</li><li><strong>Performance profiling &amp; monitoring support</strong> (Xdebug, Blackfire, OpenTelemetry…)</li></ul><h4>Why it matters:</h4><p>Without tooling and an ecosystem, you’re not building apps — you’re building infrastructure.<br> And if you have to glue everything together yourself, you’re effectively building a new framework from scratch — minus the documentation.</p><blockquote><strong><em>Tip:</em></strong><em> Search GitHub or Packagist/NPM/PyPI for integrations. The more community-maintained packages you find (and the more recently they were updated), the stronger the ecosystem.</em></blockquote><h3>Clear Roadmap &amp; Backward Compatibility: Stability Is a Feature</h3><p>Frameworks aren’t just tools — they’re long-term investments. The moment you build something serious on top of one, you inherit every decision its maintainers make from that point forward.</p><p>So when a framework suddenly rewrites everything, changes its philosophy, or drops features without warning, you’re left scrambling. Deadlines don’t care that a breaking change was “philosophically necessary.”</p><p>A stable framework doesn’t have to stand still — it just needs to <strong>evolve responsibly</strong>.</p><h4>What to look for:</h4><ul><li><strong>A public roadmap</strong> or changelog — ideally with timelines or milestones.</li><li><strong>Semantic versioning</strong> (or similar discipline) that separates breaking changes from patches.</li><li><strong>Upgrade guides</strong> and migration tools between major versions.</li><li><strong>Deprecation warnings</strong> in advance, with transitional support.</li><li><strong>LTS (Long-Term Support) releases</strong> — especially valuable for enterprise or mission-critical apps.</li></ul><h4>Why it matters:</h4><p>Rewriting your app every 18 months isn’t sustainable. Frameworks with wild version jumps and no upgrade plan (like Kohana 2 → 3 or AngularJS → Angular 2) kill long-term confidence.</p><p>If you see a pattern of “new version, no path, good luck,” it’s only a matter of time before you’re stuck maintaining a frozen, un-upgradeable legacy project.</p><blockquote><strong><em>Tip:</em></strong><em> Browse past release notes. If every version comes with breaking changes and no upgrade tooling, walk away — unless you’re okay rebuilding your entire stack in a year.</em></blockquote><h3>Great Documentation: The Real Framework Killer (or Savior)</h3><p>Let’s be honest: most of us don’t read source code for fun.</p><p>When deadlines loom, and you’re trying to integrate authentication, fix a database issue, or understand why a feature isn’t working, <strong>clear and complete documentation becomes more important than clean architecture</strong>. Even the most elegant framework can become unusable if it doesn’t explain itself well.</p><p>In fact, many now-dead frameworks didn’t die because they were technically bad — they died because no one could figure out how to use them.</p><h4>What to look for:</h4><ul><li><strong>Beginner-friendly guides</strong>: “Getting Started” tutorials, not just API dumps.</li><li><strong>Clear real-world examples</strong>: code snippets that resemble what you’re trying to build.</li><li><strong>Up-to-date references</strong>: docs that match the latest release, not the version from 3 years ago.</li><li><strong>Explanations, not just signatures</strong>: you shouldn’t need to guess what parameters do.</li><li><strong>Searchable format</strong>: Markdown is fine, but a searchable web UI is better.</li></ul><h4>Why it matters:</h4><p>Good documentation lowers the learning curve, enables team scaling, and reduces bugs caused by misunderstandings. It also creates trust — if the docs are well-maintained, there’s a good chance the framework is too.</p><p>And when new devs join your team? Good docs mean less hand-holding, fewer Slack messages, and faster onboarding.</p><blockquote><strong>Tip:</strong> If you land on a framework’s site and the docs link is broken, empty, or redirects to a forum post — run. That’s technical debt waiting to happen.</blockquote><blockquote>And yes, even AI needs something to learn from. If the docs don’t exist, neither you <strong>nor ChatGPT</strong> will know what’s going on.</blockquote><h3>Real-World Usage: The Quiet Metric That Speaks Volumes</h3><p>A framework can have 50,000 stars on GitHub — but if you can’t name a single serious app built with it, something’s off.</p><p>Tech built for production needs to <strong>prove itself in production</strong>. If companies are building real products, hiring devs, and scaling apps with it, that’s a strong sign the framework has staying power. If it lives only in tutorials, weekend hacks, and toy projects — proceed with caution.</p><h4>What to look for:</h4><ul><li><strong>Case studies or logos</strong>: Does the framework website mention companies using it?</li><li><strong>Open-source projects</strong>: Can you find real repos using it in the wild — not just demos?</li><li><strong>Job listings</strong>: Are companies hiring devs who already know it? Are agencies offering it as a service?</li><li><strong>Conferences or talks</strong>: Is the framework featured at real-world developer events?</li></ul><h4>Why it matters:</h4><p>If nobody serious is building with it, you may end up being the biggest user — and the unofficial maintainer. That’s fine for hobby work, but dangerous for critical systems.</p><p>Also, a strong industry footprint often leads to better documentation, tooling, and long-term stability — because there are more voices pushing it forward.</p><blockquote><strong><em>Tip:</em></strong><em> Try searching “built with [framework]” or browse tech stack profiles on sites like StackShare or GitHub topics. If you keep hitting blogs and abandoned demos, it’s probably not widely adopted.</em></blockquote><h3>Backed by a Maintainer (or Company): Someone Has to Steer the Ship</h3><p>Open source is beautiful — until nobody maintains it.</p><p>A framework without a clear maintainer is like a ship without a captain: it may drift for a while, but eventually it hits something and sinks. While community-driven projects can thrive, long-term stability often depends on <strong>structure, funding, and accountability</strong>.</p><p>Whether it’s a solo visionary (like Taylor Otwell with Laravel), or a company (like JetBrains backing Kotlin or Symfony’s SensioLabs), strong stewardship makes a huge difference.</p><h4>What to look for:</h4><ul><li><strong>Named maintainers or core team</strong>: Who owns decisions? Who signs off on releases?</li><li><strong>Funding or sponsorship</strong>: OpenCollective, GitHub Sponsors, company payroll — how is this being sustained?</li><li><strong>Governance model</strong>: Are contributions organized? Are major decisions transparent?</li><li><strong>Response to issues</strong>: Are maintainers actively participating, or is the community left guessing?</li></ul><h4>Why it matters:</h4><p>Without someone keeping the lights on, even the best frameworks slowly rot. And when bugs, security issues, or dependency breakages pile up, only active leadership can respond quickly and responsibly.</p><blockquote><strong>Tip:</strong> Check the repository’s contributors tab. If it’s 95% one person and they haven’t been active in 6 months — that’s not a stable project, it’s a time bomb.</blockquote><blockquote>Even better: look for projects backed by <strong>a real company</strong> or a structured team, not just a weekend warrior. Community passion is great — but <strong>business continuity needs professionalism</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*uZM5BvxEaXhEPahcBr1LoA.jpeg" /><figcaption>It’s not glamorous, but it keeps production alive.</figcaption></figure><h3>Conclusion: Great Code Doesn’t Save a Dead Framework</h3><p>I started this article because I had to maintain a Kohana codebase — nearly a decade after it went on life support, and 5 years after it died.<br> It was a reminder that <strong>choosing a framework is never just about the code</strong>. It’s about the people, the tools, the roadmap, the ecosystem, and the community that grows around it — or doesn’t.</p><p>We’ve looked at frameworks that shined for a moment and then disappeared: Kohana, FuelPHP, Backbone, Pylons, Silverlight, and dozens more. Some were technically solid. Some were visionary. Some even had corporate backing. But in the end, they shared a common fate: <strong>they lost momentum, structure, and support.</strong></p><p>Today, choosing the right stack is harder than ever. Hype moves fast, stars come easy, and “modern” doesn’t always mean stable. That’s why it’s worth stepping back and asking:</p><ul><li>Who’s maintaining this?</li><li>Can I still use this in 5 years?</li><li>Will other devs want to work with it?</li><li>Will I be alone when something breaks?</li></ul><p>There are <strong>no perfectly safe decisions</strong> in tech — surprises happen, and even great frameworks sometimes disappear.<br>But if you follow the signals we covered — community, ecosystem, documentation, stewardship — you’ll avoid the riskiest cliffs in almost every case.</p><blockquote><em>Because technical debt is bad — but architectural regret?<br>That sticks around for years.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c367db4d226" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FrankenPHP vs PHP-FPM (Part 2): Symfony Under Real Load and Why Workers Win]]></title>
            <link>https://vulke.medium.com/frankenphp-vs-php-fpm-part-2-symfony-real-workloads-and-bigger-projects-9ee2f2025350?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ee2f2025350</guid>
            <category><![CDATA[frankenphp]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-fpm]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 14:22:37 GMT</pubDate>
            <atom:updated>2025-08-03T23:04:06.589Z</atom:updated>
            <content:encoded><![CDATA[<p>In the <a href="https://vulke.medium.com/frankenphp-vs-php-fpm-benchmarks-surprises-and-one-clear-winner-173231cb1ad5">first part of this series</a>, we ran a series of raw performance benchmarks between <a href="https://frankenphp.dev/">FrankenPHP</a> and PHP-FPM using a minimal PHP script. The goal was to isolate and compare the performance of the underlying HTTP server mechanisms — not PHP itself, nor any application logic.</p><p>This time, we’re taking it further.</p><p>We’re swapping out the simple echo &quot;Hello World&quot; script with something real — a modern <a href="https://symfony.com/">Symfony</a> project, including routing, services, and, eventually, a large set of dependencies and bundles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*giXYahAzKFxIU6QN2JQTKg.jpeg" /><figcaption>Bootstrapped once. Served forever.</figcaption></figure><h3>What Are We Actually Testing?</h3><p>Let’s be clear — this is still not a full-stack benchmark. We are testing the one thing that matters in this context:</p><p><strong>How efficiently can a server handle modern PHP requests, specifically through Symfony, when run via Nginx + PHP-FPM versus FrankenPHP?</strong></p><p>What are we testing:</p><ul><li>HTTP Request Handling</li><li>Symfony Bootstrap Time</li><li>PHP Autoloading via Composer</li><li>Static Controller Response</li><li>Worker Pool Efficiency</li></ul><p>What we are <strong>NOT</strong> testing:</p><ul><li>MySQL queries</li><li>Redis or external services</li><li>Business logic performance</li><li>Authentication, validation</li><li>Templating or rendering speed</li></ul><h3>Why Symfony?</h3><p>Although I ran similar tests using <a href="https://laravel.com/">Laravel</a>, the results followed the same pattern — FrankenPHP consistently outperformed PHP-FPM. However, this article isn’t meant to compare frameworks, so I chose <a href="https://symfony.com/">Symfony</a> purely arbitrarily. The point is to evaluate <strong>how different server stacks handle modern PHP applications</strong>, not how the frameworks themselves behave.</p><p><em>Laravel fans, don’t worry — the numbers were just as satisfying. I simply didn’t want this article to turn into a Symfony vs Laravel debate.</em></p><h3>Test Environment</h3><p>To ensure a fair and clean environment:</p><ul><li>The tests were executed on a <strong>dedicated AWS EC2 instance</strong></li><li>Specs: <strong>6 vCPUs and 4 GB RAM</strong></li><li>All benchmarks were run <strong>directly from within the instance</strong>, avoiding network latency or local hardware interference</li></ul><h3>Tools Used for Benchmarking</h3><p>To ensure our results are both fair and meaningful, we used three different tools:</p><ul><li><strong>wrk</strong> — To measure raw throughput (requests per second) and determine how much load a setup can handle at full throttle.</li><li><strong>wrk2</strong> — To simulate a consistent stream of traffic at a fixed request rate. This reveals how each setup performs under controlled pressure.</li><li><strong>k6</strong> — To mimic real-world usage with multiple virtual users making parallel requests, including latency percentiles and error rates.</li></ul><p>Each tool served a unique purpose:</p><ul><li><strong>wrk</strong> was our stress test — hammering the server to see its upper limits, like pushing it to failure at the gym.</li><li><strong>wrk2</strong> gave us controlled load — helping us see when performance starts to drop, long before things catch fire.</li><li><strong>k6</strong> simulated reality — what it’s like when real users hit your app all day long, refresh like maniacs, or open 5 tabs at once.</li></ul><p>All tests were repeated multiple times to reduce noise and build a reliable baseline for comparison.</p><p>In the optimized setups, I fine-tuned worker pools, memory limits, and thread counts to better align with available system resources.</p><blockquote>FrankenPHP optimized —&gt; WORKER MODE</blockquote><h3>Minimal Symfony Benchmark (Symfony Skeleton)</h3><p>To understand the raw performance differences between FrankenPHP and PHP-FPM, we started with the most basic Symfony setup possible — a single controller that returns a classic Response. This “Hello, world” scenario eliminates most application overhead and isolates the web server’s behavior.</p><p>We tested four configurations:</p><ul><li><strong>FrankenPHP</strong></li><li><strong>FrankenPHP (Optimized)</strong> — with <strong>worker mode </strong>count and memory limit tuned</li><li><strong>PHP-FPM</strong></li><li><strong>PHP-FPM (Optimized)</strong> — with pm = static, adjusted process limits, and opcache tuning</li></ul><p>Before diving into the numbers, it’s worth noting one key performance bottleneck in traditional PHP-FPM setups: in Symfony apps, every single request reboots the entire framework — from autoloading to container building. This cold-start overhead can easily add tens or even hundreds of milliseconds per request. FrankenPHP’s worker mode removes that cost entirely.</p><p>Each configuration was tested using three tools — wrk, wrk2, and k6 — covering raw throughput, fixed-rate latency, and real-world concurrency.</p><h4>wrk — Raw Throughput</h4><p>Under raw load, FrankenPHP already pulls ahead. Even in this minimal setup, it serves <strong>~50% more requests per second</strong> than PHP-FPM. The optimized FrankenPHP setup breaks <strong>2,700 RPS</strong>, while stock PHP-FPM lags behind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fgPnqe1X5WzjMsPP_jIYfQ.png" /><figcaption>This gap is striking considering the endpoint itself is trivial — imagine the difference under real application load.</figcaption></figure><h4>wrk2 — Latency Under Pressure</h4><p>Here we pushed both servers to fixed request rates: 1000, 2000, and even 5000 RPS. FrankenPHP remained mostly stable in both latency and request count, while PHP-FPM began to show signs of struggle.</p><p>Notably:</p><ul><li>At <strong>2000 RPS</strong>, PHP-FPM’s average latency shot up to nearly <strong>1 full second</strong>, while FrankenPHP stayed around <strong>5 ms</strong>.</li><li>At <strong>5000 RPS</strong>, PHP-FPM missed requests and suffered huge spikes in response time.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHUOlaSpIuDj9alhjZISZg.png" /></figure><h4>k6 — Simulating Real Users</h4><p>The k6 tool gave us a more real-world perspective.</p><p><strong>At 100 and 300 concurrent users:</strong></p><ul><li>All setups handled the load well.</li><li>FrankenPHP stayed slightly ahead in latency.</li><li>No errors observed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_eQqSO--leqcAm3CzCQGQ.png" /></figure><h4>At 500 users:</h4><ul><li>FrankenPHP was still stable (~150 ms).</li><li>Regular PHP-FPM began returning <strong>errors in over 68% of requests</strong> unless heavily optimized.</li></ul><h4>At 1000 and 5000 users:</h4><ul><li>PHP-FPM collapsed entirely unless fully tuned — and even then, error rates climbed fast.</li><li>FrankenPHP handled <strong>5,000 users</strong> at once with higher latency, but <strong>zero errors</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jA45K9tevmMV7WLAoXT83w.png" /><figcaption><em>FrankenPHP absorbs high concurrency like a tank, while PHP-FPM folds unless perfectly prepared.</em></figcaption></figure><h3>Heavy Symfony Application Benchmark</h3><p>After the minimal setup, we moved to a more realistic Symfony application — one with 20–30 common packages included. This simulates a typical modern PHP project with authentication, serialization, routing, config, and service layers in place.</p><p><strong>Added packages include</strong>:<br> twig, doctrine/orm, lexik/jwt-authentication-bundle, symfony/serializer, api-platform/core, symfony/security-bundle, and others commonly found in real-world apps.</p><h4>The core difference?</h4><p>The autoloader now has real work to do, and Symfony’s service container has to boot many more components. <strong>This is where FrankenPHP’s architecture starts to shine</strong>.</p><h4>wrk — Raw Throughput</h4><p>Even with a large codebase, FrankenPHP pushed over <strong>2,700 RPS</strong>, compared to <strong>~850 RPS</strong> on PHP-FPM. That’s <strong>3x better</strong> in some configurations.</p><p><strong>This isn’t just about request rate — it’s about startup cost. Since FrankenPHP keeps workers alive between requests, the large autoloader is no longer a bottleneck after the first boot. PHP-FPM, on the other hand, starts from zero each time.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwLEffh7UI3bFLVsYi6nsQ.png" /></figure><h4>wrk2 — Latency Under Pressure</h4><p>At fixed rates of 1000, 2000, and 5000 RPS:</p><ul><li><strong>FrankenPHP optimized</strong> handled 5000 RPS with <strong>~2s latency</strong> and <strong>zero errors</strong>.</li><li><strong>PHP-FPM optimized</strong> collapsed at 5000 RPS with <strong>&gt;1s latency</strong> and <strong>1%+ error rate</strong>.</li></ul><p>The performance cliff here is dramatic — FrankenPHP buys you <strong>time and stability</strong> under traffic surges.</p><h3>k6 — Real-World Simulation</h3><p>This is where it gets real.</p><p>With 1000 and 5000 virtual users accessing the real Symfony app:</p><ul><li><strong>PHP-FPM</strong> struggled to survive. Even with opcache, optimized workers, and tuned pools — it either crashed or served massive error rates.</li><li><strong>FrankenPHP</strong> served traffic at a high latency (2–4 seconds), but <strong>never failed</strong>.</li></ul><p>That’s the difference between a slow website and a <strong>down</strong> website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmGf7idfTqrEe0Dt3LEagA.png" /></figure><h3>Conclusions</h3><blockquote>FrankenPHP didn’t just win the benchmark — it changed the rules of engagement.</blockquote><h4>The Autoloader Advantage</h4><p>This test confirmed a key insight:</p><blockquote><em>The heavier your application is, the more FrankenPHP helps you.</em></blockquote><p>Symfony’s bootstrap process can take tens or hundreds of milliseconds when cold. With PHP-FPM, this happens <strong>every single request</strong>. With FrankenPHP, it happens once — then reused via long-lived workers.</p><p>In other words:</p><ul><li>FrankenPHP scales <strong>with your codebase</strong>.</li><li>PHP-FPM scales <strong>against it</strong>.</li></ul><h4>FrankenPHP Worker Mode ≈ Node.js <strong>with Express</strong> Model</h4><p>In the traditional PHP-FPM setup:</p><ul><li>Every request starts a brand-new PHP process.</li><li>It reloads the entire autoloader and bootstraps the application every single time.</li><li>That’s expensive — especially for large projects with many dependencies.</li></ul><p>In FrankenPHP’s worker mode:</p><ul><li>The server <strong>preloads the application once</strong> — including the autoloader, configuration, and service container.</li><li>Every incoming request is handled by the same long-running process, <strong>without re-bootstrapping.</strong></li></ul><p>It behaves like a long-lived server process — just like Node.js Express or a Go HTTP server.</p><p>In Node.js with Express:</p><ul><li>You launch the server with node index.js, and every request is handled by that already-running process with all modules loaded.</li></ul><p>In FrankenPHP (with worker mode):</p><ul><li>A similar model is used — a Go+PHP web server starts once, and the embedded PHP interpreter <strong>stays alive in memory</strong>, avoiding the per-request overhead.</li></ul><blockquote><strong>FrankenPHP Worker = long-running PHP app</strong>, just like Express runs your app once and handles requests without restarting anything.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*HdEk1cS8-1qxotg00kHZIg.jpeg" /><figcaption>Same runtime energy. Different language.</figcaption></figure><h3>TLDR</h3><p>FrankenPHP is not just a faster alternative — it redefines how PHP applications are executed.</p><p>Thanks to its <strong>worker mode</strong>, your app runs like a long-living server, not a script. This eliminates redundant autoloader initialization and framework bootstrapping, making performance <strong>more consistent and scalable</strong>.</p><p>As seen in our benchmarks, the <strong>gap grows with complexity</strong>: the more packages, bundles, and services you add, the more FrankenPHP pulls ahead. It’s not a marginal gain — it’s architectural.</p><p>Whether you’re running a small API or a large Symfony or Laravel monolith, FrankenPHP offers a <strong>modern execution model</strong> that finally lets PHP behave like a first-class citizen in high-performance environments — much closer to Node.js or Go in terms of request handling.</p><p>If you’re building serious PHP apps and care about performance, <strong>FrankenPHP deserves your attention</strong>.</p><p>If you want to inspect, reproduce, or extend these benchmarks — Docker configs, scripts, and code are all in <a href="https://github.com/Gramzivi/frankenphp-vs-nginx-fpm/tree/tests/worker-plus-symfony-with-big-autoloader">my GitHub repo</a>.</p><blockquote>UPDATE: <a href="https://vulke.medium.com/frankenphp-vs-php-fpm-part-3-cpu-memory-and-the-hidden-cost-of-doing-nothing-92bfee7b00a5">PART 3 is HERE</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee2f2025350" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular is a Backend Framework — Accidentally Written in TypeScript]]></title>
            <link>https://vulke.medium.com/angular-is-a-backend-framework-accidentally-written-in-typescript-b0fc6ed17b31?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0fc6ed17b31</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 13:41:34 GMT</pubDate>
            <atom:updated>2025-07-22T13:59:52.969Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Angular is a Backend Framework — Accidentally Written in TypeScript</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6umh8x7Q7Mv96-O_T7-8Q.png" /></figure><h3>Let’s start</h3><p>I’ve worked in backend development for years, primarily using <a href="https://symfony.com/">Symfony </a>and PHP, occasionally various Node frameworks, and I’ve always appreciated structure — clear separation of responsibilities, dependency injection, and predictable architecture.</p><p>Over the years, I’ve worked closely with frontend teams — not as someone writing <a href="https://angular.dev/">Angular</a> code daily, but as the person shaping overall architecture, reviewing solutions, and aligning frontend and backend workflows.</p><p>To my surprise, Angular didn’t feel like a frontend. It felt like backend — just rendered in the browser. Decorators, modules, lifecycle hooks, interceptors, strongly typed services, even dependency injection — it all reminded me of building APIs in Symfony or Spring.</p><p>So I started asking myself:<br><strong>What if Angular isn’t just “a frontend framework”? What if it’s a backend framework… accidentally written in TypeScript?</strong></p><p>In this article, I’ll compare <a href="https://angular.dev/">Angular </a>to three well-established backend frameworks — <a href="https://symfony.com/"><strong>Symfony</strong></a>, <a href="https://nestjs.com/"><strong>NestJS</strong></a>, and <a href="https://spring.io/projects/spring-boot"><strong>Spring Boot</strong></a> — to show just how backend-aligned Angular really is.</p><h3>Let’s start with Modularity &amp; Dependency Injection</h3><p>If there’s one thing backend developers are obsessed with (apart from naming things), it’s <strong>structure</strong>. We like when code is organized into clear layers, dependencies are injected (not hardcoded), and services behave predictably.</p><p>That’s why Angular’s approach to modularity and DI feels… familiar.</p><h4>Angular</h4><p>Angular uses @NgModule to group features, services, and components together. Everything is injected via a DI container — services, guards, interceptors, pipes — and you control the scope (providedIn: &#39;root&#39;, feature module, or component).</p><pre>@Injectable({ providedIn: &#39;root&#39; })<br>export class AuthService {<br>  constructor(private http: HttpClient) {}<br>}</pre><h4>Symfony</h4><p>Symfony uses a powerful service container (with autowiring), and each bundle/module can define its own services. No decorators, but the idea is the same: <strong>explicit dependencies, automatically injected</strong>.</p><pre># services.yaml<br>App\Service\AuthService:<br>    arguments:<br>        $httpClient: &#39;@http_client&#39;</pre><h4>NestJS</h4><p>No surprise here — Nest is heavily inspired by Angular. It has @Module, @Injectable, and even hierarchical injection. If you’ve seen Angular DI, you’ve seen Nest.</p><pre>@Module({<br>  providers: [AuthService],<br>})<br>export class AuthModule {}</pre><h4>Spring Boot</h4><p>Classic Java DI: annotations like @Component, @Service, @Bean, and @Autowired. It’s one of the oldest and cleanest DI systems, and Angular basically brought that same philosophy to the frontend.</p><pre>@Service<br>public class AuthService {<br>    private final HttpClient client;<br><br>    public AuthService(HttpClient client) {<br>        this.client = client;<br>    }<br>}</pre><h3>Routing and Flow Control</h3><p>Routing is one of those things that sounds simple — “map a path to something” — but quickly turns into a mess when your app grows.<br> Frontend routing? Even worse. Client-side navigation, guards, lazy loading, scroll position, async data — it can get hairy fast.</p><p>But again, Angular approaches this the same way a backend framework would: <strong>explicit routes, layered handling, guards, resolvers, interceptors</strong> — a full-on request lifecycle, just in the browser.</p><h4>Angular</h4><p>Angular uses a declarative routes array inside RouterModule. You can guard access with CanActivate, resolve data before loading with Resolve, and intercept outgoing requests with HttpInterceptor.</p><pre>const routes: Routes = [<br>  {<br>    path: &#39;admin&#39;,<br>    canActivate: [AdminGuard],<br>    resolve: { user: UserResolver },<br>    component: AdminComponent,<br>  },<br>];</pre><h4>Symfony</h4><p>In Symfony, routes are defined via YAML, XML, or PHP attributes. Access control and request logic can be handled through <strong>event subscribers</strong> (e.g. kernel.request) or <strong>security voters</strong>.</p><pre>#[Route(&#39;/admin&#39;, name: &#39;admin&#39;)]<br>public function admin(): Response<br>{<br>    $this-&gt;denyAccessUnlessGranted(&#39;ROLE_ADMIN&#39;);<br>    // ...<br>}</pre><h4>NestJS</h4><p>Nest also uses decorators for routing and guards for access control:</p><pre>@UseGuards(AdminGuard)<br>@Controller(&#39;admin&#39;)<br>export class AdminController {<br>  @Get()<br>  getDashboard() { /* ... */ }<br>}</pre><p>And you can stack middleware, pipes, and interceptors just like in Angular.</p><h4>Spring Boot</h4><p>With annotations like @RestController, @RequestMapping, and @ControllerAdvice, Spring defines routes declaratively. You can layer interceptors and filters to modify behavior before/after request processing.</p><pre>@RestController<br>@RequestMapping(&quot;/admin&quot;)<br>public class AdminController {<br>    @GetMapping<br>    public String dashboard() { return &quot;Admin&quot;; }<br>}</pre><h3>Services &amp; Separation of Concerns</h3><p>You’ve probably heard this one in a code review:<br> <em>“Why is this logic in the component/controller?”</em></p><p>And you’ve probably said:<br> <em>“This should be moved to a service.”</em></p><p>Angular gets that. It encourages you to write your UI logic in components, and move business logic, state handling, and API calls into injectable services. The result? Code that’s easier to test, reuse, and reason about — backend style.</p><p>If you’re a backend developer who loves <strong>skinny controllers and fat services</strong>, Angular is your friend.</p><h3>Middleware, Interceptors &amp; Lifecycle</h3><p>Something else backend devs appreciate?<br>Control over what happens <strong>before, during, and after</strong> a request.</p><ul><li>HttpInterceptor – just like middleware, perfect for auth tokens, logging, and error handling.</li><li>ngOnInit, ngOnDestroy – lifecycle hooks that give you control over initialization and cleanup.</li><li>Route guards (CanActivate, Resolve) – like request-level filters in Spring or Symfony.</li></ul><p>None of this is “just frontend”.<br>It’s full-stack <strong>request lifecycle logic</strong> — just applied inside the browser.</p><p>Before diving into the final section, let’s take a step back and look at the bigger picture.</p><p>Across Angular, Symfony, NestJS, and Spring Boot, the core building blocks are surprisingly similar. Different languages, different runtimes — but the same mindset: modularity, structure, injection, guards, services, and control over flow.</p><p>Here’s a side-by-side snapshot of how these frameworks line up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pd7vGUPjFQtd5bpaL4fKrA.png" /></figure><p>If you’ve worked in any structured backend framework, this should all look familiar.<br>Angular doesn’t reinvent architectural patterns — it reuses them in the browser.</p><p>That’s probably why, as backend developers, we don’t find Angular confusing — we find it <strong>comfortable</strong>.</p><p>It speaks the same language, just with a different accent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*t_J5O_xUsX-nYtJnxYk3nw.jpeg" /><figcaption>Been there. Sweated that.</figcaption></figure><h3>Why Angular Clicks with Backend Brains</h3><p>Backend developers love structure. Not because we’re boring (well, maybe a little), but because structure helps us scale.<br>When things are predictable, modular, and testable — we can focus on solving real problems, not untangling code spaghetti.</p><p>That’s exactly what Angular brings to the frontend.</p><p>React, Vue, Svelte — they each bring their own patterns, philosophies, and powerful ecosystems.<br>But Angular just happens to be the one that speaks fluent backend.</p><p>It says:<br><em>“Here’s how you should build an app. It’s strict, modular, layered, and scalable.”</em></p><p>In other words — it’s exactly the kind of framework a backend developer would write.</p><p>Maybe that’s why Angular doesn’t feel foreign. It feels familiar.<br>It’s not trying to be clever. It’s trying to be maintainable.<br>And if you’ve ever shipped a large-scale production system — you know how rare and valuable that is.</p><p>None of this is “just frontend”.<br>It’s full-stack <strong>request lifecycle logic</strong> — just applied inside the browser.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0fc6ed17b31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FrankenPHP vs PHP-FPM: Benchmarks, Surprises, and One Clear Winner]]></title>
            <link>https://vulke.medium.com/frankenphp-vs-php-fpm-benchmarks-surprises-and-one-clear-winner-173231cb1ad5?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/173231cb1ad5</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[frankenphp]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Mon, 14 Jul 2025 00:27:47 GMT</pubDate>
            <atom:updated>2025-07-30T13:37:07.865Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s start</h3><p>I’ve always been cautious about jumping on new technology trends — especially when it comes to something as foundational as how PHP is served. Stability matters more than hype, and for years, <strong>PHP-FPM behind Nginx</strong> has been the industry standard. It’s not perfect, but it’s battle-tested.</p><p>That’s why, although I had been quietly following the development of <a href="https://frankenphp.dev/"><strong>FrankenPHP</strong></a> for some time, I never really considered it a production-ready alternative. It seemed promising, but young — a bit too experimental to risk in real-world applications.</p><p>However, that changed recently.</p><p>Just over <a href="https://thephp.foundation/blog/2025/05/15/frankenphp/"><strong>two months ago</strong>, <strong>FrankenPHP received official support from the PHP Foundation</strong></a>, which immediately elevated its credibility. That kind of endorsement is rare and sent a clear message: <em>FrankenPHP is no longer just a fun project — it’s a serious candidate for how we might serve PHP in the future.</em></p><p>So I decided it was time to try it for real.</p><h3>What is FrankenPHP</h3><p><a href="https://frankenphp.dev/"><strong>FrankenPHP</strong></a> is a modern PHP application server and HTTP server — all bundled into a single binary. Built on top of <strong>Caddy</strong>, it runs PHP code <strong>directly inside the server process</strong>, eliminating the need for:</p><ul><li>FastCGI</li><li>PHP-FPM</li><li>Reverse proxies like Nginx or Apache</li></ul><p>In essence:</p><ul><li><em>FrankenPHP = HTTP + PHP, no middleman.</em></li></ul><p>If this sounds familiar, it’s because it mirrors the <strong>event-loop-driven simplicity of Node.js</strong>, where the same process handles HTTP and application logic — without external coordination.</p><p>This architecture drastically simplifies deployments and improves performance by removing the traditional multi-process pipeline required to serve PHP pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*CmpVE7rkj_BTmsHqSgTayg.jpeg" /></figure><h3>What Am I Comparing?</h3><p>In this benchmark, I’m comparing two setups:</p><ul><li><strong>FrankenPHP</strong>, using its built-in HTTP server (Caddy-based)</li><li><strong>Nginx + PHP-FPM</strong>, the classic stack</li></ul><p>Both run the same minimalist index.php file and use <strong>PHP 8.4</strong> in isolated Docker containers.</p><p>To ensure a fair and clean environment:</p><ul><li>The tests were executed on a <strong>dedicated AWS EC2 instance</strong></li><li>Specs: <strong>6 vCPUs and 4 GB RAM</strong></li><li>All benchmarks were run <strong>directly from within the instance</strong>, avoiding network latency or local hardware interference</li></ul><p>The focus was to measure:</p><ul><li>Throughput (requests per second)</li><li>Latency (including p95)</li><li>Real-world simulation using virtual users</li></ul><h3>The PHP Code</h3><p>To keep things fair and focused purely on server performance, both stacks were configured to serve the same ultra-minimal PHP file:</p><pre>&lt;?php<br>  echo &quot;Hello from &quot; . ($_SERVER[&#39;SERVER_SOFTWARE&#39;] ?? &#39;unknown server&#39;);</pre><p>No frameworks, no databases, no file operations — just a simple echo. The idea was to benchmark how each server stack handles raw PHP execution without any external variables muddying the waters.</p><h3>Tools Used for Benchmarking</h3><p>To make the testing fair and insightful, I used three tools:</p><ul><li><strong>wrk</strong> — For measuring raw throughput (requests per second).</li><li><strong>wrk2</strong> — For testing latency under a constant load. This helps simulate high-pressure environments.</li><li><strong>k6</strong> — For simulating real-world usage, with multiple virtual users making requests in parallel.</li></ul><p>Each tool served a specific role:</p><ul><li>wrk was used to push the server to its limits — like a stress test at the gym.</li><li>wrk2 simulated a steady stream of traffic at a fixed rate, showing how each setup handles pressure without buckling.</li><li>k6 mimicked what your server experiences on a typical workday — real users browsing, clicking, and occasionally refreshing too much.</li></ul><p>All tests were repeated several times to smooth out anomalies and establish a stable baseline for comparison.</p><h3>wrk Results – Max Throughput Under Load</h3><p>To stress-test both setups, I used <a href="https://github.com/wg/wrk">wrk</a>, a high-performance HTTP benchmarking tool designed to simulate a flood of traffic and measure how well a server holds up. Think of it like a treadmill for your backend — let’s see how fast it can run before it stumbles.</p><p>The command used:</p><pre>wrk -t4 -c100 -d10s http://localhost:PORT</pre><ul><li>-t4 = 4 threads</li><li>-c100 = 100 simultaneous connections</li><li>-d10s = run for 10 seconds</li></ul><p>The goal here was simple: <strong>push both servers to their throughput limits</strong> under a steady, intense stream of requests.</p><p>FrankenPHP pushed out around <strong>15,000 requests per second</strong>, while PHP-FPM hovered just under <strong>4,000</strong>. Latency told the same story — FrankenPHP responded in about <strong>15 ms on average</strong>, while PHP-FPM needed nearly <strong>30 ms</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xnVsgWDlE3-ZtAYlji71A.png" /></figure><p>It’s simple: FrankenPHP runs PHP <strong>directly inside the HTTP server process</strong>, with no FastCGI handoff or Nginx in between. That means fewer context switches, lower overhead, and faster response times — especially under load.</p><p>To eliminate one-off spikes or CPU hiccups, I ran each benchmark multiple times and with various thread/connection configurations (e.g. -t2 -c50, -t6 -c200). While absolute numbers varied slightly, the <strong>performance gap remained consistent</strong>: FrankenPHP always came out significantly ahead.</p><h3>wrk2 Results – How It Handles Pressure</h3><p>If wrk is about raw power, wrk2 is about control. Instead of letting the tool send as many requests as possible, wrk2 keeps a <strong>fixed rate</strong> — say, 5000 requests per second — and watches how your server responds. It’s a great way to measure <strong>latency under predictable, sustained load</strong>.</p><p>Here’s the command I used:</p><pre>wrk2 -t4 -c100 -d10s -R 5000 http://localhost:PORT</pre><p>So that’s:</p><ul><li>4 threads</li><li>100 open connections</li><li>10 seconds duration</li><li>5000 <strong>requests per second</strong>, exactly</li></ul><h4>Now here’s where things got dramatic.</h4><p>PHP-FPM couldn’t keep up. Instead of gracefully handling the 5000 requests per second, it choked — latency shot up to <strong>over one full second per request</strong>. Some requests even stalled completely or hit limits internally. It just couldn’t hold the pace.</p><p>To visualize this, here’s a chart comparing how both setups handled a steady stream of 5000 requests per second:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jv3OjTIiEjNkm5l4fjWobw.png" /></figure><p>You can see it clearly:</p><ul><li>PHP-FPM manages to serve only ~3790 of the 5000 requests and does so with <strong>painfully high latency</strong> (over 860ms on average).</li><li>FrankenPHP handles <strong>virtually all 5000</strong> with an average latency of just <strong>1.4ms</strong>. Not 1 second. One millisecond. <strong>ONE MILLISECOND !!!</strong></li></ul><p>I ran this multiple times and tweaked the rates, just to see if the results were a fluke. They weren’t. The numbers might shift slightly, but the pattern was always the same: <strong>FrankenPHP keeps up. PHP-FPM gets overwhelmed.</strong></p><h3>k6 Results — Reality Check</h3><p>The last test I ran was using <a href="https://k6.io/"><strong>k6</strong></a>, which is less about brute force and more about <em>realistic traffic patterns</em>. Think of it as putting your app in a simulation — a hundred virtual users doing normal things, like opening your site or refreshing a dashboard.</p><p>In this case, I simulated:</p><ul><li>100 virtual users (VUs)</li><li>Each one making a request every 0.1 seconds</li><li>Duration: 10 seconds</li></ul><p>And the results?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4i-ENA_jFiUY6HxGZaS1_g.png" /></figure><p>Even under normal traffic:</p><ul><li><strong>PHP-FPM</strong> averaged <strong>2.56ms per request</strong>, and the <strong>95th percentile</strong> hit nearly <strong>6ms</strong></li><li><strong>FrankenPHP</strong> consistently stayed under <strong>2ms average</strong>, and <strong>3.5ms at p(95)</strong></li></ul><p>It’s not a dramatic difference like in the stress tests — but that’s kind of the point. Even when things are “fine,” FrankenPHP is still a bit snappier, more consistent, and ready to scale.</p><p>I also repeated this test multiple times, trying out small tweaks — slightly increasing or decreasing the request interval, adjusting connection pool sizes, even running the same test at different times to account for background noise on the machine. The outcome? The numbers shifted a bit, but <strong>the pattern remained the same</strong>: FrankenPHP was consistently ahead, both in terms of latency and stability under pressure.</p><h3>Final Thoughts: Should You Switch?</h3><p>If you’re building APIs, microservices, or any kind of stateless service where raw performance and simplicity matter — FrankenPHP is seriously worth trying out.</p><p>It’s faster, uses fewer moving parts, and in every test I ran, it handled load more gracefully than PHP-FPM. Especially in scenarios with high concurrency or under stress, the benefits become hard to ignore.</p><p><strong>That said, not every project is ready for it.</strong></p><p>If you’re running a complex legacy app with fine-tuned PHP-FPM pools and years of sysadmin knowledge baked into your infrastructure, jumping ship overnight would be a bad idea. But if you’re starting something new — or even just curious — <strong>FrankenPHP is absolutely ready for dev and staging environments</strong>, and maybe even for production in many cases.</p><p>Here’s how I’d break it down:</p><ul><li>✅ <strong>New projects</strong>: Start with FrankenPHP. You’ll likely save yourself some complexity down the road.</li><li>✅ <strong>APIs and lightweight services</strong>: FrankenPHP shines here. It’s lean and fast.</li><li>🟡 <strong>Mid-size monoliths</strong>: Worth testing, especially if you’re planning any infrastructure refresh.</li><li>❌ <strong>Huge legacy apps</strong>: Stick to FPM for now — or do some serious migration planning.</li></ul><h3>One Last Thing</h3><p>FrankenPHP isn’t just fast — it’s <strong>refreshingly modern</strong>. It feels like PHP has finally stepped into the era of single-process servers, and that shift alone opens the door to cleaner deployments, easier Docker setups, and new patterns we used to only associate with Node, Go, or Rust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*Nhx7unwxOb4-a77epzWQnw.jpeg" /></figure><p>If PHP has ever felt “too old school” for modern infra, FrankenPHP makes that feeling go away.</p><p>It’s still young, sure. But it’s growing fast — and backed by the PHP Foundation, no less.</p><h3><em>TL;DR — FrankenPHP is not just real. It’s </em>ready<em>.</em></h3><p>Also, if you’re curious to explore or reproduce the benchmarks, I’ve pushed the whole setup (including Docker configs, scripts, and test files) here:<br> 👉 <a href="https://github.com/Gramzivi/frankenphp-vs-nginx"><strong>https://github.com/Gramzivi/frankenphp-vs-nginx</strong></a></p><blockquote>Update: <a href="https://vulke.medium.com/frankenphp-vs-php-fpm-part-2-symfony-real-workloads-and-bigger-projects-9ee2f2025350">Part 2 is here</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=173231cb1ad5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Should Variables Be Null, False, Undefined, or an Empty String in PHP?]]></title>
            <link>https://vulke.medium.com/when-should-variables-be-null-false-undefined-or-an-empty-string-in-php-4ebd73c7a954?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ebd73c7a954</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[code-style-guide]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[programming-tips]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 03:07:27 GMT</pubDate>
            <atom:updated>2025-07-28T19:39:56.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Bad code level 10000+" src="https://cdn-images-1.medium.com/max/953/1*N09yo9WBchcI2MruCs0Hhg.png" /><figcaption>Bad code level 1000+</figcaption></figure><p>You’ve probably been there. You’re reviewing a pull request or digging through some legacy code, and then you see it: if ($var == &quot;not set&quot;), or if ($data == &quot;&quot;) where null or false should’ve been used. These kinds of mismatched variable states can quickly turn a clean codebase into a tangled mess of ambiguity and bugs.</p><p>I’ve run into these scenarios so many times that I felt the need to write this article as a guide for everyone who’s ever wondered, “What’s the difference between these values? And when should I use each?” Let’s break it all down so we can avoid these misuses and write cleaner, more consistent PHP code.</p><h3>Understanding the Basics</h3><h4>Null</h4><p>In PHP, null means the variable has no value—it’s empty, nada, zilch. It’s like saying, &quot;I know this exists, but there’s nothing here&quot;.</p><pre>$variable = null;</pre><p>Use null when:</p><ul><li>You want to explicitly clear a variable.</li><li>A value is not applicable but the variable needs to exist in the context of your program.</li></ul><h4>False</h4><p>false is a boolean value that screams, &quot;Nope! Not happening.&quot;</p><pre>$isLoggedIn = false;</pre><p>Use false when:</p><ul><li>A condition or state evaluates to a negative outcome.</li><li>You need to represent failure in a boolean context (e.g., returning false from a function).</li></ul><h4>Undefined</h4><p>In PHP, “undefined” isn’t exactly a thing like it is in JavaScript. Instead, accessing an undeclared variable triggers a notice. However, having a variable undefined can be okay in some scenarios — there’s no need to initialize variables just for the sake of it.</p><p>For example, consider this overly cautious initialization:</p><pre>function processData() {<br>    $data = false; // WHY? This isn’t needed if it’s never used later<br>    if (someCondition()) {<br>        $data = fetchData();<br>    }<br>    // Process $data only if it’s set<br>}</pre><p>Instead, use isset or check for existence when needed:</p><pre>function processData() {<br>    if (someCondition()) {<br>        $data = fetchData();<br>    }<br><br>    if (isset($data)) {<br>        // Process $data only if it exists<br>    }<br>}</pre><p>Legitimate scenarios for undefined variables include:</p><ul><li>When the variable’s existence depends on a condition.</li><li>When initializing it would create unnecessary clutter or defaults.</li></ul><h4>Empty String</h4><p>An empty string &quot;&quot; is a string with no characters—not null, not false, just... empty.</p><pre>$username = &quot;&quot;;</pre><p>Use an empty string when:</p><ul><li>A variable must be a string but has no meaningful value yet.</li><li>You’re resetting a string variable without changing its type.</li></ul><h3>Common Misuses and Their Consequences</h3><h4>Misusing null for false</h4><pre>$isAdmin = null; // WRONG<br>$isAdmin = false; // CORRECT</pre><p><strong>Why?</strong> null means no value, while false explicitly says, &quot;This is not true.&quot;</p><h4>Misusing Empty String for null</h4><pre>$description = &quot;&quot;; // WRONG if description is truly absent<br>$description = null; // CORRECT</pre><p><strong>Why?</strong> An empty string implies the description exists but is empty. Use null if the description doesn’t exist at all.</p><h4>Checking for Empty String Instead of false</h4><pre>$hasAccess = &quot;&quot;; // WRONG<br>$hasAccess = false; // CORRECT<br><br>if ($hasAccess === &quot;&quot;) {<br>    echo &quot;No access.&quot;; // CONFUSING<br>}<br>if ($hasAccess === false) {<br>    echo &quot;No access.&quot;; // CLEAR<br>}</pre><p><strong>Why?</strong> A boolean value communicates intent better in cases of access control or logical checks.</p><h4>Using Non-Standard Strings for State</h4><pre>$status = &quot;not set&quot;; // WRONG<br>$status = null; // CORRECT</pre><p><strong>Why?</strong> Using arbitrary strings for state makes the code harder to read and prone to typos or mismatches.</p><h4>Misusing false for Empty String</h4><pre>$username = false; // WRONG<br>$username = &quot;&quot;; // CORRECT</pre><p><strong>Why?</strong> A username should always be a string, even if it’s empty. Using false mixes data types unnecessarily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*tpmdIp3cunIs_7N1" /></figure><h3>Best Practices</h3><ol><li><strong>Align Values With Intent</strong></li></ol><ul><li>Use null for absence, false for booleans, and empty strings for strings that have no characters.</li></ul><pre>$userEmail = null; // No email provided<br>$isVerified = false; // User is not verified<br>$comments = &quot;&quot;; // No comments provided yet</pre><p>2. <strong>Default Values</strong> Always give variables default values that match the expected type.</p><pre>$score = null; // Integer values may come later<br>$isAuthenticated = false; // Start with a boolean default<br>$name = &quot;&quot;; // Empty string as a default for text</pre><p>3. <strong>Strict Comparisons</strong> Avoid weird coercions by using === and !==.</p><pre>if ($variable === null) {<br>    echo &quot;Variable is null&quot;;<br>}<br>if ($isLoggedIn === false) {<br>    echo &quot;User is not logged in.&quot;;<br>}</pre><p>4. <strong>Use Type Hints and Union Types</strong> PHP 8.0+ supports union types and nullable types. Use them to enforce the right values.</p><pre>function setPrice(?float $price): void {<br>    if ($price === null) {<br>        echo &quot;Price not available&quot;;<br>    } else {<br>        echo &quot;Price: $price&quot;;<br>    }<br>}</pre><h3>Real-World Examples</h3><h4>Example 1: User Authentication</h4><pre>class User {<br><br>    private ?string $email = null; // Email may not always be set<br><br>    private bool $isVerified = false; // Default to not verified<br><br>    public function setEmail(?string $email): void {<br>        $this-&gt;email = $email;<br>    }<br><br>    public function verify(): void {<br>        $this-&gt;isVerified = true;<br>    }<br><br>    public function getEmail(): ?string {<br>        return $this-&gt;email; // always return value, not message in Model<br>    }<br><br>    public function isVerified(): bool {<br>        return $this-&gt;isVerified; // always return value, not message<br>    }<br>}</pre><h4>Example 2: Form Handling</h4><pre>$formData = [<br>    &#39;username&#39; =&gt; &quot;&quot;,<br>    &#39;password&#39; =&gt; null,<br>    &#39;remember_me&#39; =&gt; false,<br>];<br><br>if ($formData[&#39;password&#39;] === null) {<br>    echo &quot;Password is required.&quot;;<br>}<br>if ($formData[&#39;username&#39;] === &quot;&quot;) {<br>    echo &quot;Username cannot be empty.&quot;;<br>}<br>if ($formData[&#39;remember_me&#39;] === false) {<br>    echo &quot;User chose not to be remembered.&quot;;<br>}</pre><h3>Conclusion</h3><p>Getting null, false, undefined, and empty strings right in PHP isn’t just about code working—it’s about code that makes sense. By matching values to their intent and avoiding unnecessary coercions, you’ll save yourself and your teammates a ton of headaches. Remember, clean and consistent code isn’t just good practice—it’s a sanity saver.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ebd73c7a954" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Symfony vs. NestJS: The Ultimate Showdown for Modern Web Development]]></title>
            <link>https://vulke.medium.com/symfony-vs-nest-js-the-ultimate-showdown-for-modern-web-development-321d01931387?source=rss-813c7942ca45------2</link>
            <guid isPermaLink="false">https://medium.com/p/321d01931387</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[symfony]]></category>
            <dc:creator><![CDATA[Ivan Vulovic]]></dc:creator>
            <pubDate>Wed, 10 Jul 2024 23:08:33 GMT</pubDate>
            <atom:updated>2024-07-27T08:14:03.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aEANIvnF3eVrRK1IQ7mxDA.png" /></figure><p>Hey everyone! Today, I’m comparing Symfony and NestJS, two powerful frameworks known for their flexibility and strength in web development. This article will explore what they can do and how you can use them without diving into detailed performance tests or pros and cons. I’ll save that for future articles where I’ll talk about benchmarks and give my thoughts on which one might be best for your project.</p><p>You might be surprised to see how similar Symfony and NestJS are in what they offer. Both are awesome for building scalable apps, handling tricky tasks, and connecting with different databases and services. This might shake up what big fans of each framework think, showing that picking between them isn’t always straightforward. Whether you’re leaning towards Symfony or NestJS, understanding what makes them alike and different will help you choose the right one for your next project.</p><h3>Symfony: The Seasoned Pro</h3><p>First up, we have <a href="https://symfony.com/">Symfony</a>. This PHP heavyweight has been around the block and then some. It’s got a solid reputation for being the go-to for enterprise-level projects. Think of it like the reliable, classic car that never lets you down. It’s flexible, packed with reusable components, and follows the MVC (Model-View-Controller) pattern, which means your code stays nice and tidy.</p><h3>NestJS: The “New” Kid on the Block</h3><p>Then there’s <a href="https://nestjs.com/">NestJ</a>S. Although it has existed since 2018, its maturity began in 2021. Personally, I didn’t take this framework seriously until late 2022 due to factors such as the lack of real LTS versions and backward compatibility. Now that’s changed. This JavaScript/TypeScript star is built on Node.js and is all about modern web development. Inspired by Angular, NestJS brings that sweet, sweet consistency to the backend world, making it a hit among developers who like their stacks to match.</p><p>So, let’s pop the hood and see what makes these frameworks tick.</p><h3>Where They Shine Together</h3><figure><img alt="Same but different" src="https://cdn-images-1.medium.com/max/544/0*PdcQ10_GJ-Rv79Yo.jpg" /><figcaption>The difference in possibilities between NestJS and Symfony</figcaption></figure><p>Despite their different roots, Symfony and NestJS have a lot in common. Here’s a quick look:</p><h4>MVC Architecture</h4><p>Both frameworks follow the MVC pattern, which basically means they like to keep their workspaces clean. Models handle the data, views take care of presentation, and controllers manage the logic. It’s like having a well-organized toolbox.</p><ul><li><strong>Symfony (PHP)</strong>: Controllers, Entities (Models), and Views (Templates).</li><li><strong>NestJS (TypeScript)</strong>: Controllers, Services (Models), and Views (Templates).</li></ul><h4>Modular Design</h4><ul><li><strong>Symfony</strong>: Uses bundles to group-related functionality, making it super flexible and easy to manage.</li><li><strong>NestJS</strong>: Loves modules for keeping things organized and scalable. Think of it as Marie Kondo for your code.</li></ul><h4>Dependency Injection</h4><p>This fancy term means these frameworks make it a breeze to manage dependencies:</p><ul><li><strong>Symfony</strong>: Uses a service container for injecting dependencies. Autowiring makes it even smoother.</li><li><strong>NestJS</strong>: Uses decorators to handle dependency injection, so your classes get what they need without breaking a sweat.</li></ul><h4>Routing</h4><p>Routing is like the GPS for your web app, and both frameworks have it nailed down:</p><ul><li><strong>Symfony</strong>: Offers routes via annotations, YAML, or XML. So many options, it’s like a buffet.</li></ul><p>Via annotations:</p><pre>#[Route(&#39;/home&#39;, name: &#39;home&#39;)]<br>public function index(): Response<br>{<br>    return $this-&gt;render(&#39;home/index.html.twig&#39;, [<br>        &#39;controller_name&#39; =&gt; &#39;HomeController&#39;,<br>    ]); // Using twig template<br>}</pre><ul><li><strong>NestJS</strong>: Defines routes with decorators directly in the controller classes. It’s simple and effective.</li></ul><pre>@Get(&#39;home&#39;)<br>@Render(&#39;home/index.hbs&#39;) // Using Handlebars template<br>index(): { controller_name: string } {<br>    return { controller_name: &#39;HomeController&#39; };<br>}</pre><h4>Middleware</h4><p>Middleware is crucial for processing those pesky requests and responses:</p><ul><li><strong>Symfony</strong>: Uses event listeners and subscribers to handle middleware-like functionality. Think of it as a sophisticated butler managing your house party.</li><li><strong>NestJS</strong>: Supports middleware at different levels, from routes to controllers to global. It’s like having security guards at every door.</li></ul><h4>ORM Support</h4><p>Both frameworks make working with databases a walk in the park:</p><ul><li><strong>Symfony</strong>: Doctrine ORM is the go-to, and it’s powerful.</li><li><strong>NestJS</strong>: Usually uses TypeORM or Sequelize. It’s like choosing between two great coffee shops.</li></ul><h4>Built-in CLI</h4><p>Who doesn’t love a good command line tool?</p><ul><li><strong>Symfony</strong>: Its CLI handles project creation, server management, and code generation. It’s like a Swiss Army knife.</li></ul><p>Generate Controller:</p><pre>bin/console make:controller</pre><ul><li><strong>NestJS</strong>: Although not so extensive compared to Symfony, the CLI is handy for scaffolding projects, running tests, and more. It’s your trusty sidekick.</li></ul><p>Generate Controller:</p><pre>npx nest generate controller</pre><h4>Testing Tools</h4><p>Testing is key, and both frameworks have your back:</p><ul><li><strong>Symfony</strong>: PHPUnit is the testing tool of choice.</li><li><strong>NestJS</strong>: Integrates with Jest for unit and integration tests. It’s like having a personal trainer for your code.</li></ul><h4>Template Engines</h4><p>Rendering dynamic content is a breeze:</p><ul><li><strong>Symfony</strong>: Twig is the star here, making templates a joy to work with.</li><li><strong>NestJS</strong>: Supports various engines like <a href="https://handlebarsjs.com/">Handlebars</a>, EJS, and Pug. It’s like being a chef with multiple recipe books.</li></ul><h4>Configuration Management</h4><p>Both frameworks manage configuration with ease using environment variables and configuration files. It’s all about flexibility and security.</p><h4>Community and Ecosystem</h4><p>A strong community and rich ecosystem are like having a big family dinner — plenty of support and resources.</p><h3>Where They Part Ways</h3><p>Alright, now let’s talk about differences. Here’s what sets Symfony and NestJS apart.</p><h4>Language Ecosystem and Tooling</h4><ul><li><strong>Symfony</strong>: Firmly in the PHP camp, it integrates seamlessly with PHP tools and conventions.</li><li><strong>NestJS</strong>: Lives in the JavaScript/TypeScript world, leveraging Node.js tools. It’s like speaking different dialects but both understanding the same big idea.</li></ul><h4>Philosophy and Design</h4><ul><li><strong>Symfony</strong>: Configuration-based approach with annotations, YAML, or XML. Flexibility is key.</li><li><strong>NestJS</strong>: Decorator-based approach, inspired by Angular. It’s all about consistency and clarity.</li></ul><h4>Component Interaction</h4><ul><li><strong>Symfony</strong>: Heavy on service definitions and autowiring for dependency injection.</li></ul><pre>class ProductService<br>{<br>    private $entityManager;<br>    private $productRepository;<br><br>    public function __construct(EntityManagerInterface $entityManager, ProductRepository $productRepository)<br>    {<br>        $this-&gt;entityManager = $entityManager;<br>        $this-&gt;productRepository = $productRepository;<br>    }<br><br>    public function findAll(): array<br>    {<br>        return $this-&gt;productRepository-&gt;findAll();<br>    }<br>}</pre><ul><li><strong>NestJS</strong>: Focuses on dependency injection at every level with explicit module declarations.</li></ul><pre>@Injectable()<br>export class ProductService {<br>    constructor(<br>        @InjectRepository(Product)<br>        private readonly productRepository: Repository&lt;Product&gt;,<br>    ) {}<br><br>    async findAll(): Promise&lt;Product[]&gt; {<br>        return this.productRepository.find();<br>    }<br>}</pre><h4>Framework Structure</h4><ul><li><strong>Symfony</strong>: Bundles encapsulate features, offering project organization flexibility.</li><li><strong>NestJS</strong>: Modular by default, promoting a consistent structure.</li></ul><h4>Asynchronous Programming</h4><ul><li><strong>Symfony</strong>: Traditionally synchronous but can handle async with PHP 8’s Fibers or tools like ReactPHP.</li><li><strong>NestJS</strong>: Built for async from the ground up, using Promises and async/await. Perfect for real-time apps, and of course currently the main advantage of the Node over PHP.</li></ul><h4>Community and Adoption</h4><ul><li><strong>Symfony</strong>: Mature and widely adopted in enterprise-level applications.</li><li><strong>NestJS</strong>: New but rapidly growing, especially popular for modern, scalable apps.</li></ul><h4>Learning Curve and Documentation</h4><ul><li><strong>Symfony</strong>: Steeper learning curve, but backed by detailed documentation. Prior PHP knowledge helps.</li><li><strong>NestJS</strong>: Easier for those familiar with Angular and TypeScript. Comprehensive docs make it approachable.</li></ul><h4>Performance</h4><ul><li><strong>Symfony</strong>: Optimized for high performance with significant improvements in PHP.</li><li><strong>NestJS</strong>: Non-blocking I/O in Node.js makes it ideal for real-time applications.</li></ul><h4>Configuration and Setup</h4><ul><li><strong>Symfony</strong>: Extensive configuration options but require more initial setup.</li><li><strong>NestJS</strong>: Streamlined setup with a convention-over-configuration approach.</li></ul><h4>Error Handling and Debugging</h4><ul><li><strong>Symfony</strong>: Robust tools like the Web Debug Toolbar and detailed exception pages.</li><li><strong>NestJS</strong>: Centralized error handling with JavaScript’s mechanisms.</li></ul><h3>Advanced Features and Best Practices</h3><h4>Microservices Architecture</h4><p>Both frameworks handle microservices well but in different ways:</p><ul><li><strong>Symfony</strong>: Extendable with third-party bundles and tools like <a href="https://api-platform.com/">API Platform</a> for API-first microservices.</li><li><strong>NestJS</strong>: Built-in microservices support with various transport strategies. It’s like having a ready-to-go toolkit.</li></ul><h4>Real-Time Applications</h4><ul><li><strong>Symfony</strong>: Achievable with libraries like Ratchet or <a href="https://mercure.rocks/">Mercure</a>.</li><li><strong>NestJS</strong>: Perfect for real-time features with WebSockets and integrations like <a href="https://socket.io/">Socket.io</a>.</li></ul><h4>API Development</h4><ul><li><strong>Symfony</strong>: <a href="https://api-platform.com/">API Platform</a> makes building and documenting APIs a breeze.</li><li><strong>NestJS</strong>: Built-in Swagger integration and modular structure simplify API development.</li></ul><h4>Security Features</h4><ul><li><strong>Symfony</strong>: Comprehensive security bundle for CSRF protection, user authentication, and more.</li><li><strong>NestJS</strong>: Guards, interceptors, and modules like Passport keep your app secure.</li></ul><h3>DevOps and Deployment</h3><p>Both Symfony and NestJS offer powerful tools and methodologies to streamline this process, ensuring smooth and efficient operation from development to production.</p><ul><li><strong>Symfony</strong>: Full Docker support, SymfonyCloud…</li><li><strong>NestJS</strong>: Full Docker support, Node.js environment management tools like PM2.</li></ul><h3>Real-World Use Cases</h3><h4>When I would choose Symfony</h4><ul><li><strong>Enterprise Applications</strong>: Perfect for large, complex projects needing stability.</li><li><strong>E-commerce</strong>: High-performance platforms with Symfony’s bundles and components.</li><li><strong>API Development</strong>: Efficient with <a href="https://api-platform.com/">API Platform’s</a> features.</li></ul><h4>When I would choose NestJS</h4><ul><li><strong>Real-Time Applications</strong>: Ideal for chat apps, live notifications, and real-time dashboards.</li><li><strong>Microservices</strong>: Built-in support makes it a strong candidate.</li><li><strong>Modern Stack</strong>: If you’re into TypeScript and Node.js, NestJS is a natural fit.</li></ul><h4>The Developer’s Perspective</h4><p>From a developer’s standpoint, mastering both Symfony and NestJS can significantly broaden your skill set and marketability. You’ll be equipped to tackle a wider range of projects and work seamlessly in teams that utilize different tech stacks. Plus, there’s a certain satisfaction in knowing you can handle whatever the project throws at you, whether it’s PHP or Node.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*wxLiD50jvLFrqdvX.jpg" /><figcaption>Typical hater of any programming language</figcaption></figure><h4>Conclusion: The Best of Both Worlds</h4><p>Choosing between Symfony and NestJS is like deciding whether to have a classic, well-aged wine or a trendy craft beer — they both have their unique flavours and cater to different tastes, but you can appreciate and enjoy both for what they offer.</p><p>In my journey with Symfony (PHP) and NestJS (TypeScript), I’ve found both frameworks offer powerful tools for web application development. I was trying to remain neutral but Symfony impresses me with its maturity and robust ecosystem, while NestJS impresses me with TypeScript’s benefits and scalable architecture.</p><p>Every developer or business owner needs to remember, there’s no one-size-fits-all solution in technology. There is no silver bullet. It’s about choosing the right tool for the job and adapting to the unique needs of each project.</p><p>It’s worth mentioning that this article is based on PHP 8.3, Symfony 6.4, Node.js 20, and NestJS 10.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=321d01931387" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>