<?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: Humayun</title>
    <description>The latest articles on DEV Community by Humayun (@humayun_61ce37df8dc21865e).</description>
    <link>https://dev.to/humayun_61ce37df8dc21865e</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%2F3413569%2F69b5dd34-0f29-4470-bd8a-d43509311d06.png</url>
      <title>DEV Community: Humayun</title>
      <link>https://dev.to/humayun_61ce37df8dc21865e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/humayun_61ce37df8dc21865e"/>
    <language>en</language>
    <item>
      <title>From Azure VM to Azure Container Apps: How We Reduced Hosting Costs by 70% Without Rewriting Our FastAPI Backend</title>
      <dc:creator>Humayun</dc:creator>
      <pubDate>Mon, 08 Jun 2026 11:11:36 +0000</pubDate>
      <link>https://dev.to/humayun_61ce37df8dc21865e/from-azure-vm-to-azure-container-apps-how-we-reduced-hosting-costs-by-70-without-rewriting-our-4632</link>
      <guid>https://dev.to/humayun_61ce37df8dc21865e/from-azure-vm-to-azure-container-apps-how-we-reduced-hosting-costs-by-70-without-rewriting-our-4632</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%2F8kq1gt3wkkqp1x7jr6dd.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%2F8kq1gt3wkkqp1x7jr6dd.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few weeks ago, a routine Azure billing email made me take a closer look at our infrastructure.&lt;/p&gt;

&lt;p&gt;At GoPanda (&lt;a href="https://gopanda.in" rel="noopener noreferrer"&gt;https://gopanda.in&lt;/a&gt;), we're still an early-stage startup. Our traffic is relatively low, and our FastAPI backend was comfortably running on an Azure Virtual Machine.&lt;/p&gt;

&lt;p&gt;The setup worked.&lt;/p&gt;

&lt;p&gt;The problem was that the VM cost the same whether we received 10 requests a day or 10,000.&lt;/p&gt;

&lt;p&gt;We were paying for uptime, not usage.&lt;/p&gt;

&lt;p&gt;That realization led me down a rabbit hole that eventually ended with a complete migration from Azure Virtual Machines to Azure Container Apps (ACA).&lt;/p&gt;

&lt;p&gt;What started as a cost optimization exercise ended up being a great lesson in modern cloud infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Original Architecture
&lt;/h2&gt;

&lt;p&gt;Our backend stack was fairly straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Azure Virtual Machine&lt;/li&gt;
&lt;li&gt;GitHub Actions for deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The application itself was already containerized, so deployment wasn't particularly difficult.&lt;/p&gt;

&lt;p&gt;However, the VM came with a few drawbacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed monthly cost&lt;/li&gt;
&lt;li&gt;OS maintenance and patching&lt;/li&gt;
&lt;li&gt;Paying for idle compute&lt;/li&gt;
&lt;li&gt;Manual capacity planning&lt;/li&gt;
&lt;li&gt;Infrastructure tightly coupled to a specific machine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a startup still validating and growing its product, these tradeoffs didn't feel ideal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Azure Container Apps?
&lt;/h2&gt;

&lt;p&gt;Initially, I evaluated several options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continue using Azure VM&lt;/li&gt;
&lt;li&gt;Move to Azure Functions&lt;/li&gt;
&lt;li&gt;Use Azure Kubernetes Service (AKS)&lt;/li&gt;
&lt;li&gt;Use Azure Container Apps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Azure Container Apps ended up being the most practical choice.&lt;/p&gt;

&lt;p&gt;The simplest way I can describe ACA is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Kubernetes without having to manage Kubernetes.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;ul&gt;
&lt;li&gt;Cluster management&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Ingress&lt;/li&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;li&gt;Control plane operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile, developers focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Containers&lt;/li&gt;
&lt;li&gt;Deployments&lt;/li&gt;
&lt;li&gt;Application logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You still get features such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Revision-based deployments&lt;/li&gt;
&lt;li&gt;Autoscaling&lt;/li&gt;
&lt;li&gt;Traffic splitting&lt;/li&gt;
&lt;li&gt;Service discovery&lt;/li&gt;
&lt;li&gt;Managed ingress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without operating a Kubernetes cluster yourself.&lt;/p&gt;

&lt;p&gt;For small teams, that's a very attractive tradeoff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why We Didn't Choose Azure Functions
&lt;/h2&gt;

&lt;p&gt;This was the most obvious alternative.&lt;/p&gt;

&lt;p&gt;After all, if the goal is lower costs and serverless infrastructure, Azure Functions seems like the natural choice.&lt;/p&gt;

&lt;p&gt;The problem was that our backend is a traditional FastAPI application.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Middleware&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Long-lived API patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Moving to Functions would have meant adapting the application around a different execution model.&lt;/p&gt;

&lt;p&gt;Our objective wasn't to become serverless at the code level.&lt;/p&gt;

&lt;p&gt;Our objective was to become serverless at the infrastructure level.&lt;/p&gt;

&lt;p&gt;Azure Container Apps allowed us to keep the existing architecture largely unchanged while gaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managed infrastructure&lt;/li&gt;
&lt;li&gt;Autoscaling&lt;/li&gt;
&lt;li&gt;Better cost efficiency&lt;/li&gt;
&lt;li&gt;Container portability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly, our deployment artifact remains a standard Docker image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges During Migration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Azure Student Subscription Restrictions
&lt;/h3&gt;

&lt;p&gt;One challenge I wasn't expecting involved Azure Student subscription limitations.&lt;/p&gt;

&lt;p&gt;Azure Container Registry cloud builds (&lt;code&gt;az acr build&lt;/code&gt;) were unavailable in our subscription.&lt;/p&gt;

&lt;p&gt;Instead, we built images locally and pushed them directly to Azure Container Registry.&lt;/p&gt;

&lt;p&gt;Not a major issue, but definitely something to be aware of.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Apple Silicon Architecture Mismatch
&lt;/h3&gt;

&lt;p&gt;This consumed more time than I'd like to admit.&lt;/p&gt;

&lt;p&gt;I was building Docker images on an M-series MacBook.&lt;/p&gt;

&lt;p&gt;By default, Docker generated ARM64 images.&lt;/p&gt;

&lt;p&gt;Azure Container Apps expected AMD64 images.&lt;/p&gt;

&lt;p&gt;The fix was surprisingly simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A one-line change solved the deployment failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Configuration Management
&lt;/h3&gt;

&lt;p&gt;The VM-based deployment relied heavily on server-side &lt;code&gt;.env&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;Moving to ACA encouraged a cleaner approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment variables&lt;/li&gt;
&lt;li&gt;Managed secrets&lt;/li&gt;
&lt;li&gt;Stateless deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made the application easier to deploy and reproduce across environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Updating CI/CD
&lt;/h3&gt;

&lt;p&gt;We already had GitHub Actions in place.&lt;/p&gt;

&lt;p&gt;However, the workflow needed to be adapted for Azure Container Apps.&lt;/p&gt;

&lt;p&gt;The deployment flow now looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GitHub Push
    ↓
Build Docker Image
    ↓
Push to Azure Container Registry
    ↓
Deploy New ACA Revision
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This significantly simplified production deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After the migration, we now have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Infrastructure that scales based on actual demand&lt;/li&gt;
&lt;li&gt;Revision-based deployments&lt;/li&gt;
&lt;li&gt;Managed HTTPS ingress&lt;/li&gt;
&lt;li&gt;No VM maintenance&lt;/li&gt;
&lt;li&gt;No OS patching&lt;/li&gt;
&lt;li&gt;Cleaner configuration management&lt;/li&gt;
&lt;li&gt;Portable containerized deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And as a side effect:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our monthly hosting costs dropped by more than 70%.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The most interesting takeaway from this migration is that cloud-native infrastructure isn't only useful when you're operating at massive scale.&lt;/p&gt;

&lt;p&gt;For early-stage startups, it can be equally valuable before scale.&lt;/p&gt;

&lt;p&gt;At this stage, my biggest constraint isn't server capacity.&lt;/p&gt;

&lt;p&gt;It's time.&lt;/p&gt;

&lt;p&gt;Every hour spent maintaining infrastructure is an hour not spent improving the product or talking to users.&lt;/p&gt;

&lt;p&gt;Azure Container Apps helped reduce that operational burden while lowering costs at the same time.&lt;/p&gt;

&lt;p&gt;For our current stage, it turned out to be a better fit than both a traditional VM and Azure Functions.&lt;/p&gt;

&lt;p&gt;If you're building a containerized application and don't want the operational overhead of managing Kubernetes, ACA is definitely worth exploring.&lt;/p&gt;

&lt;p&gt;You can check out what we're building at GoPanda:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gopanda.in" rel="noopener noreferrer"&gt;https://gopanda.in&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>azure</category>
      <category>backend</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How I architected the backend for a local vehicle rental marketplace</title>
      <dc:creator>Humayun</dc:creator>
      <pubDate>Wed, 03 Jun 2026 17:59:52 +0000</pubDate>
      <link>https://dev.to/humayun_61ce37df8dc21865e/how-i-architected-the-backend-for-a-local-vehicle-rental-marketplace-1hpc</link>
      <guid>https://dev.to/humayun_61ce37df8dc21865e/how-i-architected-the-backend-for-a-local-vehicle-rental-marketplace-1hpc</guid>
      <description>&lt;p&gt;When building the backend engine for &lt;a href="https://www.gopanda.in/" rel="noopener noreferrer"&gt;GoPanda&lt;/a&gt;—a digital marketplace connecting travelers with local vehicle rental shops—we needed a stack that was fast to develop with, highly performant, and type-safe. &lt;br&gt;
While the React frontend gets the visual praise, the real heavy lifting happens in our Python API layer. Here’s a breakdown of the stack we chose, and how it helps us handle the complexities of a rental marketplace.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Stack: FastAPI &amp;amp; PostgreSQL
&lt;/h2&gt;

&lt;p&gt;We decided to build the API using &lt;strong&gt;FastAPI&lt;/strong&gt; paired with &lt;strong&gt;PostgreSQL&lt;/strong&gt; (via SQLAlchemy and Alembic for migrations). &lt;br&gt;
FastAPI is arguably the best Python web framework right now for building REST APIs. The automatic Swagger UI generation and deep integration with &lt;strong&gt;Pydantic&lt;/strong&gt; for validation saved us countless hours of writing boilerplate serialization code.&lt;br&gt;
Here are a few specific ways this stack helped us solve marketplace challenges:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Complex Validation with Pydantic
&lt;/h2&gt;

&lt;p&gt;A vehicle marketplace is tricky because the data structures are so diverse. The payload required to book a &lt;a href="https://www.gopanda.in/rent/scooty/in/guwahati" rel="noopener noreferrer"&gt;scooty rental in Guwahati&lt;/a&gt; is different from the payload required to list a premium &lt;a href="https://www.gopanda.in/rent/self-drive-car/in/guwahati" rel="noopener noreferrer"&gt;self-drive car&lt;/a&gt;.&lt;br&gt;
Pydantic shines here. By defining strict Pydantic models for our different vehicle types and booking requests, we ensure that bad data never even reaches our route handlers. If a shop owner tries to submit a vehicle listing without a valid price or description, FastAPI automatically returns a clean, detailed &lt;code&gt;422 Unprocessable Entity&lt;/code&gt; response.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Preventing Abuse with Slowapi
&lt;/h2&gt;

&lt;p&gt;Because we act as an aggregator for local shops (like &lt;a href="https://www.gopanda.in/rent/bike/in/guwahati" rel="noopener noreferrer"&gt;bike rentals&lt;/a&gt;), our search and inventory endpoints are prime targets for scraping by competitors. Additionally, we need to protect our booking endpoints from spam.&lt;br&gt;
Instead of writing custom rate-limiting middleware, we integrated &lt;strong&gt;Slowapi&lt;/strong&gt;. It seamlessly wraps our FastAPI routes, allowing us to define granular rate limits (e.g., &lt;code&gt;5/minute&lt;/code&gt; for booking attempts, &lt;code&gt;60/minute&lt;/code&gt; for search queries) using Redis or memory as the backing store.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Offloading Assets to Cloudinary
&lt;/h2&gt;

&lt;p&gt;Images make or break a rental marketplace. Shop owners upload multiple high-resolution photos of their vehicles, but serving those directly from our backend server or database would destroy performance.&lt;br&gt;
We integrated &lt;strong&gt;Cloudinary&lt;/strong&gt; directly into our asset upload flow. When a shop owner adds a new vehicle, our FastAPI backend acts as a secure proxy—it validates the image file, generates a secure signature, and uploads it to Cloudinary. The database simply stores the optimized Cloudinary URLs. This keeps our PostgreSQL database lean and ensures images are served via a fast global CDN.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Takeaway
&lt;/h2&gt;

&lt;p&gt;Building &lt;a href="https://www.gopanda.in/" rel="noopener noreferrer"&gt;GoPanda&lt;/a&gt; reinforced my love for the modern Python web ecosystem. The combination of FastAPI for speed, SQLAlchemy for robust data modeling, and Pydantic for bulletproof validation provides an incredible developer experience.&lt;/p&gt;

&lt;p&gt;If you've got any questions, drop them below. Thank you all.&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>architecture</category>
      <category>database</category>
    </item>
  </channel>
</rss>
