Adtech is an important part of running a digital advertising campaign. Advertisers use adtech to buy, manage, and measure digital advertising. If you’re looking to get started with adtech, read on to learn about the adtech basics, including common tools and services, and the benefits of creating an advertising strategy that leverages adtech.
In the tutorial, I just log how to build a simple micro-service system for Ad-Tech.
Technologies
– SpringBoot
– Java 8
– Spring-Cloud: Sleuth
– Lombok
– Spring Aspect
– Open-Feign
– Spring Actuator
– Docker
– Kubernate K8s
Epic Architecture

1. Web-Parse Service: using to parse text from Web-URL
2. Ad-Tech Service: interact with Web-parse service and process to category a web-page.
Distributed Patterns
1. Distributed Tracking: using Spring Cloud Sleuth

2. Pattern Circuit Breaker – for cascading issue in distributed environments
In the Ad-Tech-Service, we use feign for calling API of Web-Parsing service with below configuration:
feign: client: config: default: connectTimeout: 20000 readTimeout: 20000 loggerLevel: BASIC
Web-Parse Service API
/api/parse: post: summary: "POST api/parse" operationId: "parseWeb" responses: "200": description: "OK"

* Unit Testing:

Ad-Tech Service
/api/categories: post: summary: "POST api/categories" operationId: "getUrlCategories" responses: "200": description: "OK"

* Unit Testing

Docker file
FROM adoptopenjdk:11-jre-hotspot ARG JAR_FILE=*.jar COPY ${JAR_FILE} application.jar ENTRYPOINT ["java", "-jar", "application.jar"]
Kubernate Deployment + Service
1. Web-parse Service:
– Deployement:
apiVersion: apps/v1 kind: Deployment metadata: name: webparser spec: replicas: 1 selector: matchLabels: app: webparser template: metadata: labels: app: webparsers spec: containers: - name: app image: ozenero/web-parser:1.0.0 ports: - containerPort: 9000 imagePullPolicy: Always
– Service:
apiVersion: v1 kind: Service metadata: name: webparser spec: selector: app: webparser ports: - port: 9000 targetPort: 9000 type: ClusterIP
2. Ad-Tech Service:
– Deployment:
apiVersion: apps/v1 kind: Deployment metadata: name: adtech spec: replicas: 1 selector: matchLabels: app: adtech template: metadata: labels: app: adtech spec: containers: - name: app image: ozenero/ad-tech:1.0.0 ports: - containerPort: 8080 env: - name: WEB_PARSE_URL value: webparsers:9000/web-parser imagePullPolicy: Always
– Service:
apiVersion: v1 kind: Service metadata: name: adtech spec: selector: app: adtech ports: - port: 8080 targetPort: 8080 type: LoadBalancer
Why we use type: LoadBalancer
for Ad-Service?
=> Because default is type: ClusterIP
We use type: LoadBalancer
for public traffic-loading.
Note:
env: - name: WEB_PARSE_URL value: webparsers:9000/web-parser
This is the url for feign calling from Ad-Tech service to Web-Parse service.
For kubectl-deployment, using cmd:
kubectl apply -f kube
For scaling, using cmd:
kubectl scale --replicas=2 deployment/webparser kubectl scale --replicas=2 deployment/adtech
GitHub
– Ad-Tech Service
https://github.com/ozenero/ad-tech-service
– Web-Parse Service
https://github.com/ozenero/web-parser-service/