DSA Developer
Available
Advanced ~6h

Search Redesign

Replace a slow LIKE-based search with something users won't dread.

The situation

Product search p95 latency is 1.8 seconds. The team wants sub-300ms with better ranking, without standing up new infrastructure this quarter.

Context

  • Current implementation uses ILIKE across three columns.
  • Catalog has 1.2M products and grows ~3% monthly.
  • The platform team has rejected adding Elasticsearch this quarter.

Your objectives

  • Bring p95 search latency under 300ms.
  • Improve top-3 result relevance on a benchmark set.
  • Stay within existing Postgres + Redis infrastructure.

Phases

  1. Profile the current path

    Find where the time goes.

  2. Prototype trigram + ranking

    Postgres pg_trgm + scoring.

  3. Cache hot queries

    Redis layer with invalidation plan.

  4. Write the design doc

    Trade-offs, rollout, metrics.

Tasks

  • Profile current ILIKE query path
    Day 1
  • Prototype pg_trgm + GIN index
    Day 2
  • Tune ranking on benchmark set
    Day 3
  • Add Redis hot-query cache layer
    Day 4
  • Write design doc + rollout plan
    Day 5
  • Review with platform team
    Day 6

Inbox for this scenario

Open inbox
SI

Sara Iyer · Product Manager

Monday

Search is killing conversion

Funnel data is clear — abandonment spikes the moment search takes longer than ~1s. We need a fix.

High
NK

Neel Krishna · Tech Lead

Monday

Constraints recap

Postgres + Redis only this quarter. Keep the design doc focused on what we can ship, not what we wish we had.

FYI
VJ

Vikram Joshi · Platform Engineer

Tuesday

Index bloat warning

Heads up — pg_trgm GIN indexes get fat fast on a 1.2M catalog. Plan for VACUUM cadence in your rollout.

FYI

Success criteria

  • Benchmark shows ≥6x latency improvement.
  • Relevance score improves on the 200-query eval set.
  • Design doc reviewed by the platform team.

Stakeholders

  • NK

    Neel Krishna

    Tech Lead

    supportive
  • SI

    Sara Iyer

    Product Manager

    neutral

Deliverables

  • Benchmark report

    pending

    Before/after latency + relevance.

  • Design doc

    pending

    Approach, trade-offs, rollout plan.

  • Prototype PR

    pending

    Reviewed, gated behind a flag.

Competencies assessed

  • Algorithm DesignWeight 30%
  • Performance TuningWeight 30%
  • Technical CommunicationWeight 25%
  • Trade-off AnalysisWeight 15%

Tools

Code WorkbenchProfilerTest Runner