Mayank Chaudhari
Back to Projects

The 'Static Replica' Engine (K8s Cost Optimization)

Architecting a 'Scale-to-Zero' Jupyter environment that reduced TTI from 3 minutes to milliseconds via Static Site Generation.

Role:Lead Architect
Impact:Reduced TTI from >3min to <1s; Cut infra costs by ~60% (Order of magnitude).

Tech Stack

Next.js (SSG/ISR)
Kubernetes (K8s)
GCP
React Markdown
System Design

The "3-Minute" Bounce Rate

DataCabinet provided "Computer Labs on the Cloud"—ephemeral environments for running Jupyter Notebooks.

The Solution: "Static-First" Hybrid Architecture

I re-architected the delivery layer using Next.js Static Site Generation (SSG), effectively creating a "Hollow Mirror" of the infrastructure.

sequenceDiagram participant U as Visitor (User) participant N as Next.js (SSG/CDN) participant S as K8s Storage (PV) participant API as Orchestration API participant K as K8s Cluster (Pods) Note over U, N: Phase 1: Passive Consumption (90% Traffic) U->>N: Request Project URL N->>S: (Build Time) Fetch Raw Notebook JSON S-->>N: Return Data N-->>U: Serve Static HTML (react-markdown) Note right of U: Load Time: <1s (Zero Compute Cost) Note over U, K: Phase 2: Active Intent (10% Traffic) U->>API: Click "Edit / Run" API->>K: Trigger Pod Provisioning Note right of K: Booting Container (3 mins)... K-->>U: WebSocket Connection Ready U->>K: Live Code Execution

1. The Storage-to-Static Pipeline

Instead of spinning up a pod to read a file, I built a pipeline to access the data directly from the Kubernetes Attached Storage (Persistent Volumes).

2. The Lazy Provisioning Pattern (Scale-to-Zero)

We shifted the "Heavy Lift" strictly to user intent.

3. Impact & ROI