Media Buying, AdTech, SaaS platform serving millions of ads daily with 99% uptime.

Architecture Overview of a Scalable Media Buying SaaS Platform

Building and operating a media buying SaaS platform at scale requires careful planning around infrastructure, traffic management, and data consistency. Here’s a high-level overview of how we’ve architected such a system to handle millions of ad events per day with high availability and performance.

Core Components and Architecture

Click Handling System

The system processes high-volume ad clicks through a Load Balancer that distributes traffic to four Click Servers (CS1–CS4). These servers are responsible for handling all incoming click traffic, including:

  • Validating and logging user click data.

  • Receiving postbacks (conversion data) from advertisers, which are first stored in a Postback Stash on Redis (Primary Cluster) and then written to the database in optimized batches.


Application Server

A dedicated Application Server powers the admin panel and internal tools used by both clients and internal teams. This server connects to:

  • A Write Database and Read Replica, both managed via DigitalOcean MySQL Clusters.

  • Multiple Redis Clusters:

    • Primary Cluster – Caching, postback queues, and real-time session data.

    • Visit History Cluster – Tracks unique visitors per campaign, segmented by time windows (e.g., 2 hours, 6 hours, 1 day, 4 days, 1 week).

    • Click Stash Cluster – Temporarily holds click data before persisting it to the database in bulk.


Ping System

The Ping System evaluates campaign and publisher availability in real time. It operates through its own Load Balancer and consists of four Ping Servers (PS1–PS4). Each server:

  • Maintains a local cache for low-latency operations.

  • Connects to the Read Database and Redis Clusters.

  • Does not write to the database directly, ensuring that write operations are centralized and controlled.


Job Scheduling and Background Processing

Two additional specialized servers manage asynchronous operations:

  • Scheduler Server – Executes cron jobs, including:

    • Polling Ping Servers to gather cached data.

    • Aggregating performance metrics into rollup tables for reporting and analysis.

  • Worker Server – Manages Laravel queues using Laravel Horizon, handling queued jobs and batch processes with resilience and control.


Financial and Client Notification Systems

The platform includes an internal Ledger System and Account Monitoring Tools that:

  • Track client balances and ad spending in real-time.

  • Trigger notifications to clients and account managers for low balances or suspicious activity.

  • Automate parts of the reconciliation and fraud detection process to improve efficiency.


Built for Scale and Resilience

This media buying SaaS platform was architected with performance, modularity, and scalability in mind. By separating concerns—distributing click and ping processing, isolating database writes, leveraging Redis for high-speed temporary storage, and using batch jobs for reporting—we ensure consistent system behavior even under high load.

The result is a resilient, real-time ad tech solution that balances data integrity, cost-efficiency, and operational agility.

This is a very high-level overview of the Media Buying SaaS Platform. This is not linked to any specific product or company.