<?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>Forem: Muhammad Ibtisam</title>
    <description>The latest articles on Forem by Muhammad Ibtisam (@muhammad_ibtisam).</description>
    <link>https://forem.com/muhammad_ibtisam</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3371582%2F996f0e1e-fa5c-4172-8fce-8a05c9675e5e.jpeg</url>
      <title>Forem: Muhammad Ibtisam</title>
      <link>https://forem.com/muhammad_ibtisam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/muhammad_ibtisam"/>
    <language>en</language>
    <item>
      <title>How Modern Systems Are Built: A Complete System Design Guide</title>
      <dc:creator>Muhammad Ibtisam</dc:creator>
      <pubDate>Tue, 05 Aug 2025 14:02:58 +0000</pubDate>
      <link>https://forem.com/muhammad_ibtisam/how-modern-systems-are-built-a-complete-system-design-guide-15bk</link>
      <guid>https://forem.com/muhammad_ibtisam/how-modern-systems-are-built-a-complete-system-design-guide-15bk</guid>
      <description>&lt;p&gt;&lt;em&gt;“System Design isn’t about memorizing terms. It’s about solving one problem and discovering another.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here’s a &lt;strong&gt;complete journey&lt;/strong&gt;, starting from the first user request and going all the way to a massive, scalable, real-time backend — explained in &lt;strong&gt;simple words&lt;/strong&gt;, step-by-step.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣ Client-Server Architecture
&lt;/h3&gt;

&lt;p&gt;Let’s start from the very beginning.&lt;br&gt;
You’re building an app — maybe a shopping website or a ride-booking app.&lt;/p&gt;

&lt;p&gt;The app that users see on their screen (called the &lt;strong&gt;client&lt;/strong&gt;) needs to get data — like products, users, prices — from a &lt;strong&gt;server&lt;/strong&gt; (a remote computer).&lt;/p&gt;

&lt;p&gt;This is called the &lt;strong&gt;Client-Server Architecture&lt;/strong&gt;. The client asks, the server responds.&lt;/p&gt;

&lt;p&gt;But now a big question arises…&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ IP Address
&lt;/h3&gt;

&lt;p&gt;How does the client &lt;strong&gt;find&lt;/strong&gt; the server?&lt;/p&gt;

&lt;p&gt;Just like houses need home addresses, servers need unique numbers called &lt;strong&gt;IP addresses&lt;/strong&gt;. These are how data knows where to go.&lt;/p&gt;

&lt;p&gt;But here’s the problem: humans can't remember IPs like &lt;code&gt;192.0.2.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So we need a better system…&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣ DNS (Domain Name System)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;DNS&lt;/strong&gt; is like the contact list on your phone.&lt;br&gt;
You don’t remember phone numbers — you just type names. Similarly, DNS converts &lt;code&gt;facebook.com&lt;/code&gt; into its real IP address.&lt;/p&gt;

&lt;p&gt;Without DNS, we’d all be typing weird numbers instead of website names.&lt;/p&gt;

&lt;p&gt;Now that the client has the server’s address… can it go straight to it?&lt;/p&gt;




&lt;h3&gt;
  
  
  4️⃣ Proxy / Reverse Proxy
&lt;/h3&gt;

&lt;p&gt;Not always.&lt;br&gt;
In big systems, we place a &lt;strong&gt;Reverse Proxy&lt;/strong&gt; (like NGINX) in front of the actual server. It’s like a receptionist for your backend.&lt;/p&gt;

&lt;p&gt;It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filters unwanted traffic&lt;/li&gt;
&lt;li&gt;Caches common responses&lt;/li&gt;
&lt;li&gt;Distributes load&lt;/li&gt;
&lt;li&gt;Hides internal server info&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes your system safer and more efficient.&lt;/p&gt;

&lt;p&gt;But now, as requests start flowing… we want speed.&lt;/p&gt;




&lt;h3&gt;
  
  
  5️⃣ Latency
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Latency&lt;/strong&gt; is the time between a user clicking something and getting the response.&lt;br&gt;
Slow systems frustrate users.&lt;/p&gt;

&lt;p&gt;Every step — DNS, proxy, server response — adds to latency.&lt;/p&gt;

&lt;p&gt;So we must send only what’s needed, as efficiently as possible.&lt;/p&gt;

&lt;p&gt;That’s where protocols come in.&lt;/p&gt;




&lt;h3&gt;
  
  
  6️⃣ HTTP / HTTPS
&lt;/h3&gt;

&lt;p&gt;Clients and servers “talk” using a language called &lt;strong&gt;HTTP&lt;/strong&gt;.&lt;br&gt;
But this talk must be &lt;strong&gt;secure&lt;/strong&gt;, so we wrap it with encryption. That becomes &lt;strong&gt;HTTPS&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It ensures no one in the middle (like hackers) can read sensitive data.&lt;/p&gt;

&lt;p&gt;But now, how do we define what the client can ask for?&lt;/p&gt;




&lt;h3&gt;
  
  
  7️⃣ APIs
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;API&lt;/strong&gt; is like a restaurant menu.&lt;br&gt;
It tells the client exactly what it can request — and what it’ll get in return.&lt;/p&gt;

&lt;p&gt;APIs are the rules of communication between frontend and backend.&lt;/p&gt;

&lt;p&gt;But how should we organize those rules?&lt;/p&gt;




&lt;h3&gt;
  
  
  8️⃣ REST API
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;REST&lt;/strong&gt; is a style of designing APIs.&lt;br&gt;
It uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;URLs&lt;/strong&gt; like &lt;code&gt;/users/123&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP methods&lt;/strong&gt; like GET, POST, PUT, DELETE&lt;/li&gt;
&lt;li&gt;Clean, predictable structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;REST is great for most apps.&lt;/p&gt;

&lt;p&gt;But for complex or mobile apps, REST can feel a bit heavy.&lt;/p&gt;




&lt;h3&gt;
  
  
  9️⃣ GraphQL
&lt;/h3&gt;

&lt;p&gt;With &lt;strong&gt;GraphQL&lt;/strong&gt;, the client can ask for exactly the data it needs — nothing more, nothing less.&lt;/p&gt;

&lt;p&gt;It’s perfect when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have many frontend devices (web, mobile, smart TVs)&lt;/li&gt;
&lt;li&gt;You want fewer requests&lt;/li&gt;
&lt;li&gt;You need fine control over the response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both REST and GraphQL talk to… the database.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔟 Databases
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Database&lt;/strong&gt; is where your system remembers everything:&lt;br&gt;
Users, products, messages, orders — all go here.&lt;/p&gt;

&lt;p&gt;Without it, your system has no memory.&lt;/p&gt;

&lt;p&gt;But what kind of database should you use?&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣1️⃣ SQL vs NoSQL
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SQL&lt;/strong&gt; (like PostgreSQL): Data stored in rows and columns, strict rules, great for transactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NoSQL&lt;/strong&gt; (like MongoDB): More flexible, handles lots of data quickly, perfect for huge apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But as data grows… performance drops.&lt;/p&gt;

&lt;p&gt;So how do we handle more users?&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣2️⃣ Vertical Scaling
&lt;/h3&gt;

&lt;p&gt;First, we try &lt;strong&gt;Vertical Scaling&lt;/strong&gt;: upgrading the server’s RAM, CPU, storage.&lt;/p&gt;

&lt;p&gt;It’s like upgrading your laptop to make it faster.&lt;/p&gt;

&lt;p&gt;But there’s a limit to how much you can upgrade.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣3️⃣ Horizontal Scaling
&lt;/h3&gt;

&lt;p&gt;So we do &lt;strong&gt;Horizontal Scaling&lt;/strong&gt;: adding &lt;strong&gt;more servers&lt;/strong&gt; instead of one big one.&lt;/p&gt;

&lt;p&gt;Imagine instead of one huge shop, you open 10 smaller ones.&lt;/p&gt;

&lt;p&gt;But now… how do you divide the work among them?&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣4️⃣ Load Balancers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Load Balancers&lt;/strong&gt; sit in front of all your servers and divide traffic evenly.&lt;/p&gt;

&lt;p&gt;They:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send each user request to the best-performing server&lt;/li&gt;
&lt;li&gt;Help handle failures&lt;/li&gt;
&lt;li&gt;Improve reliability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great. But now your &lt;strong&gt;database&lt;/strong&gt; is under pressure.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣5️⃣ Database Indexing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Indexes&lt;/strong&gt; help databases find data faster — just like a book index.&lt;/p&gt;

&lt;p&gt;Instead of reading the whole table, the DB jumps directly to what it needs.&lt;/p&gt;

&lt;p&gt;But even with indexing… traffic can overwhelm the database.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣6️⃣ Replication
&lt;/h3&gt;

&lt;p&gt;We &lt;strong&gt;replicate&lt;/strong&gt; the database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One copy for writing&lt;/li&gt;
&lt;li&gt;Multiple copies for reading&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes the system faster and safer. If one DB crashes, others still work.&lt;/p&gt;

&lt;p&gt;Still, with massive data, one DB instance isn’t enough.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣7️⃣ Sharding
&lt;/h3&gt;

&lt;p&gt;You &lt;strong&gt;split&lt;/strong&gt; the data into parts, called &lt;strong&gt;shards&lt;/strong&gt;.&lt;br&gt;
Each shard holds only a slice of the total data (e.g., by region or user ID).&lt;/p&gt;

&lt;p&gt;Now, instead of one overloaded DB, you have many smaller, faster ones.&lt;/p&gt;

&lt;p&gt;But it gets hard to manage mixed data in one table…&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣8️⃣ Vertical Partitioning
&lt;/h3&gt;

&lt;p&gt;You separate data into logical parts.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One DB for user profiles&lt;/li&gt;
&lt;li&gt;Another for payment history&lt;/li&gt;
&lt;li&gt;Another for analytics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It makes data cleaner and services more focused.&lt;/p&gt;

&lt;p&gt;But queries are still heavy. We need speed.&lt;/p&gt;




&lt;h3&gt;
  
  
  1️⃣9️⃣ Caching
&lt;/h3&gt;

&lt;p&gt;You add a &lt;strong&gt;cache&lt;/strong&gt; (like Redis) to store recently used data in memory.&lt;/p&gt;

&lt;p&gt;It’s way faster than hitting the database every time.&lt;/p&gt;

&lt;p&gt;Example: homepage products, popular posts, session info.&lt;/p&gt;

&lt;p&gt;But even joining tables slows things down.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣0️⃣ Denormalization
&lt;/h3&gt;

&lt;p&gt;Now you duplicate some data across tables to reduce joins.&lt;/p&gt;

&lt;p&gt;Yes, it breaks some rules…&lt;br&gt;
But it makes reads blazingly fast — and users happy.&lt;/p&gt;

&lt;p&gt;But let’s say your system spans across continents now…&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣1️⃣ CAP Theorem
&lt;/h3&gt;

&lt;p&gt;In big, distributed systems, you can’t have:&lt;br&gt;
✅ Perfect consistency&lt;br&gt;
✅ Always available&lt;br&gt;
✅ Handle network breaks&lt;/p&gt;

&lt;p&gt;You must choose two.&lt;/p&gt;

&lt;p&gt;This shapes how you design your system — whether to prioritize accuracy or uptime.&lt;/p&gt;

&lt;p&gt;Now, what if users upload files?&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣2️⃣ Blob Storage
&lt;/h3&gt;

&lt;p&gt;Large files (images, videos, PDFs) don’t belong in your DB.&lt;/p&gt;

&lt;p&gt;You move them to &lt;strong&gt;Blob Storage&lt;/strong&gt; like AWS S3.&lt;br&gt;
It’s cheap, fast, and built for this.&lt;/p&gt;

&lt;p&gt;But how do we deliver those files faster?&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣3️⃣ CDN (Content Delivery Network)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CDNs&lt;/strong&gt; store static content closer to your users around the world.&lt;br&gt;
This means faster load times and lower server load.&lt;/p&gt;

&lt;p&gt;Essential for performance-focused apps.&lt;/p&gt;

&lt;p&gt;Now… what if your app needs real-time updates?&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣4️⃣ WebSockets
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;WebSockets&lt;/strong&gt; keep a live connection open between client and server.&lt;/p&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live chat&lt;/li&gt;
&lt;li&gt;Multiplayer games&lt;/li&gt;
&lt;li&gt;Trading dashboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But what about notifying other services?&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣5️⃣ Webhooks
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Webhooks&lt;/strong&gt; let one app notify another when something happens.&lt;br&gt;
E.g., Stripe pings your app when a payment succeeds.&lt;/p&gt;

&lt;p&gt;But your app is huge now. Time to break it down.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣6️⃣ Microservices
&lt;/h3&gt;

&lt;p&gt;You split your app into &lt;strong&gt;microservices&lt;/strong&gt;:&lt;br&gt;
Each handles one feature — users, orders, inventory, etc.&lt;/p&gt;

&lt;p&gt;It’s easier to develop and scale independently.&lt;/p&gt;

&lt;p&gt;But how do these services talk?&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣7️⃣ Message Queues
&lt;/h3&gt;

&lt;p&gt;Instead of direct calls, services communicate via &lt;strong&gt;message queues&lt;/strong&gt; (like Kafka, RabbitMQ).&lt;/p&gt;

&lt;p&gt;This helps with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Retry logic&lt;/li&gt;
&lt;li&gt;Loose coupling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still… people can abuse your APIs.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣8️⃣ Rate Limiting
&lt;/h3&gt;

&lt;p&gt;You set a limit on how many requests one user can send in a given time.&lt;/p&gt;

&lt;p&gt;This stops:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spammers&lt;/li&gt;
&lt;li&gt;DDoS attacks&lt;/li&gt;
&lt;li&gt;Accidental loops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is often done at the gateway…&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣9️⃣ API Gateway
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;API Gateway&lt;/strong&gt; is a single front door to all your microservices.&lt;/p&gt;

&lt;p&gt;It handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Rate limiting&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But what if a request is repeated?&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣0️⃣ Idempotency
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;idempotent&lt;/strong&gt; operation can run multiple times without changing the result.&lt;/p&gt;

&lt;p&gt;Example: If a payment is retried, you don’t want to charge the user twice.&lt;/p&gt;

&lt;p&gt;This protects users from bugs and poor networks.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 Summary
&lt;/h2&gt;

&lt;p&gt;Each system design concept solves a problem…&lt;br&gt;
But creates a new one that needs a better solution.&lt;/p&gt;

&lt;p&gt;That’s how systems grow.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>backend</category>
    </item>
    <item>
      <title>How to Use the Intersection Observer API for Scroll-Based Animations in JavaScript</title>
      <dc:creator>Muhammad Ibtisam</dc:creator>
      <pubDate>Wed, 23 Jul 2025 11:37:51 +0000</pubDate>
      <link>https://forem.com/muhammad_ibtisam/how-to-use-the-intersection-observer-api-for-scroll-based-animations-in-javascript-1ana</link>
      <guid>https://forem.com/muhammad_ibtisam/how-to-use-the-intersection-observer-api-for-scroll-based-animations-in-javascript-1ana</guid>
      <description>&lt;h1&gt;
  
  
  🚀 &lt;strong&gt;Today I Learned: Intersection Observer API in JavaScript&lt;/strong&gt; 👨‍💻
&lt;/h1&gt;

&lt;p&gt;As a developer, I'm always looking for ways to improve performance and user experience — and today I explored something incredibly useful: the &lt;strong&gt;Intersection Observer API&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Why It's Awesome
&lt;/h2&gt;

&lt;p&gt;Instead of relying on expensive &lt;code&gt;scroll&lt;/code&gt; event listeners, the Intersection Observer API provides a modern, efficient way to detect when an element enters or exits the viewport.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Use Cases:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Lazy-loading images
&lt;/li&gt;
&lt;li&gt;✅ Triggering animations on scroll
&lt;/li&gt;
&lt;li&gt;✅ Infinite scroll implementations
&lt;/li&gt;
&lt;li&gt;✅ Tracking element visibility for analytics
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's clean, lightweight, and extremely helpful for modern web apps and SPAs.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎥 Live Demo (Scroll Animation)
&lt;/h2&gt;

&lt;p&gt;I created a quick example that triggers &lt;strong&gt;animations when elements come into view&lt;/strong&gt;, using Intersection Observer and Tailwind CSS.&lt;/p&gt;

&lt;p&gt;▶️ &lt;a href="https://www.loom.com/share/ab3e1ff6231d4047b79671c5259354e7" rel="noopener noreferrer"&gt;Watch the Loom video demo&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 GitHub Code
&lt;/h2&gt;

&lt;p&gt;If you'd like to check out the code or try it yourself, here’s the repo:&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://github.com/mirzaibtisam41/JS_Intersection_Observer_API.git" rel="noopener noreferrer"&gt;GitHub Repository – JS_Intersection_Observer_API&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 Let’s Talk!
&lt;/h2&gt;

&lt;p&gt;Have you used the Intersection Observer API in your projects?&lt;br&gt;&lt;br&gt;
Any interesting tricks, animations, or use cases?&lt;/p&gt;

&lt;p&gt;Drop your thoughts in the comments — I’d love to learn from your experience!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontendchallenge</category>
      <category>performance</category>
    </item>
    <item>
      <title>Database Design Mistakes I Wish I Avoided Earlier</title>
      <dc:creator>Muhammad Ibtisam</dc:creator>
      <pubDate>Tue, 22 Jul 2025 11:30:02 +0000</pubDate>
      <link>https://forem.com/muhammad_ibtisam/database-design-mistakes-i-wish-i-avoided-earlier-ebc</link>
      <guid>https://forem.com/muhammad_ibtisam/database-design-mistakes-i-wish-i-avoided-earlier-ebc</guid>
      <description>&lt;h2&gt;
  
  
  🧩 Introduction
&lt;/h2&gt;

&lt;p&gt;When I first started building full-stack apps, I thought database design was just about creating tables and throwing in some columns.&lt;br&gt;
I was wrong — and it cost me time, performance, and even features.&lt;/p&gt;

&lt;p&gt;In this post, I’ll share the &lt;strong&gt;most painful database design mistakes&lt;/strong&gt; I made early in my journey, and how you can avoid them.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚫 Mistake #1: Not Planning the Schema First
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ What I did:
&lt;/h3&gt;

&lt;p&gt;I jumped straight into writing backend logic before thinking about how the data should be structured.&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Why it’s bad:
&lt;/h3&gt;

&lt;p&gt;This leads to inconsistent models, extra refactoring, and broken features later on.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ What to do instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sketch your schema first (pen &amp;amp; paper, Notion, or dbdiagram.io)&lt;/li&gt;
&lt;li&gt;Think in terms of entities and relationships before writing a single query&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Mistake #2: Ignoring Relationships (Trying to Be Too "Flexible")
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ What I did:
&lt;/h3&gt;

&lt;p&gt;I used MongoDB and thought, “I’ll just embed everything.” No references, no structure — just vibes.&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Why it’s bad:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hard to query&lt;/li&gt;
&lt;li&gt;Impossible to scale&lt;/li&gt;
&lt;li&gt;Duplication of data everywhere&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ✅ What to do instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Learn when to &lt;strong&gt;embed vs reference&lt;/strong&gt; (especially in NoSQL)&lt;/li&gt;
&lt;li&gt;Use relational principles even in NoSQL when it makes sense&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Mistake #3: No Indexing (Performance Killer!)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ What I did:
&lt;/h3&gt;

&lt;p&gt;I thought indexing was an optional “optimization” for later.&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Why it’s bad:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;As soon as data grows, queries slow down&lt;/li&gt;
&lt;li&gt;Some simple pages took 5+ seconds to load because the DB was scanning everything&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ✅ What to do instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Add indexes on commonly queried fields (like &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;userId&lt;/code&gt;, &lt;code&gt;createdAt&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Monitor slow queries and optimize them&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Mistake #4: No Migrations or Version Control
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ What I did:
&lt;/h3&gt;

&lt;p&gt;I manually changed the database structure whenever I needed to “fix” something.&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Why it’s bad:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You lose track of what changed&lt;/li&gt;
&lt;li&gt;Production and dev DBs go out of sync&lt;/li&gt;
&lt;li&gt;Hard to onboard teammates or redeploy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ✅ What to do instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use tools like &lt;strong&gt;Prisma, Sequelize, Knex, or TypeORM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Write migration scripts or use auto-migration tools&lt;/li&gt;
&lt;li&gt;Version your DB the way you version your code&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Mistake #5: Storing Everything in One Table
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ❌ What I did:
&lt;/h3&gt;

&lt;p&gt;For “simplicity,” I used one big collection/table to store different types of data (e.g., notifications, messages, logs).&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Why it’s bad:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Makes querying messy&lt;/li&gt;
&lt;li&gt;No data isolation or structure&lt;/li&gt;
&lt;li&gt;Tough to manage permissions and logic&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ✅ What to do instead:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a separate table/collection per distinct entity&lt;/li&gt;
&lt;li&gt;Normalize your data, then denormalize &lt;strong&gt;only where needed&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Bonus Tip: Learn to Think in Queries
&lt;/h2&gt;

&lt;p&gt;Even with the perfect schema, if you don’t know how you’ll &lt;strong&gt;query&lt;/strong&gt; the data, you’ll hit roadblocks.&lt;/p&gt;

&lt;p&gt;Before finalizing your schema, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Can I get the data I need easily and efficiently?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If not, go back and tweak your design.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔚 Conclusion
&lt;/h2&gt;

&lt;p&gt;Bad database design won’t break your app on day one — but it &lt;strong&gt;will break it&lt;/strong&gt; when you scale, add features, or try to optimize performance.&lt;/p&gt;

&lt;p&gt;Now that I’ve learned these lessons (some the hard way), I always treat DB design as &lt;strong&gt;step one&lt;/strong&gt;, not an afterthought.&lt;/p&gt;

&lt;p&gt;If you're just getting started, &lt;strong&gt;take the time to plan, structure, and index wisely&lt;/strong&gt; — your future self will thank you.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>database</category>
      <category>learning</category>
      <category>backend</category>
    </item>
    <item>
      <title>Is Your App Struggling with More Users? This Might Be Why.</title>
      <dc:creator>Muhammad Ibtisam</dc:creator>
      <pubDate>Mon, 21 Jul 2025 12:20:43 +0000</pubDate>
      <link>https://forem.com/muhammad_ibtisam/is-your-app-struggling-with-more-users-this-might-be-why-ch6</link>
      <guid>https://forem.com/muhammad_ibtisam/is-your-app-struggling-with-more-users-this-might-be-why-ch6</guid>
      <description>&lt;p&gt;Your app works fine with a few users.&lt;br&gt;
But when traffic increases — it gets slow, crashes, or feels laggy.&lt;/p&gt;

&lt;p&gt;If that sounds familiar, the issue might not be your code — it could be your &lt;strong&gt;scaling strategy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a quick breakdown of two common ways apps scale:&lt;br&gt;
&lt;strong&gt;Vertical Scaling&lt;/strong&gt; and &lt;strong&gt;Horizontal Scaling&lt;/strong&gt; — explained in simple terms.&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Vertical Scaling (Scaling Up)
&lt;/h3&gt;

&lt;p&gt;This means upgrading the &lt;strong&gt;same server&lt;/strong&gt; to make it more powerful.&lt;br&gt;
You increase its RAM, CPU, or storage — basically giving it more strength.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s useful:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s very easy to do — you just click “upgrade” in your hosting provider.&lt;/li&gt;
&lt;li&gt;You don’t need to change anything in your code.&lt;/li&gt;
&lt;li&gt;Perfect for small apps or MVPs that aren’t under heavy traffic yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where it struggles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There's a limit. You can’t keep upgrading forever — hardware caps out.&lt;/li&gt;
&lt;li&gt;If the server goes down, your whole app is offline — because you’re relying on just one machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
You build a MERN stack app and host it on a 1GB server.&lt;br&gt;
When users grow and the app slows down, you increase it to 4GB RAM. That’s vertical scaling.&lt;/p&gt;




&lt;h3&gt;
  
  
  📦 Horizontal Scaling (Scaling Out)
&lt;/h3&gt;

&lt;p&gt;This means adding &lt;strong&gt;more servers&lt;/strong&gt; and splitting your app across them.&lt;br&gt;
Instead of one big server, you now have multiple smaller ones sharing the load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s powerful:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It improves speed and performance under high traffic.&lt;/li&gt;
&lt;li&gt;If one server fails, others keep the app running — more reliable.&lt;/li&gt;
&lt;li&gt;You can grow endlessly by adding more servers over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why it’s harder:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It requires some setup: load balancers, shared storage, etc.&lt;/li&gt;
&lt;li&gt;You might need to update your code — like storing sessions in Redis instead of in memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
You deploy your backend on 3 different servers, and use Nginx to route traffic between them.&lt;br&gt;
Each server handles part of the user load — that’s horizontal scaling.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Which Should You Use?
&lt;/h3&gt;

&lt;p&gt;If you're just starting out or have a small user base, &lt;strong&gt;vertical scaling&lt;/strong&gt; is quick, simple, and cheap.&lt;/p&gt;

&lt;p&gt;But if your app is growing fast, or you need high uptime and better performance under load, then you’ll eventually need &lt;strong&gt;horizontal scaling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Many apps start by scaling vertically — and switch to horizontal scaling as traffic grows.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ Final Thought
&lt;/h3&gt;

&lt;p&gt;If your app slows down as users grow, take a moment to review how you’re scaling.&lt;br&gt;
Sometimes the fix isn't in your code — it's in how your servers are set up.&lt;/p&gt;

&lt;p&gt;A smart scaling strategy can save you time, money, and a lot of frustration later on.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>devops</category>
      <category>learning</category>
    </item>
    <item>
      <title>I Skipped System Design and Paid the Price 💥 A Hard Lesson Every Developer Learns</title>
      <dc:creator>Muhammad Ibtisam</dc:creator>
      <pubDate>Sun, 20 Jul 2025 12:53:26 +0000</pubDate>
      <link>https://forem.com/muhammad_ibtisam/i-skipped-system-design-and-paid-the-price-a-hard-lesson-every-developer-learns-4pbg</link>
      <guid>https://forem.com/muhammad_ibtisam/i-skipped-system-design-and-paid-the-price-a-hard-lesson-every-developer-learns-4pbg</guid>
      <description>&lt;h2&gt;
  
  
  Why system design matters even before you write a single line of code — a personal story every developer should read.
&lt;/h2&gt;

&lt;p&gt;I used to jump straight into coding.&lt;br&gt;&lt;br&gt;
No plan. No structure. Just vibes. 😅&lt;/p&gt;

&lt;p&gt;And at first, it felt great.&lt;br&gt;&lt;br&gt;
💻 I was writing code fast&lt;br&gt;&lt;br&gt;
📱 Screens were showing up&lt;br&gt;&lt;br&gt;
⚙️ APIs were working  &lt;/p&gt;

&lt;p&gt;It felt like progress... until it wasn’t. 😬&lt;/p&gt;




&lt;h2&gt;
  
  
  🚨 Then Everything Started Falling Apart
&lt;/h2&gt;

&lt;p&gt;A few weeks later, things broke down:&lt;/p&gt;

&lt;p&gt;🔁 Every new feature broke something else&lt;br&gt;&lt;br&gt;
🧩 Code became a tangled mess&lt;br&gt;&lt;br&gt;
🐢 App performance slowed down  &lt;/p&gt;

&lt;p&gt;I started asking myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why didn’t I plan this properly from the beginning?" 🤦‍♂️&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  💥 That’s When I Realized
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;System Design matters&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🧠 &lt;strong&gt;Clear requirements matter even more&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It wasn’t just bad code.&lt;br&gt;&lt;br&gt;
I didn’t even fully understand what I was building.&lt;/p&gt;

&lt;p&gt;❌ No clear goals&lt;br&gt;&lt;br&gt;
❌ No user flow&lt;br&gt;&lt;br&gt;
❌ No big picture&lt;/p&gt;




&lt;h2&gt;
  
  
  💭 Whether You’re Working On...
&lt;/h2&gt;

&lt;p&gt;👨‍💻 A client project&lt;br&gt;&lt;br&gt;
🚀 A startup idea&lt;br&gt;&lt;br&gt;
🛠️ Your own side hustle&lt;/p&gt;

&lt;p&gt;If you don’t plan first, you’ll end up wasting time fixing things later. 😤&lt;/p&gt;

&lt;p&gt;And no — I’m not talking about fancy diagrams or huge documents. 📄✖️&lt;/p&gt;




&lt;h2&gt;
  
  
  🗺️ Even a Rough Sketch Helps
&lt;/h2&gt;

&lt;p&gt;Just outlining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How your app works
&lt;/li&gt;
&lt;li&gt;How data moves
&lt;/li&gt;
&lt;li&gt;What the user &lt;em&gt;actually&lt;/em&gt; needs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can save you &lt;strong&gt;so much trouble&lt;/strong&gt; later.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Now I Do Things Differently
&lt;/h2&gt;

&lt;p&gt;I don’t start coding until:&lt;/p&gt;

&lt;p&gt;✅ I know what the project needs&lt;br&gt;&lt;br&gt;
✅ I’ve mapped out the basic flow&lt;br&gt;&lt;br&gt;
✅ I’ve asked the right questions  &lt;/p&gt;

&lt;p&gt;And honestly? It makes &lt;strong&gt;everything smoother&lt;/strong&gt;. 🙌&lt;/p&gt;




&lt;h2&gt;
  
  
  👇 &lt;strong&gt;Have You Been There Too?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Have you ever jumped into code too early and regretted it later?&lt;/p&gt;

&lt;p&gt;Let me know in the comments — or share what you do differently now. I'd love to learn from your experiences too!&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
