This Guidance helps publishers deploy a prebid server using a highly-available, multi-Region approach. Publishers with ad units on their webpage or mobile app can capture bids from multiple demand sources using a prebid server deployment on AWS. The architecture follows a microservices approach that supports scalability to meet changing demand, security mechanisms to protect data, and a deployment pipeline to implement changes in minutes.
Architecture Diagram
[Architecture diagram description]
Step 1
When a user accesses a webpage or mobile app with Prebid.js or Prebid SDK with ad spaces, this sends an ad request to the prebid server Elastic Load Balancer (ELB).
Step 2
The prebid server hosted in Amazon Elastic Kubernetes Service (Amazon EKS) reads the stored requests and account ID from its internal Least Recently Used (LRU) cache and queries Amazon Relational Database Service (Amazon RDS) if the data is not available in the cache.
Amazon RDS contains stored requests for mobile ads, account IDs, and any other data that is required by the prebid server.
Step 3
The prebid server launches an auction and sends bid requests to the bid adapters in the configuration file (known as the enabled bidder), and the bidders respond with either a bid or no-bid response.
Step 4
The prebid server stores bids, VAST XML, and ad creatives in the prebid cache.
Step 5
The prebid cache server stores the object in Amazon DynamoDB, a no-SQL backend.
Step 6
The prebid server selects the top bidder and sends the details to the publisher ad server.
Step 7
The ad server selects the top bidder among the programmatic bidding and header bidding and responds back to the user device with an ad response. The device renders the ad.
Step 8
If the ad server chooses the prebid request as the highest bidder and if the ad format is a video ad or AMP ad, the device fetches the VAST file or ad creative stored in the prebid cache server.
Step A
The transaction (bid-level logs) logs are shipped to Amazon Simple Storage Service (Amazon S3) by Amazon Kinesis Data Streams and Amazon Kinesis Data Firehose for downstream analytics and reporting.
Step B
The prebid container images are stored in Amazon Elastic Container Registry (Amazon ECR).
Step C
AWS Key Management Service (AWS KMS) encrypts the traffic in transit in Amazon Kinesis and at rest in Amazon S3. AWS Identity and Access Management (IAM) manages permissions for users and services. Amazon CloudWatch collects and stores logs.
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
This Guidance uses CloudWatch to collect and analyze logs from ELB, Amazon EKS, Kinesis, ElastiCache for Redis, DynamoDB, and Amazon RDS which will help with resource utilization. You can set thresholds on different metrics and configure automatic actions or alerts based on the events.
-
Security
All IAM policies have been scoped down to the minimum permissions required for the service to function properly. IAM supports role-based access management to provide the right access to resources for authenticating and authorizing requests. AWS KMS helps with storing encryption keys to encrypt the data both in motion and at rest along with encrypting the prebid container image in Amazon ECR. VPC endpoints allow private connectivity to AWS services, which will help in keeping customer traffic on the AWS network.
-
Reliability
ELB acts as ingress controller which routes traffic requests from the website with prebid.js file to a healthy Amazon EKS pod. ELB allows for synchronous loose coupling so that traffic won’t be directed to an Amazon EKS pod or node that may be overloaded.
-
Performance Efficiency
Data streaming service such as Kinesis unblock the application from allocating resources to write log data to disks. This improves overall performance of the application.
-
Cost Optimization
Amazon Elastic Compute Cloud (Amazon EC2) Spot instances and AWS Graviton Processors are built for cost-performance optimization. ElastiCache for Redis supports Graviton instances, and data tiering provides an option for lower-cost Non-Volatile Memory Express (NVMe) solid state drives (SSDs) in each cluster node in addition to storing data in memory. You can reduce Amazon EKS costs by using node pools with Graviton and Amazon EC2 Spot instances.
-
Sustainability
This Guidance uses managed services, which can be configured with auto scaling so only you only use required capacity. Additionally, Graviton instances use 60% less energy when compared to x86 instances.
Implementation Resources
A detailed guide is provided to experiment and use within your AWS account. Each stage of building the Guidance, including deployment, usage, and cleanup, is examined to prepare it for deployment.
The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
Related Content
[Title]
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.