<?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: Anubhav Jaiswal</title>
    <description>The latest articles on DEV Community by Anubhav Jaiswal (@anubhavauth).</description>
    <link>https://dev.to/anubhavauth</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%2F3915974%2F6b27113f-a1a1-440d-ac10-e4f7b1fbd554.png</url>
      <title>DEV Community: Anubhav Jaiswal</title>
      <link>https://dev.to/anubhavauth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anubhavauth"/>
    <language>en</language>
    <item>
      <title>Why I Slowly Killed Our Monolith</title>
      <dc:creator>Anubhav Jaiswal</dc:creator>
      <pubDate>Thu, 07 May 2026 05:05:54 +0000</pubDate>
      <link>https://dev.to/anubhavauth/why-i-slowly-killed-our-monolith-33o1</link>
      <guid>https://dev.to/anubhavauth/why-i-slowly-killed-our-monolith-33o1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffob7m8vkd1t3heaxw3i6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffob7m8vkd1t3heaxw3i6.png" alt="A cinematic close-up photograph of a developer's desk deep at night. The only light source is a large monitor casting a cold blue glow across the scene. The terminal on screen shows a wall of scrolling log output, frozen mid-line, with a single red error at the bottom: " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was 2:00 AM. I was on my third coffee, staring at a terminal window that was doing that thing where it looks like it's working but isn't.&lt;/p&gt;

&lt;p&gt;We were running a setup where every single customer had their own separate database space (a "schema"). On paper, it sounds like the perfect way to keep data isolated. In reality? It's a nightmare to manage. When the 401st customer's database hit a deadlock during a simple update, everything just stopped. I didn't have a big revelation right then; I just realized we had built a system that was eventually going to break us.&lt;/p&gt;

&lt;p&gt;So we decided to move away from the monolith. Here's how we did it and what we learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottleneck
&lt;/h2&gt;

&lt;p&gt;Our original app was built with Python and Django. I love Django, but we had hit a wall. Python has a built-in limit on how many things it can do at the exact same time (the "GIL"). For a simple app, you never notice it. For us, with hundreds of people chatting, syncing files, and making API calls all at once, it was like trying to run a marathon while breathing through a straw.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ic34fgq0rtf9kchqrjr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ic34fgq0rtf9kchqrjr.png" alt="A dramatic macro photograph of a single, narrow pipe or tube made of old, slightly rusted metal. Water is visibly struggling to push through it — pressure building on one side, a weak trickle on the other. The background is dark and out of focus. The image should feel like a physical metaphor for a system under strain: something that was built for a simpler time, now completely overwhelmed. Shot with a shallow depth of field, dramatic side lighting, editorial photography style. 3:2" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We tried throwing more money at it—bigger servers, more power. It helped for a bit, but it didn't fix the underlying problem.&lt;/p&gt;

&lt;p&gt;The biggest issue was that everything was connected. A slow query in a small, unimportant part of the app could suddenly make the login screen crawl. In a monolith, one fire in the kitchen eventually fills the whole house with smoke. You stop sleeping well when you know one tiny bug can take down everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Switch to Something Simpler
&lt;/h2&gt;

&lt;p&gt;We decided to move to Java 21. The main reason? A new feature called "Virtual Threads."&lt;/p&gt;

&lt;p&gt;Before this, handling concurrency in Java meant managing thread pools — pre-allocating a fixed number of workers and hoping your traffic never spiked past what they could handle. When a thread was waiting on a database call or an API response, it just sat there, blocked, consuming memory and doing nothing. Under heavy load, we'd hit connection timeouts before we ever ran out of CPU.&lt;/p&gt;

&lt;p&gt;Virtual Threads change that. Instead of a small pool of expensive OS threads, the JVM can spin up millions of lightweight virtual threads that are automatically parked and resumed while waiting on I/O. Crucially, you write normal, straightforward blocking code — no marking every function with "async" and "await" like a virus spreading through your codebase. It's like going from a 4-lane road to a 1,000-lane highway without having to change how you drive.&lt;/p&gt;

&lt;p&gt;We went from constantly worrying about server limits at 1:00 AM to... well, not thinking about it at all. That was the real win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Big Changes We Made
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Cleaning up Identity&lt;/strong&gt;&lt;br&gt;
We stopped letting every part of the app worry about "who" the user was. We moved that to the front door (the Gateway). The Gateway checks the user's key once, attaches a simple tag to the request (like "This is Customer A"), and sends it along. By the time the request hits the actual code, the "Who is this?" part is already solved. It made everything feel much snappier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. One Big Table, Better Organization&lt;/strong&gt;&lt;br&gt;
We killed the "one database per customer" model. We moved everything into one big system but used partitioning to keep things organized. Every row of data is tagged with a Customer ID, so the database knows exactly where to look. The deadlocks vanished. Schema update jobs that used to crawl through 400+ separate databases now run in a single pass. What used to take hours dropped to minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapl2g7k37n9d6euz7pyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapl2g7k37n9d6euz7pyn.png" alt="A wide, slightly elevated photograph of a large whiteboard mid-session. On the left half of the board is a sprawling, tangled web of boxes and lines representing the old system — some boxes are crossed out in red marker, arrows go in circles, annotations read " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The "Piece-by-Piece" Move&lt;/strong&gt;&lt;br&gt;
I've seen too many projects fail because they tried to rewrite everything from scratch in one go. We didn't do that. We pulled out the most painful part first — the AI engine — and moved it to the new system. We kept the old app running for the rest. Over about seven months, we slowly moved features over one by one until there was nothing left in the old system. It wasn't flashy, but it was safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Reality Check
&lt;/h2&gt;

&lt;p&gt;Don't get me wrong — this isn't "easier." It's just "different."&lt;/p&gt;

&lt;p&gt;Running several small services on your laptop is more annoying than running one big app. You have to deal with more configuration files, and it's easier to make a typo that breaks how the services talk to each other. That happened to us plenty of times.&lt;/p&gt;

&lt;p&gt;You also have to think about "partial failure." In the old app, if it was up, it was up. Now, the login system might be working fine while the file storage is having a bad day. You have to build in safety nets so the user gets a helpful error message instead of just a spinning circle. We’re still polishing some of those edges today.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Result
&lt;/h2&gt;

&lt;p&gt;The best part? Friday deployments don't feel like defusing a bomb anymore.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vh7owb9aii6kf7rhhru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3vh7owb9aii6kf7rhhru.png" alt="A calm, wide photograph of the same developer's desk — but now it is morning. Warm golden light comes through a window with thin curtains. The monitor is on, showing a terminal with clean, green output: a deployment log that ends with " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can fix a bug in the login system while someone else adds a feature to the dashboard, and we don't have to worry about stepping on each other's toes. The isolation is real, and it changes how the team works. We move faster because we aren't afraid of breaking the whole world with one line of code. Incidents that used to take down the entire platform now affect one service — and we catch them before most users ever notice.&lt;/p&gt;

&lt;p&gt;Don't move to microservices because it's the "cool" thing to do. Do it when your current setup is the reason you can't ship. We hit that wall, and moving past it was the best call we've made.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>microservices</category>
      <category>java</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
