<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mustafa Hassan</title>
    <description>The latest articles on DEV Community by Mustafa Hassan (@mustefadev).</description>
    <link>https://dev.to/mustefadev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4055229%2F60073526-d641-486a-8175-d0aa45d41be3.jpg</url>
      <title>DEV Community: Mustafa Hassan</title>
      <link>https://dev.to/mustefadev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mustefadev"/>
    <language>en</language>
    <item>
      <title>Migrating an Educational Platform from Laravel to ASP.NET Core: A 90% Performance Recovery</title>
      <dc:creator>Mustafa Hassan</dc:creator>
      <pubDate>Thu, 30 Jul 2026 14:13:54 +0000</pubDate>
      <link>https://dev.to/mustefadev/migrating-an-educational-platform-from-laravel-to-aspnet-core-a-90-performance-recovery-4k9f</link>
      <guid>https://dev.to/mustefadev/migrating-an-educational-platform-from-laravel-to-aspnet-core-a-90-performance-recovery-4k9f</guid>
      <description>&lt;p&gt;&lt;strong&gt;I inherited Judeer, an educational platform, in a state that most backend engineers dread: a production system with severe, user-facing performance problems **&lt;/strong&gt;and no clear path forward from the existing codebase.&lt;br&gt;
The most critical issue was response time. Under normal load, API responses were taking up to 20 seconds — an unacceptable experience for any platform, let alone one serving students and instructors who needed to interact with content in real time. On top of that, the system suffered from intermittent data retrieval failures, an admin dashboard that couldn't handle basic rich content (instructors literally couldn't write mathematical notation for course material), and a video delivery pipeline that wasn't built for adaptive streaming.&lt;br&gt;
I made the call to do a full technical rebuild rather than patch the existing Laravel system: migrate to ASP.NET Core with PostgreSQL as the backend foundation.&lt;br&gt;
Diagnosing the Root Cause&lt;br&gt;
Before touching a single line of new code, I profiled the existing system to understand why it was slow — not just that it was slow. The biggest offenders were:&lt;br&gt;
Missing or poorly designed database indexes, causing full table scans on frequently queried data&lt;br&gt;
Inefficient query patterns with no ORM-level optimization&lt;br&gt;
No structured approach to caching or connection handling&lt;br&gt;
This mattered because a rewrite without addressing the root cause would have just reproduced the same problems in a new language.&lt;br&gt;
The Rebuild&lt;br&gt;
Backend framework: ASP.NET Core, chosen for its performance characteristics, strong typing (which catches a whole category of runtime errors that PHP's dynamic typing lets slip into production), and first-class async support for I/O-bound operations like database and external API calls.&lt;br&gt;
Database layer: PostgreSQL with Entity Framework Core. I redesigned the indexing strategy from scratch based on actual query patterns rather than guesswork, and optimized the EF Core queries to avoid the N+1 problems that had been silently killing performance under the old system.&lt;br&gt;
Result: response times dropped from ~20 seconds to under 2 seconds — a performance improvement of over 90%.&lt;br&gt;
A System Design Problem Nobody Had Caught&lt;br&gt;
While migrating, I found something more subtle than a performance bug: the previous implementation used sequential integer values as primary keys across the system.&lt;br&gt;
This is a design decision that looks harmless until you need to restore from a backup or reconcile data from an older database snapshot — at which point you risk ID collisions between newly created records and records being restored from an older state. It's the kind of problem that doesn't show up in testing and only bites you during an incident, which is exactly when you don't want new problems.&lt;br&gt;
The textbook fix is to move to GUIDs as primary keys. But Jodeer already had a live mobile application built against the existing integer ID scheme. A full migration to GUIDs would have meant reworking the mobile client's data layer too — real engineering time, and a real cost to the company for a problem that had a cheaper solution.&lt;br&gt;
Instead, I implemented Sqids (an ID-obfuscation/encoding scheme) to generate unique, non-sequential identifiers at the API boundary while preserving the underlying integer scheme the mobile app already depended on. This closed the collision risk without touching the mobile codebase or requiring additional development resources — a solution that balanced technical correctness against business cost, not just "what's technically ideal in a vacuum."&lt;br&gt;
Other Improvements Along the Way&lt;br&gt;
Video delivery: implemented transcoding to HLS (HTTP Live Streaming) format, enabling adaptive bitrate streaming instead of serving flat video files&lt;br&gt;
Admin permissions: extended the role/permission system to give administrators finer-grained control instead of the all-or-nothing access that existed before&lt;br&gt;
Content authoring: added rich content editing support for instructors, including mathematical notation — a feature the platform needed but never had&lt;br&gt;
What This Taught Me&lt;br&gt;
The easy version of this story is "I rewrote a slow app in a faster framework." The real lesson was about judgment: not every correct fix is the right fix. The GUID vs. Sqids decision is the one I keep coming back to — the "best practice" answer and the "best answer for this system, this team, and this budget" weren't the same thing, and figuring out which one to ship is a bigger part of the job than writing the code itself.&lt;br&gt;
I'm a backend engineer working primarily in C# / ASP.NET Core, PostgreSQL, and EF Core, currently leading technical direction across several product builds. Always happy to talk architecture — feel free to reach out.**&lt;/p&gt;

</description>
      <category>backend</category>
      <category>dotnet</category>
      <category>laravel</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
