“Platform” is an eagerly applied term in our Industry. Fortunately, The structure of platforms is well-understood and documented. The Ads-Trust team has been building a platform, which powers our applications. This platform has a similar structure, and was conceived by applying core software development principles and practices. In this talk we walk you through our journey, of applying theory in practice and the demonstrate the value it generates. “Platform” is an eagerly applied term in our Industry. Fortunately, The structure of platforms is well-understood and documented. The Ads-Trust team has been building a platform, which powers our applications. This platform has a similar structure, and was conceived by applying core software development principles and practices. In this talk we walk you through our journey, of applying theory in practice and the demonstrate the value it generates.
3. Ads Quality
• many reviewers, categorized into two buckets :-
• Software: ML models, content of ads(regexs, all caps, emojis, embedded
links), history of advertiser
• Human reviewers: Inspector/Review Queue.
4. • many ad types
• review logic can vary per ad-type
• review logic can vary over time
5. • certain ad types require permissions/certifications
• cost/capacity of reviewers need to be considered
6.
7. Problems
• Each Reviewer has different schema to communicate with each other
and need to track all communication themselves.
• Difficult to track lifecyle of an ad
• Difficult to track performance of each reviewer
• Low developer productivity
13. Value is created in interactions between
suppliers and producers(roles)
The platform regulates and manages activity
by creating conditions for interactions
47. Applying DRY on behavior of a Reviewer
• Communicates with each other asynchronously
• Each reviewers has a kafka topic with specific schema to get requests
to review
• Calls other reviewers with their different event schemas
• Receive Response In terms of an event from reviewers which were
invoked via kafka.
• Returns response to caller by sending an Event with some specific
schema like ReviewItemClosedMessage etc.
48. First Abstraction
• They have the port to review an ad.
• They have the port to get response from other reviewers.
50. Server
• public interface Server {
Task<Response> review(
@NonNull Reviewee reviewee,
@NonNull Actor client,
@NonNull ReviewSession session);
}
Reviewee - Ad information
Client – caller which request for review
Session – session of a review (guid)
51. Client
• public interface Client {
Task<Response> onReview(
@NonNull Reviewee reviewee,
@NonNull Actor server,
@NonNull ReviewSession session,
@NonNull ReviewDecision reviewDecision);
}
Reviewee - Ad information
Client – caller which request for review
Session – session of a review (guid)
Review Decision – decision of a server (target reviewer)
52. • Kafka Event Schema
• Address of target reviewer i.e. kafka topic of target reviewer
• Just have to know identifier of other reviewer
Reviewers should not care about
54. TSCP Review Api Library
(Platform provided construct)
It has the responsibility of
• taking care of resolving target topic of kafka or may be restli endpoint
of target reviewer.
• It converts review request or review response into required common
kafka message schemas.
56. Kafka Schemas
Only 2 avro schemas for communication across reviewers
• ReviewRequestMessage - details of ad, caller, header, sessiom
• ReviewResponseMessage – decision of a reviewer
57. Server Stub
Similar concept to RPC
• It acts as a server proxy
• Construct and send a
ReviewRequestMessage kafka message
58. Client Stub
Similar concept to RPC
• It acts as a client proxy
• Construct and send a
ReviewResponseMessage as a kafka
message
59. Reviewer Registry
• Resolver of client and server based on urn(namespace and id) of a
reviewer.
• It has list of all ports and corresponding kafka topics.
63. ReviewerGeneratorFactory
• Takes input as List of Reviewers
• Starts Kafka Client and kafka Server Listeners for
all reviewers with the help of ReviewerRegistry
66. Reviewer 1
Tscp Review API library
Registry
Server
Stub
External
Shared
Config/DB
Mapping of kafka
topics of all
reviewers
Request another
reviewer to
review
ds
Kafka
ReviewRequestMessage
Phase 1
69. Reviewer 2
Tscp Review API library
Registry
Client
Stub
External
Shared
Config/DB
Mapping of kafka
topics of all
reviewers
Send response to
another reviewer
ds
Kafka
ReviewResponseMessage
Phase 1
74. Review LifeCycle Tracking
• Sidecar running separately being run by new multiproduct , Tscp-
Quality-Tracking
• Listening to all requests and responses using registry of tscp-review-api and
saves them into DB.
• Will be used to provide responses of one reviewer to other with
permission control via an API.
75. Tscp Quality Tracking(Platform)
Tscp Quality
Tracking
Tscp Review Api
Registry
Externa
Shared
Config/DB
Mapping of kafka
topics of all
reviewers
Get mapping
of
all reviewers
Kafka cluster
Listen to all requests
and
responses
DBSaves all requests
and responses
into DB
1
2
3