The project is a service and users (advertisers) can manage campaigns of targeted advertising with it. Advertisers have the ability to set up an advertising campaign in such a way that advertisements are shown only to the target audience. This is achieved by implementing the possibility of detailed settings for a wide list of parameters.
Each advertiser has access to the following sections:
The service works in such a way that ads are shown depending on the user’s preferences or the history of his requests. This information is analyzed and a decision is made which ad should be displayed.
The application has a classic client-server architecture. The client interacts with the application through a web interface. Using the web interface, the client configures settings to filter users who may be interested in this advertisement, and also views statistics for each advertisement.
The server part is responsible for the instant purchase of advertising spaces, the transfer of advertising for display in the purchased places, and for collecting statistics and information on advertisements and storing them in databases (MySQL, ClickHouse).
The server part of the project is a Java handler application. The main task of the app is to receive requests from the SSP (Sell Side platform) – the RTB platform. In the SSP, the owners of advertising sites register free spaces. If a user visits an advertising platform and wants to demonstrate an advertising space that fits the configured parameters, SSP sends a request to the handler, and it must quickly decide on the rate and send its response to SSP.
The handler must work fast (respond quickly to SSP requests) – therefore it is written in Java without using frameworks. It works with MySQL database, where information on advertisements is stored and with the ClickHouse database, where the statistics go. The handler actively uses multithreading: both the already established approaches with synchronized and the new ones with java concurrent.
Since the system can be distributed – several processors with different SSPs can work at the same time. To synchronize the work of handlers, a component is used that is located in each of them. Synchronization of this component occurs through the database. This approach increases the fault tolerance of the system – if one of the handlers fails, then the component on one of the still running will automatically start working and continue to synchronize the remaining handlers.
Stack: Java 8, Sun HttpServer, Netty, MySQL, ClickHouse, java.util.concurrent.
Infrastructure: Jira, Confluence, SVN.