# lambda-architecture

Published articles for lambda-architecture.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## High-Risk, High-Scale: Guaranteeing Ad Budget Precision at 1 Million Events/Second

DevFeed: [High-Risk, High-Scale: Guaranteeing Ad Budget Precision at 1 Million Events/Second](<https://devfeed.tech/articles/high-risk-high-scale-guaranteeing-ad-budget-precision-at-1-million-events-second-56666.md>)

Original publisher: [Read original article](<https://blog.flipkart.tech/high-risk-high-scale-guaranteeing-ad-budget-precision-at-1-million-events-second-cc23977796d7?source=rss----aea1f5a880a3---4>)

Author: Abhishek Bharti

Published: 2026-01-22T05:33:56Z

Content type: article

Language: en

Sources: [Flipkart Tech Blog](<https://devfeed.tech/sources/flipkart-tech-blog.md>)

Topics: [Event-Streaming](<https://devfeed.tech/topics/event-streaming.md>), [streaming data analytics](<https://devfeed.tech/topics/streaming-data-analytics.md>), [Distributed Systems & Parallel Computing](<https://devfeed.tech/topics/distributed-systems-parallel-computing.md>), [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>), [Data pipelines](<https://devfeed.tech/topics/data-pipelines.md>)

Tags: [actions](<https://devfeed.tech/tags/actions.md>), [ads](<https://devfeed.tech/tags/ads.md>), [adtech](<https://devfeed.tech/tags/adtech.md>), [aggregate](<https://devfeed.tech/tags/aggregate.md>), [all](<https://devfeed.tech/tags/all.md>), [apache-flink](<https://devfeed.tech/tags/apache-flink.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [availability](<https://devfeed.tech/tags/availability.md>), [based](<https://devfeed.tech/tags/based.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [budget](<https://devfeed.tech/tags/budget.md>), [campaign](<https://devfeed.tech/tags/campaign.md>), [challenges](<https://devfeed.tech/tags/challenges.md>), [charged](<https://devfeed.tech/tags/charged.md>), [classes](<https://devfeed.tech/tags/classes.md>), [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [events](<https://devfeed.tech/tags/events.md>), [lambda-architecture](<https://devfeed.tech/tags/lambda-architecture.md>), [precision](<https://devfeed.tech/tags/precision.md>), [risk](<https://devfeed.tech/tags/risk.md>), [scale](<https://devfeed.tech/tags/scale.md>), [stream-processing](<https://devfeed.tech/tags/stream-processing.md>)

### AI overview

Flipkart Ads describes an ad-spend pipeline designed for roughly one million events per second that balances rapid campaign enforcement with accurate final billing. The real-time Flink path uses at-least-once processing for availability, canonical event keys and RocksDB-backed state to suppress duplicates, and event-time watermarks to handle delayed mobile telemetry. It allows up to 60 minutes of event lateness; older events are dropped. Watermark progress also helps BCAP assess lag during outages. This speed layer captures most spend for near-real-time budget stops, while a separate batch layer is the authoritative settlement source, reconciling interaction events against immutable served-ad logs to remove duplicates and orphan events. The text frames this as a tradeoff: strict exactly-once processing in the hot path could increase latency and reduce availability, so final billing precision is deferred to reconciliation.

### Source excerpt

Flipkart serves thousands of sponsored ads across various pages and with search queries. Advertisers are charged based on the impression views or clicks generated by their campaign content. In the high-velocity domain of AdTech, the latency between an ad impression/click and a budget deduction represents a direct financial risk. If the system lags, advertisers overspend; if it blocks, revenue is lost. At Flipkart Ads, solving this required moving beyond standard stream processing to an eventual consistent, stateful architecture capable of sustaining millions of events per second. This blog post dissects how we architected our ads ingestion ecosystem, specifically focusing on leveraging event-time semantics, deduplication, and watermarking to guarantee precise budget control amidst massive throughput. The Lifecycle of an Ad: From Provisioning to Interaction The data lifecycle initiates when a user interacts with the served content on Flipkart's platform. The user's interaction with these campaigns closes the feedback loop. These placements generate high-velocity UI telemetry streams which our realtime pipeline must process and attribute against the advertiser's budget in real-time. We classify this telemetry into two primary event classes: Impressions (Billable Views): Emitted when a creative renders effectively within the user's viewport, satisfying our viewability standards. Engagements (High-Intent Actions): Triggered by direct user interactions, such as "Click" or "Add to Cart" events. The Challenges: Precision at Millions of RPS At Flipkart Ads, our pipeline manages an ingestion throughput of millions records per second (RPS). This stream represents the aggregate of all user activity and critical interactions across the platform. Our objective is to transform this raw, high-velocity firehose into precise, real-time campaign spend metrics. We are forced to navigate a critical trade-off between latency and availability, compounded by a non-negotiable constraint of

## Real-Time Counts with Stitch

DevFeed: [Real-Time Counts with Stitch](<https://devfeed.tech/articles/real-time-counts-with-stitch-2122.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//real-time-counts-with-stitch>)

Published: 2014-07-03T00:00:00Z

Content type: article

Language: en

Sources: [SoundCloud Backstage](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [streaming data analytics](<https://devfeed.tech/topics/streaming-data-analytics.md>), [Event-Streaming](<https://devfeed.tech/topics/event-streaming.md>), [locking](<https://devfeed.tech/topics/locking.md>), [Time Series](<https://devfeed.tech/topics/time-series.md>), [Web app](<https://devfeed.tech/topics/webapp.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [batch](<https://devfeed.tech/tags/batch.md>), [broker](<https://devfeed.tech/tags/broker.md>), [cassandra](<https://devfeed.tech/tags/cassandra.md>), [counts](<https://devfeed.tech/tags/counts.md>), [data](<https://devfeed.tech/tags/data.md>), [hadoop](<https://devfeed.tech/tags/hadoop.md>), [lambda-architecture](<https://devfeed.tech/tags/lambda-architecture.md>), [locking](<https://devfeed.tech/tags/locking.md>), [mapreduce](<https://devfeed.tech/tags/mapreduce.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [stitch](<https://devfeed.tech/tags/stitch.md>)

### AI overview

SoundCloud's Stitch serves track-play counts and timelines through an HTTP API backed by Cassandra. It can update counts in two ways: a stream processor increments counters for immediate results, while a Hadoop MapReduce job computes totals from event logs and bulk loads them for accurate but delayed results. Because increments are non-idempotent, replaying events can double-count. Stitch's first repair approach used a MapReduce job, The Restorator, to reconcile counters, coordinating locks with real-time processors through ZooKeeper; this worked but was complex and slow. Later, Stitch kept real-time and batch counts separate and updated them independently, leaving the web application to choose which count to return. The excerpt's simplest policy is to return batch counts when available.

### Source excerpt

Here at SoundCloud, in order to provide counts and a time series of counts in real time, we created something called Stitch. Stitch was...