> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiderx.io/llms.txt
> Use this file to discover all available pages before exploring further.

# System Architecture

> Components and data flow of the A2 platform

## Who is this guide for?

This guide is for developers and system administrators who want to understand A2's technical architecture. It explains how A2 serves ads and processes data.

***

## System overview

The A2 platform is designed around core components for reliable ad operations and data processing.

```mermaid theme={null}
graph TD
    User[User] -->|Ad request| Edge[A2 Edge]
    Edge -->|Ad delivery| User
    User -->|Send logs| Datahub[A2 Datahub]
    Admin[Admin/Operator] -->|Configure and manage| Manager[A2 Manager]
    Manager --> DB[(Database)]
    Datahub --> DB
    Edge -.->|Sync settings| DB
```

***

## Unified Auction

A2's key differentiator is its **Unified Auction** approach. Instead of the traditional waterfall, all ad sources compete simultaneously in a single RTB auction.

```mermaid theme={null}
flowchart TB
    subgraph Before["Traditional waterfall"]
        W1[Direct Sales] --> W2[Ad Network A]
        W2 --> W3[Ad Network B]
        W3 --> W4[DSP]
    end

    subgraph After["A2 Unified Auction"]
        U1[All ad sources] --> U2[Single RTB auction]
        U2 --> U3[Highest bid wins]
    end
```

### Problems with the waterfall approach

* **Sequential calls**: Ad sources are called one by one in priority order
* **Missed opportunities**: Lower-priority sources that could bid higher miss out
* **Inefficient revenue**: The first ad to respond wins, not the highest bid

### Benefits of Unified Auction

* **Simultaneous competition**: Direct Sales, Ad Networks, and DSPs bid at the same time
* **Yield optimization**: Real-time highest-bid wins raise eCPM
* **Header Bidding support**: Maximizes ad revenue using the industry-standard approach

***

## Core components

### A2 Manager (management console)

A2 Manager is a web-based management tool that handles all settings for your ad business. Retailers, advertisers, and admins use it to configure and manage ads.

| Item | English | Description |
| - | - | - |
| Role | Role | Account management, placement creation, campaign execution, report viewing |
| Users | Users | Retailers, advertisers, system administrators |

**Key features:**

* Create and manage campaigns
* Configure and manage placements
* Upload and approve creatives
* Request and approve allocations
* View and analyze performance data
* Manage user accounts and permissions

<Tip>
  API documentation and testing tools for developers are available in the [Developer Portal](/guides/platform-overview/en/developer-portal).
</Tip>

### A2 Edge (ad serving engine)

A2 Edge is a high-performance engine that finds and returns the best ad for a user's request **within 0.01 seconds (10ms)**.

| Item | English | Description |
| - | - | - |
| Role | Role | Real-time bidding (RTB), targeting matching, ad delivery decisions |
| Feature | Feature | Guarantees stable response times even during traffic spikes |

**Key features:**

* Receive and process ad requests
* Select ads that match targeting conditions
* Run bidding logic (CPM, CPC, CPA)
* Return ad responses
* Collect impression/click events

### A2 Datahub (data pipeline)

A2 Datahub is the system that collects and processes every event that occurs, such as ad impressions, clicks, and conversions.

| Item | English | Description |
| - | - | - |
| Role | Role | Log collection, data cleansing, real-time report generation |
| Feature | Feature | Reliable processing of large data volumes and click fraud filtering |

**Key features:**

* Collect ad event logs (impressions, clicks, conversions)
* Collect user behavior logs (purchases, searches, cart, etc.)
* Cleanse and store data
* Prepare data for analysis
* Detect and filter click fraud

***

## Data flow

### Ad serving flow

```mermaid theme={null}
flowchart LR
    A[User visit] --> B[Ad request]
    B --> C[Edge: Select ad]
    C --> D[Ad response]
    D --> E[Ad impression]
    E --> F[Datahub: Record event]
```

1. A user visits the retailer's service.
2. The SDK or API installed on the page requests an ad from Edge.
3. Edge selects the best ad based on placement information, user information, and active campaigns.
4. Edge returns the selected ad information (image URL, click URL, etc.).
5. The ad is displayed on the user's screen.
6. The impression event is sent to Datahub and recorded.

### Configuration data flow

```mermaid theme={null}
flowchart LR
    A[Admin settings] --> B[Campaigns/Placements/Allocations]
    B --> C[Edge sync]
    C --> D[Ready to serve ads]
```

1. Admins, retailers, and advertisers configure campaigns, placements, and allocations in Admin.
2. The configured data is saved to the database.
3. Edge servers sync the latest settings.
4. Ad serving starts with the new settings applied.

***

## Integration methods

There are two ways to integrate a retailer's service with A2.

<Tabs>
  <Tab title="Web SDK">
    ### Web SDK integration

    This is the simplest integration method. After creating a placement, insert the provided script tag into your web page. The SDK automatically handles ad requests, impression tracking, and click tracking.

    ```html theme={null}
    <!-- Placement tag example -->
    <div id="a2-placement"></div>
    <script src="https://{customer_id}.a2cloud.aiderx.app/a2-sdk.js"></script>
    <script>
      let app = new A2_SDK.A2({
        base_url: "https://{customer_id}.a2cloud.aiderx.app"
      });
      let placement = document.getElementById("a2-placement");
      app.register_ad("your-tagid", placement, 300, 250, "fixed");
    </script>
    ```

    **Advantages:**

    * Easy installation
    * Automatic event tracking
    * Responsive support
  </Tab>

  <Tab title="Direct API calls">
    ### Direct API calls

    If you need finer control, you can call the Edge API directly. This suits server-side rendering, mobile apps, special ad formats, and similar cases.

    ```bash theme={null}
    # Ad request example
    curl -X POST https://{customer_id}.a2cloud.aiderx.app/app/v0/ad/{tagid} \
      -H "Content-Type: application/json" \
      -d '{"version": "0.1.0", "user": {"id": "user-123"}}'
    ```

    **Advantages:**

    * Full control
    * Server-side rendering support
    * Mobile app integration
  </Tab>
</Tabs>

→ Detailed integration steps: [Serving ads](/development/en/serving-ad)

***

## Performance metrics

| Metric | Value | Description |
| - | - | - |
| Ad response time | \< 10ms | Time for Edge to select an ad and respond |
| Traffic throughput | High availability | Stable serving even during traffic spikes |
| Data processing | Real-time | Datahub processes events in real time |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.