Blog Post
Observability and APM setup
Serverless application development
Android app development company

Next.js at 10K+ Daily: Serverless, Observability, APM

We scaled a Next.js content hub to 10K+ daily users in eight weeks using a serverless architecture, ISR-first rendering, and aggressive edge caching. The case study details our observability and APM setup with OpenTelemetry and Datadog, database and caching choices, and the tactics that kept p95 TTFB under 200ms and ops costs under $200/month.

January 17, 20264 min read773 words
Next.js at 10K+ Daily: Serverless, Observability, APM

Case Study: Scaling a Next.js Site to 10K+ Daily Users with Minimal Ops

When our B2B content hub hit a sustained 10K+ daily users within eight weeks, we decided to scale the Next.js stack without hiring a platform team. The objective was ruthless simplicity: sub-200ms p95 TTFB globally, near-zero on-call churn, and infra spend under $200/month until revenue proved otherwise.

Architecture Decisions That Paid Off

We chose Serverless application development from day one: Next.js on edge runtimes with incremental static regeneration (ISR) for marketing pages, server actions for authenticated flows, and middleware for lightweight auth gates. Static assets live on a CDN, image optimization runs at the edge, and a regional Postgres with connection pooling handles writes while read traffic hits an edge cache.

  • Rendering strategy: ISR for 90% of pages, SSR only where personalization justified it. Revalidation windows started at 60s, tuned by traffic.
  • Data layer: Postgres (Neon) for durable state, Upstash Redis as a request coalescer and rate limiter, Cloudflare KV for ultra-cheap noncritical flags.
  • APIs: Webhooks received via an edge function, batched into a queue to protect the database during vendor spikes.
  • Assets: Next/Image with AVIF and fixed device breakpoints; 35% bandwidth reduction with no visible regression.

Observability and APM Setup

Minimal ops does not mean minimal insight. We wired OpenTelemetry across edge, serverless, and database, exporting to Datadog. Every user-visible action starts a trace at the CDN, flows through Next.js middleware, server actions, and finishes at the SQL statement. Logs are structured, sampled by error rate, and correlated with trace IDs.

Close-up of a blue screen error shown on a data center control terminal.
Photo by panumas nikhomkhai on Pexels
  • Custom spans around fetches in React Server Components, plus cache hit/miss attributes to monitor ISR efficacy.
  • Database spans include the normalized query and a "rows" tag, helping us spot N+1s and over-eager joins.
  • SLIs: p95 TTFB under 200ms, p99 error rate under 0.3%, background job success over 99.8%.

CI/CD and Release Safety

A Turborepo monorepo hosted the Next.js app, shared UI, and infra code. PRs deployed ephemeral previews with production data via read-only replicas. A two-stage canary routed 5% of EU traffic for 15 minutes, then global rollout.

Handling Spikes Without Babysitting

We pre-rendered long-tail content via on-demand ISR after each publish. Edge caching used stale-while-revalidate so bursts hit cached HTML while a single background request refreshed it. Webhooks from CRM launches were queued and processed at a fixed concurrency to cap DB pressure. Core vitals reporting ran client-side, feeding traces that mapped performance to conversions.

Focused detail of a modern server rack with blue LED indicators in a data center.
Photo by panumas nikhomkhai on Pexels

Data Model and Consistency

Writes stayed in a single region with logical replication for reads. For cart and session state, we used signed cookies plus Redis for server actions. Mutations returned provisional state to the client, with background reconciliation if a write lagged. This pattern kept perceived latency low while preserving correctness.

Mobile Parity and Marketing Integrations

As an Android app development company partner evaluated the same backend, we ensured API contracts were stable, paginated, and cacheable. Deep links opened web or native consistently; attribution parameters were preserved server-side to survive app installs. Analytics events were pushed from the server to avoid ad-block loss, then joined with web vitals to inform landing page tests.

Overhead view of a laptop showing data visualizations and charts on its screen.
Photo by Lukas on Pexels

Costs and Guardrails

Serverless kept the bill quiet. Edge invocations spiked during launches but normalized to single-digit dollars daily. Database cost was dominated by storage; a nightly job pruned event chaff. Reserved concurrency prevented noisy neighbors, and an automated chaos test validated graceful degradation when Redis or the queue was unavailable.

Pitfalls We Hit (and Fixed)

  • ISR stampedes: we added a Redis lock per slug and a 5-minute jitter to invalidate waves.
  • Cold starts: critical routes moved to edge-compatible handlers; remaining functions pre-loaded dependencies to cut init by 60%.
  • Leaky lambdas: a headless Chrome dependency for PDFs was replaced with a queue-based renderer and persisted artifacts in object storage.
  • Connection saturation: switched to a serverless-friendly driver with pooled connections and aggressive keep-alive.

Roadmap to 100K Daily Users

The path forward is evolutionary: regional edge data stores for high-read entities, response streaming for complex server actions, and batched mutations for write-heavy flows. We'll add per-tenant rate limits and adopt async server actions for heavy integrations. The same Observability and APM setup scales by increasing sampling on fast paths and full fidelity for error traces.

Hiring and Partners

If you need to replicate this playbook without building a platform team, partner with specialists. slashdev.io connects you with remote engineers and agency expertise who've executed Serverless application development at scale, from Next.js storefronts to multi-tenant SaaS. They move fast, keep ops small, and leave you with maintainable patterns.

Share this article

Related Articles

View all

Ready to Build Your App?

Start building full-stack applications with AI-powered assistance today.