<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammed Ali Alghentawi on Medium]]></title>
        <description><![CDATA[Stories by Mohammed Ali Alghentawi on Medium]]></description>
        <link>https://medium.com/@mohammedalialghentawi?source=rss-f34e6e8b7155------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ztRpAeEXvrbO79Hzw76eCA.png</url>
            <title>Stories by Mohammed Ali Alghentawi on Medium</title>
            <link>https://medium.com/@mohammedalialghentawi?source=rss-f34e6e8b7155------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:44:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammedalialghentawi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Server-Side Ad Insertion (SSAI) — System Design]]></title>
            <link>https://medium.com/@mohammedalialghentawi/server-side-ad-insertion-ssai-system-design-f4540264d8f1?source=rss-f34e6e8b7155------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4540264d8f1</guid>
            <category><![CDATA[ssai]]></category>
            <category><![CDATA[adtech]]></category>
            <category><![CDATA[ott]]></category>
            <category><![CDATA[iptv]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[Mohammed Ali Alghentawi]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 19:30:08 GMT</pubDate>
            <atom:updated>2024-03-18T19:30:08.286Z</atom:updated>
            <content:encoded><![CDATA[<h3>Server-Side Ad Insertion (SSAI) — System Design</h3><h3>Background</h3><p>Historically, advertising on digital platforms has been disruptive and often created a disjointed experience for viewers. With the rise of online streaming, there was a need for a method that could replicate the seamless transition of ads seen on traditional TV broadcasts. This led to the development of SSAI technology.</p><p>SSAI has its roots in the challenge of delivering targeted advertisements to a fragmented audience across multiple devices and platforms. As consumers began to consume video content through the internet on a multitude of devices, the one-size-fits-all approach of traditional broadcast advertising became less effective. Advertisers needed a way to reach viewers with personalized content that would resonate with them, rather than broad, untargeted ads.</p><p>With SSAI, the integration of ads into content is handled on the server side, where the ads are stitched into the video stream itself. This method bypasses many of the limitations associated with client-side ad insertion, such as device compatibility issues and ad blockers. The server-side process also allows for the video and ads to be encoded at the same quality, ensuring a consistent and high-quality viewing experience.</p><p>The technology has been embraced particularly for its ability to deliver ads during live streaming events and video-on-demand (VOD) content, where viewers expect a broadcast-like experience without buffering or delays. SSAI is designed to handle the high concurrency demands of such events, ensuring that even when millions of viewers are watching, each can receive a personalized ad experience without compromising the performance of the stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*XFlAeWGbtum21Cwuev5Prw.jpeg" /></figure><h3>SSAI vs CSAI</h3><p>Server-Side Ad Insertion (SSAI) and Client-Side Ad Insertion (CSAI) are two methods for integrating advertisements into digital video content. Understanding their differences is key for content providers and advertisers to choose the most effective approach for their needs.</p><p><strong>Server-Side Ad Insertion (SSAI)</strong>:</p><ul><li><strong>Seamless Experience</strong>: Ads are stitched directly into the content stream on the server, which can create a seamless and uninterrupted viewing experience that is similar to traditional broadcast television.</li><li><strong>Ad-Blocker Evasion</strong>: Since ads are embedded within the content stream, it is much harder for client-side ad blockers to detect and block them.</li><li><strong>Uniform Quality</strong>: The ad and the content are delivered in the same stream, which means that they can be encoded at the same bitrate and resolution, providing a consistent quality of experience.</li><li><strong>Device Compatibility</strong>: As the ads are part of the stream, SSAI is inherently compatible with all devices that can play the video content, without the need for device-specific ad SDKs.</li><li><strong>Scalability for Live Events</strong>: SSAI is particularly effective for live streams, as it allows for the simultaneous delivery of personalized ads to a massive number of viewers.</li><li><strong>Compliance and Privacy</strong>: SSAI can more easily comply with privacy regulations since ad decisioning and insertion happen on the server, minimizing the transmission of personal data.</li></ul><p>However, SSAI does have its drawbacks:</p><ul><li><strong>Complexity and Cost</strong>: Implementing SSAI requires more complex server-side infrastructure and can be more expensive than CSAI.</li><li><strong>Less Interactivity</strong>: Ads served through SSAI do not typically allow for interactivity like clickable ads due to the absence of client-side SDKs.</li><li><strong>Latency in Ad Decisioning</strong>: Personalization and ad decisioning can introduce a slight delay as the server stitches the ad into the stream.</li></ul><p>Client-Side Ad Insertion (CSAI):</p><ul><li><strong>Interactivity</strong>: CSAI allows for interactive ads, where viewers can click on an ad for more information or to be taken to a different site, which can increase engagement.</li><li><strong>Real-Time Decisioning</strong>: Ads are requested in real time by the client (viewer’s device), which can allow for more immediate targeting and personalization.</li><li><strong>Simplicity</strong>: CSAI can be simpler to implement, as it often involves integrating an SDK into the player on the client’s device.</li></ul><p>The challenges with CSAI include:</p><ul><li><strong>Fragmentation</strong>: Different devices and players may require different SDKs or ad formats, leading to fragmentation issues.</li><li><strong>Ad Blockers</strong>: CSAI is more susceptible to ad blocking software, as the separate ad requests are more easily detected and blocked.</li><li><strong>Viewer Experience</strong>: Ad insertion on the client side can cause buffering or a noticeable disruption between the content and the ad, leading to a less smooth viewing experience.</li><li><strong>Quality Mismatch</strong>: Ads may be delivered at a different quality than the content, causing noticeable changes in video quality.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLr_Ytdgbp4Qv5OBZ9LDLA.jpeg" /><figcaption>System Design of SSAI</figcaption></figure><p><strong>Content Delivery Network (CDN)</strong>: CDNs are the backbone of content distribution, ensuring that both content and ads reach the audience with high availability and performance. CDNs reduce latency by caching content at edge locations closer to the viewer, thereby ensuring a smooth playback experience.</p><p><strong>Digital Rights Management (DRM) Service</strong>: The DRM service ensures that only authorized users can access the content. It protects copyright and intellectual property by encrypting the content and managing the decryption keys in a secure manner.</p><p><strong>Personalized Service</strong>: This service uses algorithms and viewer data to select ads that are most likely to resonate with each individual viewer. Personalization can be based on demographics, viewing history, device type, and other relevant factors to increase engagement and ad effectiveness.</p><p><strong>Analytics</strong>: The analytics component tracks and analyzes data on how viewers interact with both the content and the ads. Metrics such as impressions, click-through rates, and engagement times are vital for understanding the performance of ads and for making data-driven decisions to optimize ad strategies.</p><p><strong>Metadata Service</strong>: Metadata services provide contextual information about the content and ads, such as genre, actors, mood, and other descriptors. This information can be used to enhance content discovery, recommendations, and to ensure that ads match the content contextually.</p><p><strong>Ad Decision Server (ADS)</strong>: The ADS is responsible for selecting which ads to serve to the viewer. It processes multiple factors, including viewer data, ad inventory, and advertiser requirements, to make real-time decisions about the most appropriate ads to insert.</p><p><strong>Ads Manager and Ad Stitcher</strong>: The Ads Manager oversees the inventory of ads and coordinates with the Ad Stitcher, which is responsible for seamlessly integrating ads into the content stream. The Ad Stitcher ensures that transitions between content and ads are smooth, maintaining a high-quality viewer experience.</p><p><strong>Ad Transcoder</strong>: The Ad Transcoder converts ads into the appropriate formats and resolutions for various devices and bandwidth conditions. This ensures that ads display correctly regardless of the viewing platform, from smartphones to smart TVs.</p><p><strong>Ads Tracker</strong>: An Ads Tracker monitors ad delivery and viewer interactions with the ads. It collects data that can be used for reporting, billing, and further analysis of viewer behavior and ad performance.</p><p>To provide a more detailed understanding of the flow of Server-Side Ad Insertion (SSAI), let’s enrich the main steps of the process:</p><ol><li><strong>Request for Content</strong></li></ol><p>When a viewer clicks on a video, the client application (such as a browser or mobile app) sends a request to the content provider’s service for the desired content. This initial handshake is crucial as it establishes the viewer’s session and carries information about the viewer’s device, location, and potentially their user profile.</p><p><strong>2. Content Delivery Service Interaction</strong></p><p>The content delivery service acts upon receiving the content request. If an ad break is scheduled or triggered (e.g., mid-roll in a VOD or scheduled intervals in a live stream), the service must determine if it’s time to insert an ad based on the content’s manifest file — a blueprint that dictates play order for video segments, including ads.</p><p><strong>3. Ad Break Decision and Personalization</strong></p><p>In the event of an ad break, the SSAI system engages several components:</p><ul><li>The DRM service is queried to ensure the content and ads are delivered securely.</li><li>Personalized service analyzes the viewer’s data to select the most relevant ads, enhancing the chance of ad engagement.</li><li>The Ad Decision Server (ADS) receives a request that includes viewer data, content metadata, and ad availability. It then selects the most appropriate ad(s) for the viewer.</li></ul><p><strong>4. Ad Retrieval and Transcoding</strong></p><p>The selected ads are retrieved from the ad library or ad network. If they are not in the correct format for the viewer’s device or current streaming quality, the ad transcoder re-encodes the ad to match the content stream, ensuring a seamless visual experience with no disparity in quality.</p><p><strong>5. Ad Stitching and Manifest Alteration</strong></p><p>The Ad Stitcher takes the transcoded ad and combines it with the main content stream on the fly, updating the manifest file to include the ad as if it were a natural part of the content. This updated manifest file now directs the player to the stitched stream that includes the ad content.</p><p><strong>6. Content and Ad Delivery</strong></p><p>The altered content stream, complete with the inserted ads, is then delivered to the viewer through the CDN. The viewer’s player reads the new manifest and plays the content with ads as a unified stream, often indistinguishable from the original content in terms of playback and quality.</p><p><strong>7. Analytics and Tracking</strong></p><p>Throughout the viewing session, the ads tracker and analytics components collect data on ad performance and viewer engagement. They monitor metrics such as whether the ad was watched in full, skipped (if allowed), or if it led to a viewer clicking through for more information.</p><p><strong>8. Post-View</strong></p><p>Analysis After content delivery, the data collected is analyzed for insights. This can drive decisions on future ad campaigns, improve content recommendations, and refine the SSAI process itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4540264d8f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>