Tutorial

How to Design Saved Searches and Alerts for Fast-Changing Inventory

Design saved searches and alerts for fast-changing marketplace inventory: choose a search model, batch notifications, prevent duplicates, measure relevance.

To design saved searches and alerts for a marketplace with fast-changing inventory, store each search as structured filters plus a fixed sort order, evaluate new or changed listings against those filters within seconds, and send batched alerts with frequency caps and clear unsubscribe controls. A saved search is a stored set of filters that a buyer can reuse and attach to notifications. An alert is a notification triggered when a listing matches a saved search; treat listing accuracy and duplicate control as core product requirements, not add-ons.

What makes alerts hard when inventory changes quickly?

Fast-changing inventory makes alerts hard because listings appear, sell, and change price within minutes, so an alert system must decide what counts as new, how often to notify, and how to avoid sending stale or duplicate results.

A state change is a shift in a listing's status, price, or availability. Most marketplace teams underestimate how many meaningful state changes occur. A listing event is a record that a listing was created, updated, or removed. Price drops and sold markers matter as much as new listings, and each event can trigger a different buyer expectation. In a busy category, roughly 20% to 40% of active listings may change price or status within a single hour.

An alert system that only checks new listings will miss price drops, back-in-stock events, and sold markers. Buyers read those events as inventory signals, and stale alerts erode trust faster than missed alerts. A one-minute polling delay, where polling means checking listings on a schedule, can produce stale results for roughly 5% to 15% of sold items in high-velocity categories.

Duplicate suppression is the process of recognizing that two events or two listings refer to the same item. A deduplication key is a short identifier that lets the system recognize repeat events for the same listing and search. A listing version is a number that increases each time the listing changes. Use one key per listing version and search, and store it before any message leaves the system.

Which search model should you use: filter-only, scored, or hybrid?

A filter-only model returns exact matches, a scored model ranks matches by relevance, and a hybrid model applies exclusion rules first, then ranks what remains. Most marketplaces should start hybrid because it preserves exact matching while allowing useful ranking.

The model you choose controls match accuracy, response time, and how much buyers trust the alert. A hard filter is a rule that excludes any listing that fails it, such as a price ceiling or a required location. A relevance score is a number that estimates how well a listing matches a buyer's intent. A search index is a data structure built for fast filtering and ranking, and it is usually separate from the transactional database that stores orders and payments.

ModelMatch logicRanking qualityTypical response time at 100k active listingsEngineering effortBest fit
Filter-onlyHard filters onlyLow to mediumUnder 100 msLowNarrow searches with exact constraints
ScoredWeighted relevance across fieldsHighRoughly 200 to 500 msMedium to highBroad discovery where buyers tolerate some noise
HybridHard filters, then relevance scoreHighRoughly 100 to 300 msMediumMost marketplaces with fast-changing inventory

Use this checklist to choose:

  1. Count how many filters buyers need. If most searches use three or more hard constraints, start filter-first.
  2. Measure acceptable response time. Alerts can tolerate a few seconds, but on-page search usually needs a response under roughly 500 ms.
  3. Sample 50 to 100 real searches and check whether the top 20 results look relevant. If not, add scoring.
  4. Budget for keeping the search index current. A search index needs updates as listings change, typically within one to five minutes for alert use cases.

How often should a marketplace send saved search alerts?

Send alerts in short batches rather than one message per listing: typically within one to five minutes for high-velocity inventory, and hourly or daily for slower categories. Let buyers choose cadence, but cap frequency by default.

A digest is a single message that groups multiple matching listings. Batching protects attention and reduces infrastructure load. A rate limit is a cap on how many messages a user receives in a period. Quiet hours are periods when non-urgent alerts are held, for example overnight in the buyer's time zone.

Set defaults by category velocity. High-velocity categories can justify a five-minute digest when the expected match volume is low, but a one-minute digest becomes noise if it contains one item. A common pattern is to send immediately for a first match, then batch subsequent matches into a digest every 15 to 60 minutes. A default digest of 10 to 20 listings can cut message volume by roughly 60% to 80% compared with one message per listing.

Give buyers a preview. Show the last 10 to 20 matches and an estimated weekly alert count before they save. If the estimate is above roughly 50 messages per week, suggest tighter filters or a daily digest.

What data model keeps saved searches and alerts consistent?

A reliable model separates the search definition, matching events, and delivery log so each part scales and fails independently. Store filters as structured fields, keep a log of listing changes, and record every send with a deduplication key.

An append-only event stream is a log where new records are added and old records are never edited. A worker is a background process that handles jobs outside the buyer's request, and a matcher is the worker that applies filters and scores listings against saved searches. A transaction is a group of database writes that either all succeed or all fail, and a unique key is a database rule that rejects duplicate combinations.

Use four tables or similar records:

  1. saved_search: buyer_id, filters, sort_order, cadence, channel, quiet_hours, last_seen_at.
  2. search_match: search_id, listing_id, listing_version, score, first_seen_at, status.
  3. listing_event: event_id, listing_id, event_type, changed_fields, occurred_at.
  4. alert_delivery: delivery_id, search_id, listing_id, listing_version, channel, queued_at, sent_at, dedupe_key.

Keep matching separate from delivery. The matcher writes candidate matches, and the delivery worker rechecks listing status before sending. A unique key on search_id, listing_id, and listing_version prevents the same match from being sent twice. For a broader view of how these components fit with listings, orders, and payments, see marketplace development.

Prevent duplicate and stale alerts at delivery time

The hardest bug in alerting is the gap between matching and sending. A listing can sell after it matched but before the message goes out. The outbox pattern is a design where outgoing messages are stored in a database table before delivery. It helps because the candidate alert and the pending message are written in one transaction.

An idempotent send is one that can run twice without producing two messages, so make delivery idempotent. Record sent_at before calling the email or push provider, and use the provider's message id to check whether the send succeeded. If the provider call fails, retry with the same deduplication key.

Freshness is how recently a listing was confirmed available. Recheck freshness at send time. If the listing sold, expired, or changed price beyond the buyer's filter, drop the alert and update the match status. For high-velocity categories, a freshness window of two to five minutes is a reasonable starting point, but measure how often buyers open an alert and find a sold item.

Give buyers controls that match the promise

A saved search is a preference contract, so the settings page should expose every rule that can change alert volume.

  • Include and exclude filters, such as category, price range, location, condition, and seller rating.
  • Sort order and a relevance threshold, where the threshold is the minimum score a listing must reach to trigger an alert.
  • Alert cadence, channel, quiet hours, and a pause control.
  • Digest size and whether to send the first match immediately.
  • A preview count and sample alert.

Defaults should protect attention. Start with a daily digest for broad searches and a 15-minute digest for narrow searches. Require an explicit opt-in for SMS, and make unsubscribe a one-click action from every channel.

Measure alert quality with a small scorecard

Alert quality is not the same as open rate. A message can be opened because the subject line is strong and still be a poor match. Track precision, which is the share of alerts that match buyer intent, along with sold-before-open rate, unsubscribe rate, and the share of saved searches that remain active after 30 days.

A simple weekly review

Use a weekly sample. Pull 50 to 100 alerts, label them as relevant or not, and compare the score with buyer actions. If precision falls below roughly 80%, tighten hard filters or raise the relevance threshold. If unsubscribe rises above roughly 2% per month, reduce default frequency before changing ranking.

Watch for silent failure. A search that produces zero alerts for 14 days may be too narrow, or the matcher may be broken. Send the buyer a gentle prompt to review filters, and alert the operations team when match volume drops by more than roughly 50% week over week for a category.

Frequently asked questions

How do saved searches work on a marketplace?

A saved search stores a buyer's filters, sort order, and alert preferences so the marketplace can re-run the search when inventory changes. The system matches new or updated listings against those rules and sends a notification only when a listing passes the filters and relevance threshold.

How often should marketplace alerts be sent?

Use short batches for high-velocity categories, typically every one to five minutes, and hourly or daily digests for slower categories. Let buyers choose the cadence, but set a default that protects attention and cap the maximum frequency.

How do you prevent duplicate alerts for the same listing?

Assign each listing event a deduplication key and record every send before delivery so a retry cannot produce a second message. Recheck the listing at send time and drop the alert if it sold, expired, or no longer matches the buyer's filters.

What search model is best for fast-changing inventory?

A hybrid model usually works best because it applies hard filters first and then ranks the remaining listings by relevance. That keeps exact constraints such as price and location reliable while still ordering broad results in a useful way.

Back to blog