FATA #16 —Design of Google Ads.

Nazar Khimin
4 min readJul 24, 2022

--

Advertising is an interaction between advertisers and users.

Context view

Stakeholders view

Components/Microservices

Primary flow:

  • The system first collects campaign information from advertisers
  • Target service will be used to group users based on criteria set by advertisers.
  • The ad server asks the ranking service to score ads and find the most suitable ad for the current ad request to a user.
  • Once the user finishes interacting with the ad, either skip it or click it, the system will collect the metrics and report the KPI and send it to advertisers.
  • A data pipeline behind these collectors will aggregate the event history into more valuable real-time statistics and business logs.
  • With those data, the ad server and pacing services can improve the ad delivery performance. The business logs will be used for inventory forecasting and billing.

Advertiser use cases:
APS-1: Advertisement publishment
I want to display the content of advertisement posts on websites based on the target.

Writers use case:
WPS-1: Apply advertisement
I want to embed advertising on my website and earn money.

Functional Requirement

  1. Buy advertising media
  2. Request for advertising materials
  3. Can request advertising media across different placements
  4. Provide multiple campaign choices
  5. Allow to bid/buy
  6. Collect users personal information
  7. Send related ads to users
  8. Receive and process the advertiser order request
  9. An advertising KPI dashboard for advertisers
  10. Allow user to pay through the web page after click
  11. Make proof of payment
  12. Send the stats reports to advertisers

Non-functional requirement

  1. Consistency
  2. Durable
  3. Reliable
  4. Low latency

Constraints

  1. Frequency: As a platform cannot send too many ads to users to hurt user experiences. It will involve a series of algorithms.
  2. Response time: An advertiser will want a faster response time
  3. Quality: Ad engine must satisfy the user and an advertiser

Component/Microservice/Interaction diagram

Ad-Ranking Service

  • Pick an ad for the user
  • Deliver the best-related ad by considering the user interest, past records, tags he/she use, and ad historical performance
  • The machine learning pipeline can be built with the application of Sparse logistic regression and gradient boosting decision tree

RPS evaluation

Website fetches advertisement posts from the database so it’s limited to input and output.
Let’s assume for one banner we have 3.6 mln requests per hour.

System load:
RPS = (Total requests / Task duration)
Task duration: 1 hour = 3600 seconds

3,6 mln / 3600 = 1000 request per second

Time duration = 0.1 sec
CPU Bound:

Number of cores = (RPS * Task duration)

1000 * 0.1 = 100 CPU cores

Memory Bound:
RPS = (Total RAM/ worker memory) * (1 / Task time)

(Total RAM/ worker memory) = RPS / (1 / Task time)
(Total RAM/ worker memory) = 1000 / 10 = 100
8000 mb / 80 mb = 100

RAM = 16 GB
Worker memory = 80 mb

Technologies

  • Programming languages: JavaScript (front-end), Java, Python (back-end);
  • Frameworks: Node.js, Vue Js, Spring, DJango;
  • Database: Postqresql, Redis (as a DBMS), Cassandra.
  • Web server: Nginx;
  • DevOps: Jenkins, Gradle, GitLab, Docker, Datadog.
  • Cloud storage: GCP Cloud Storage

Approach to tracking statistics

The main type of statistics:
CPA: Cost per action.
CPC: Cost per click.
CTR: Click-through rate.
CVR: Conversion rate.

The system should have customer journey/stages and count them in order to provide statistics

Approach to store statistics by shows and clicks

Store statistic by shows and clicks on front-end and in the end of session store this data into database

Total cost of ownership

The total cost of ownership (TCO) is a metric that measures the amount of money spent on acquiring any asset.

Simple Formula:
- Initial cost (I)
- Maintenance cost (M)
- Remaining costs (R) — possible deviation costs
The calculation will be:
I + M — R = TCO

Appendix

Reference:

https://blog.admixer.com/dsp-vs-ssp/

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response