Named case E-commerce & retail · Enterprise / listed · Cross-border home, outdoor and family goods · Ningbo, China
AOSOM

Real-time is not “a bit faster”

Three seconds between a click and the next recommendation, the next ranking, and the next risk decision.

≤3 s End-to-end latency
≥10/min Window refresh rate
≥100k/s Event write peak
Use case
Conversion + Insight
Products
Tengence Recommendation · Tengence Search
Industry
E-commerce & retail
Scale
Enterprise / listed
Region
Europe, North America · 12 storefronts · 9 languages
01 Data integration phase 2
02 Traffic growth GEO · content · AI visibility
03 Conversion phase 1-3
04 Insight phase 2-3

01Background & challenge

Why real time: three gaps that T+1 cannot close

Batch processing is not a legacy mistake. For years it was the right answer: one pass a day produced complete metrics, fed the dashboard, and retrained models overnight. For “how did yesterday go”, it still answers well.

The gaps appear when the business starts asking “how is it going now”.

Operations. On a promotion day, budget shifts, slot changes, and stock weighting all happen inside the day. A report from yesterday is a rear-view mirror. Discovering at noon that a placement lost conversion, learning at night why, and fixing it tomorrow means paying for the same problem three times.

Personalisation. In an offline pipeline, a customer’s afternoon clicks reach the model tomorrow morning. On a cross-border site a session often lasts minutes: three chairs viewed, one added to cart, one query typed. If those signals cannot influence the next page, they were collected for nothing.

Risk. Fraud, coupon abuse, and bulk order farming happen in the seconds before payment. Yesterday’s data can tell you that two hundred orders were anomalous. It cannot stop the one in front of you.

All three point to one thing: the freshness of data decides what the business is allowed to do. Not “faster is nicer” — without it, some things simply cannot be done.


02What we did

Seven stages: real time is a road, not a component

Many teams end up with several isolated real-time jobs: one for recommendations, one for dashboards, one for risk. Three latencies, three numbers, three on-call rotations. AOSOM runs one road with seven stages.

1. Collection at the edge. A first-party SDK on web and app captures clicks, impressions, dwell time, add-to-cart, checkout, payment. It writes to local storage when the network drops, retries, and batches events per request to keep connection overhead low.

2. Gateway. Validation (required fields, formats, time range), de-duplication (the same event ID counts once), rate limiting (a burst must not take the backend down), then forwarding.

3. Streaming bus. Events are split by type into separate channels; partitioning is by user so that one customer’s events stay strictly ordered; retention is short and fixed to keep storage bounded.

4. Stream processing. Five passes: ingest, clean, incremental computation, metric merge, write. Event-time windows with a tolerance for late arrivals, and a side output for anything later than the tolerance, handed to the offline layer for backfill.

5. Online feature store. A time-series wide table, pre-split to avoid hot spots, TTL-based expiry, low-latency point reads by key. Chosen for one reason: it must answer single-key lookups in milliseconds at tens of millions of keys.

6. Application layer. Three consumers: real-time reporting, real-time inference, real-time risk. Each carries a degradation path — when the real-time value is missing, fall back to the offline baseline rather than returning an error.

7. Observability. Collection success rate, gateway rejection rate, bus lag, backpressure, checkpoint duration, store read/write latency. The target is to locate a fault within ten minutes, not merely to recover from it.

Only all seven together count as real time. Three alone give you local speed and global inconsistency.


Seven stages of the on-site chain, from SDK to ranked result.
Seven stages of the on-site chain, from SDK to ranked result.

Collection: default to no loss, no duplicates, no disorder

Real-time pipelines rarely break in the compute layer. They break at the door.

No loss. SDK request failures rise during promotions. Local buffering, retry, and batched re-send, with a unique event ID per event, mean a re-send does not become a double count.

No duplicates. The gateway applies a short-window cache; the stream layer applies a second guard on state for the last ten minutes. Two layers are not redundancy: duplicates corrupt click-through and conversion rates, and those rates are the basis of every downstream decision.

No disorder. If “viewed A then added B” arrives reversed, the behaviour sequence becomes wrong and the recommendation reads the wrong intent. Partitioning by user keeps one customer’s events in one ordered lane.

Tolerance. Mobile networks jitter, time zones slip, client clocks drift. Windows are keyed on event time, thirty seconds of lateness is accepted, and anything beyond that is not dropped — it is routed to the offline path for backfill. A real-time pipeline may be late; it may not lose events.

One design detail is easy to miss: field position must be stable. Page type sits at the top level of the event, not inside a nested object; product ID lives at a fixed depth; campaign parameters come from the landing URL, not from the event payload. Pick the wrong level and metrics disappear silently — no error, just fewer rows, which is the hardest class of bug to find.


Stream processing: state, windows, and full-plus-incremental

The hard part here is not writing operators. It is answering three questions: where does state live, how wide is the window, and how does history attach.

Two kinds of feature, two triggers

Event-driven: the user’s recent click, cart, and purchase sequences; and per user–item timestamp sequences. Updated on every event, truncated first-in-first-out (the last hundred items by default), with timestamps kept so recency can be scored.

Window-driven: a product’s impressions, clicks, carts, and orders inside a rolling hour-level window. Aggregated on a configurable trigger, with request-ID de-duplication so one impression is not counted three times.

The difference is not technical. A behaviour sequence answers “what does he want now”. A window metric answers “how hot is this item now”. The first must be fast; the second must be steady.

How history attaches: full metrics inside state

A pure real-time pipeline has a structural flaw: no history at start-up. Right after go-live, or after a job restart, a product’s hourly exposure is empty and recommendations immediately degrade.

The fix is full-plus-incremental. Every night the offline layer loads complete metrics into stream state; the real-time layer only computes the increment, and the sum is the whole value.

There is a second benefit: fast rollback. If a real-time job fails, consumers still read yesterday’s complete value, so the business does not fall off a cliff; when the job recovers, the increment resumes from the last committed position instead of double-counting.

Consistency: exactly-once is a property, not a slogan

Two things must work together: offsets are not committed by the consumer but by the checkpoint, and writes are idempotent (same key, same value, same result).

These read like engineering hygiene. In practice they decide whether real-time data can be trusted. The moment real-time numbers are occasionally a little high, they can only be used for trend-watching — never for attribution, risk, or settlement.


Two cold starts: the two cases where real time actually earns its cost

Cold start is where “real time” stops being a performance story and becomes a commercial one.

5.1 New customers: treat the first three minutes as a profile

The problem is specific. Traffic bought through ads lands with no long-term preference and no behaviour history, so an offline model has nothing to score. On a cross-border site the session is short — often minutes — and waiting for tomorrow’s update is waiting forever.

The mechanism runs in three layers.

Explore in the first session. From the landing page, the first impressions on screen, the first click, and the first query, the system extracts category, brand, price band, and usage scene — indoor versus outdoor, pet versus baby, garden versus storage. No history required; only what is happening.

Aggregate into a session-level preference vector. These signals are combined and written into the online feature store, so every later request in the same session can read it.

Close the loop with recall and feedback. The preference vector drives category and brand recall, mixed with popular and new items for exploration. Impressions and clicks flow back immediately, and the loop converges in minutes rather than days.

The outcome, stated without inventing a number: a new customer is no longer processed as a featureless user. From the first session the recommendation can explain itself — “because you were looking at outdoor furniture” — and the ad spend that bought the visit is met with something relevant on the very first page, not on the second visit.

5.2 New products: let a new SKU earn its own data

The problem is symmetrical. A new SKU has no impressions, therefore no clicks, therefore no model score. Manual promotion works but does not scale, and it is not measurable.

The mechanism, as built:

Cold start as an attached scene, not a placement. It is not exposed as a standalone recommendation slot. It attaches to designated scenes as supplementary data, and whether a scene needs it is a configuration decision.

Candidates computed offline, in multiple channels. Category, price band, and attribute similarity generate candidates that are pushed into the online recall sources. This is what lets a product with zero behaviour still have neighbours.

Two chains in parallel. The main scene runs recall and ranking; the cold-start scene runs its own recall and ranking at the same time. The orchestration layer receives two ordered lists.

Exposure-filtered insertion at position three. After filtering already-seen items, the first cold-start candidate is inserted into the main list at a fixed position — the third slot. It is high enough to earn real exposure, and low enough that it never displaces the primary recommendation above the fold.

Incubation on real-time click-through. Impressions and clicks flow back through the same pipeline. Once a new SKU accumulates enough signal, it enters the normal ranking pool; the support window then closes automatically.

The outcome, again without a fabricated percentage: a new SKU stops sinking on the day it is listed. It receives stable exposure from day one, generates its own data, and graduates on merit. The support is time-boxed and rule-based, not a permanent reserved slot. This is the difference between an operational habit and a mechanism that converges by itself.


Dual cold-start: a cold list is ranked, filtered, then inserted at position 3 of the main result.
Dual cold-start: a cold list is ranked, filtered, then inserted at position 3 of the main result.

Real-time recall: what was just seen becomes what comes next

This is the most visible stage. A customer clicks an outdoor chair; the next page already contains its neighbours.

Three ingredients. A behaviour sequence per device across six action types — impression, click, cart, wishlist, share, purchase — truncated to the last hundred items and kept for seven days, with duplicates collapsed to the most recent occurrence. Multiple item-to-item neighbour lists: click co-occurrence, purchase co-occurrence, text-vector similarity, image-vector similarity, collaborative filtering, and a swing-weighted variant. And a time decay that is logarithmic rather than linear, so recency dominates without creating a cliff between one minute and two.

A new SKU has no behaviour, but it has a text vector and an image vector, so it can find neighbours on day one. That is precisely why new products can enter real-time recall at all.

The three combine into one score: similarity, multiplied by a base weight plus a recency weight scaled by the decay. The point is not to retrieve similar items. It is to order them by how much the customer still remembers.

Why this matters more on a cross-border site. A large share of AOSOM’s traffic arrives from ads as first-time visitors. They have no history, but they do have a present: what they clicked, how long they stayed, what they added. Real-time recall turns them from cold-start users into users with short-term behaviour. The answer to cold start is not waiting seven days; it is capturing the first three minutes.

Two engineering constraints follow. Impression de-duplication, so one session does not see the same item repeatedly. And per-scene, per-site configuration, because the mix on a homepage differs from a product page, and a European site differs from a North American one. All of it configurable, none of it hard-coded.

A real-time strategy without a switch is a bet, not an experiment. Every recall source can be enabled, disabled, and reweighted independently, and gradated by scene and site inside the experiment framework.


Real-time ranking: one “now” shared by search and recommendation

Recall decides the candidates; ranking decides the order. Here real time becomes a score.

User features. The recent behaviour sequences, per user–item timestamp sequences (how long ago he viewed this, how many times he carted it), and recent activity level. These tell the model what state the customer is in, not who he is.

Item features. Impressions, clicks, carts, and orders inside the hour-level window, plus the short-term heat and conversion propensity derived from them. A product listed two hours ago with a burst of clicks is a signal no historical score can match.

Context features. Page, slot, time of day, site, currency. The same item behaves differently at lunchtime in Germany and in the evening in the United States.

Search carries one more real-time responsibility: information completion. Price, stock, and promotion badges on the results page must come from live data, not from an index snapshot. In a multi-currency environment this matters more than any ranking trick — when the price on the results page disagrees with the product page, conversion simply disappears.


Real-time identity and tags: recognise the person first

Every capability above depends on one precondition: whether these behaviours belong to the same person.

Identity: merging within seconds

Unified identity is well understood offline and hard in real time, for three reasons.

New identifiers. A device, email, or phone number never seen before has no history. The system pre-allocates an identifier in the same canonical shape the offline process uses, so it is recognisable within the day, while long-term authority stays with the offline merge and version activation. Real time and offline therefore never invent two separate ID systems.

Merging. One device logging into two accounts — same person or not? One person on two devices? Identifiers are modelled as nodes and co-occurrence as edges; identifiers appearing together inside a thirty-second window on the same site are grouped, connected components are computed, and a single arbitration rule decides whether to merge, who prevails, and with what confidence. Strong identifiers — account, email, phone — decide directly. Weak identifiers — IP range, delivery address — must agree on several dimensions first.

Version and stability. The real-time path reads only the activated version of the official index plus the current day’s association table; once written, the next window can see it. The identity baseline must be versioned: each release is a version, historical data is recomputed against the version of its time, otherwise yesterday’s report will not match today’s.

One detail cannot be skipped: audit. Every allocation, merge, and deactivation is recorded and reconciled back into the warehouse at T+1. If identity is wrong, everything downstream — attribution, tags, risk — is wrong, so this layer must be traceable.

Deactivation must also be real time. When a customer closes an account, the current-day association table is flagged immediately, so a closed identity cannot continue to influence recommendation or risk.

Tags: short-term intent, not a permanent portrait

Offline tags answer “who this person is” — price sensitivity, lifecycle, recency-frequency-monetary. Real-time tags answer “what he wants in the next two days”.

They are computed from recent behaviour: categories viewed in the last seven days, items carted but not bought, brands revisited, the recent price band. They feed tag-based recall and ranking features, and they feed segmentation for operations.

The rule that matters: short-term tags must not pollute the long-term portrait. One abnormal promotion week should not permanently label a customer as price-sensitive. The two sets are stored and consumed separately — long-term in offline, short-term in real time.


Risk control: the second before payment

Risk is the stage that can least afford to be late. Its value is not in post-hoc reporting; it is in stopping something before the payment completes.

Four patterns. Multiple devices active for one identity within a short window. Multiple identities on one device — the signature of account takeover and account farming. Login frequency above threshold. And, before payment, rapid browsing across many unrelated products — the classic card-testing pattern.

None of these needs a sophisticated model. They need real-time identity plus a real-time behaviour sequence. Without unified identity, the first two cannot be computed at all: two accounts on one device are two different people in the old model.

Strong and weak links. Account, email, and phone are strong links with high confidence. IP range, delivery address, and name are weak and require several dimensions to agree. This stratification exists because risk needs a clear boundary: better to miss than to be wrong. Merging two real customers into one blocks legitimate orders, and that costs more than a few missed fraudulent ones.

Compute, do not judge. The pipeline computes metrics; the risk service makes decisions. The pipeline emits raw values — login count, device count, distinct products browsed — with definition tags attached. Whether to judge, block, or merely observe is a rule decision on the service side. The reason is practical: rules change often, definitions must stay stable. Mix the two and every rule change becomes a pipeline change.

One side effect worth naming. Risk also cleans the denominator: crawlers, machine traffic, and bulk order farming are removed from the traffic base. Every ratio above benefits. A dirty denominator inflates click-through, deflates conversion, and distorts attribution. Every rate is false if the base is false.


What real time costs

Real time is not free, and a case study that only lists benefits is not credible. Three bills come due.

Cost. Always-on stream capacity, online storage with replicas, and bus retention all cost money. AOSOM allocates by business value: real-time recall and real-time risk are mandatory; real-time reporting is on demand; historical detail stays offline. Not every dataset deserves real time.

Complexity. Two pipelines mean two sets of definitions. There is only one answer: one definition, two implementations, reconciled on a schedule. The same metric is compared daily between real-time and offline; a deviation beyond threshold raises an alert, and when they disagree, offline wins and the real-time job rolls back to the baseline.

Risk. When a real-time job computes wrongly, the error reaches recommendation, risk, and reporting immediately. So every path needs a one-action degradation: missing value falls back to baseline, an abnormal recall source is switched off, and a risk rule exceeding its false-positive ceiling drops into observation mode.

The maturity of a real-time system is not measured by how fast it runs, but by how gracefully it fails.


The series

This is one of five pages. The flagship page ties them together:
Making on-site conversion calculable — the whole loop, in one argument.

Definitions make it measurable, search makes it findable, recommendation makes it personal, and real time makes it current.

03Results

Results · 90 days

≤3 s End-to-end latency design target phase 3
≥10/min Window refresh rate design target phase 3
≥100k/s Event write peak design target phase 3

05How we measure

Results and definitions

≤3 s end-to-end, from behaviour to a queryable metric
Design target; window results refresh at least ten times per minute

100k events/s write peak
Collection, stream processing, and storage each scale horizontally

6 surfaces recall, ranking, metrics, identity, tags, risk
One pipeline, each consumer with its own switch and degradation path

7 days / hour-level / 30 seconds three time scales
Feature retention, window aggregation, disorder tolerance

Definitions

End-to-end latency is measured from event creation to the moment the corresponding metric can be queried, reported as P50 and P99. Write peak is the upper bound observed under load and production peaks, not a daily average. Window granularity, sequence length, and retention reflect current production configuration. Real-time and offline metrics are reconciled daily; when they diverge beyond threshold, offline prevails. Risk figures are counted on a pre-payment interception basis, with false positives measured on a manually reviewed sample.

Disclosure: the customer name and domain are taken from public information and the figures are the customer’s internal business metrics. No customer logo, internal system name, table structure, field definition, or employee information is disclosed. Capabilities described reflect this customer’s specific operating conditions and are not a commitment to other customers.

Disclosure note: client name and domain are taken from public information and figures are internal business metrics of the client. No client logo, internal system name, staff information or raw data is published; anonymous cases use descriptive naming only.

Your data is also spread across a few systems? We map the integration order and the SKU-level feasibility in 30 minutes.
Book a demo
Consult