startup

Startup: Python Monolith on VM

Architecture Diagram


              %% Autogenerated startup-vm-python
graph TD
  classDef standard fill:#1e293b,stroke:#38bdf8,stroke-width:1px,color:#e5e7eb;
  classDef c-actor fill:#1e293b,stroke:#e5e7eb,stroke-width:1px,stroke-dasharray: 5 5,color:#e5e7eb;
  classDef c-compute fill:#422006,stroke:#fb923c,stroke-width:1px,color:#fed7aa;
  classDef c-database fill:#064e3b,stroke:#34d399,stroke-width:1px,color:#d1fae5;
  classDef c-network fill:#2e1065,stroke:#a855f7,stroke-width:1px,color:#f3e8ff;
  classDef c-storage fill:#450a0a,stroke:#f87171,stroke-width:1px,color:#fee2e2;
  classDef c-security fill:#450a0a,stroke:#f87171,stroke-width:1px,color:#fee2e2;
  classDef c-gateway fill:#2e1065,stroke:#a855f7,stroke-width:1px,color:#f3e8ff;
  classDef c-container fill:#422006,stroke:#facc15,stroke-width:1px,color:#fef9c3;

  subgraph vm-layer ["VM-LAYER"]
    direction TB
    nginx(("<b>Nginx</b><br/><i>gateway</i><br/><span style='font-size:0.8em'>Reverse Proxy & SSL</span>"))
    class nginx c-network
    app("<b>Python App (Gunicorn)</b><br/><i>service</i>")
    class app c-compute
    db[("<b>PostgreSQL</b><br/><i>database</i><br/><span style='font-size:0.8em'>Local or Managed</span>")]
    class db c-database
    redis("<b>Redis</b><br/><i>cache</i><br/><span style='font-size:0.8em'>Cache & Broker</span>")
    class redis standard
  end

  %% Orphans
  user(("<b>User / Client</b><br/><i>actor</i>"))
  class user c-actor
  host("<b>Virtual Machine (Linux)</b><br/><i>compute</i><br/><span style='font-size:0.8em'>Ubuntu / Debian</span>")
  class host c-compute

  %% Edges
  nginx -.-> app
  app -.-> db
  app -.-> redis
            

Startup: Python Monolith on VM

A cost-effective, simple deployment for early-stage startups. Runs a Python web application (Django/FastAPI) behind Nginx on a single Virtual Machine.

Architecture Diagram

Description

This architecture is optimized for speed of iteration and simplicity. It avoids complex orchestration frameworks in favor of a reliable, well-understood “Monolith on a Box” pattern.

Core Components:

  • Virtual Machine: A single compute instance (AWS EC2, Google Compute, Azure VM, or DigitalOcean Droplet) hosts the entire stack.
  • Nginx: Acts as the reverse proxy, handling SSL termination, static file serving, and forwarding traffic to the application server.
  • Application Server: Runs the Python code (e.g., Gunicorn for Django/FastAPI).
  • Database: A local or managed PostgreSQL instance provides relational data storage.
  • Redis: Used for caching and background tasks (e.g., Celery) to keep the main thread responsive.

Why this stack? For a new project, “boring” technology is a competitive advantage. This stack scales vertically for a long time before needing horizontal breakdown.

Tech Stack

ComponentTechnology
Segmentstartup
Deploymentvm-monolith
Languagepython
Web Servernginx
Databasepostgres
Cacheredis