01Ad TechSaaS2025

An in-house ad tech platform — ad server, contextual targeting, VAST delivery, and real-time analytics on infrastructure you own.

Serve latency
<50ms
Protocol
VAST 4.0
Batch flush
500 / 5s
Stack
NestJS / Redis
AdFlow — cover
— Project notes

The challenge.

Companies running serious ad spend bleed margin to platforms they don't own — Google Ad Manager, The Trade Desk, DoubleClick. Platform fees, audience data sitting on someone else's servers, targeting locked to what the vendor exposes.

The brief: build the full stack — ad server, targeting engine, creative delivery, impression pipeline, analytics — and run it on infrastructure the business actually controls.

The solution.

NestJS ad server with an in-memory campaign cache refreshed every 30 seconds, so the serve path almost never hits Postgres. Contextual targeting on weather, location, and time of day — no cookies, no personal data, GDPR-clean by construction.

Impression events push to a Redis queue in microseconds and batch-flush to Postgres every five seconds in groups of 500 — the serve path is never blocked on a database write. VAST 4.0 XML endpoint for video players, async JS tag for banner and rich media. Weather targeting wraps OpenWeatherMap with a 10-minute Redis cache and a safe "any" fallback so serving never stops when the upstream does.

The impact.

End-to-end serve under 50ms including IP geolocation, weather lookup, targeting evaluation, and creative selection. VAST 4.0 compliant — drops into any standard video player. Dashboard shows impressions, CTR, and weather/location breakdowns live, with no CSV exports and no third-party platform in the loop.

— Stack used
NestJSNext.jsPostgreSQLRedisTypeORMOpenWeatherMapVAST 4.0AWS
— See it in production
Visit AdFlow