Migrating from Elasticsearch to Vespa for Large-Scale Search Platform

vinted · E-commerce · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Large-scale marketplace search infrastructure

Vinted needed to replace an Elasticsearch search platform that had become difficult to scale, tune, and reindex while serving roughly one billion active searchable items with low latency and relevance-sensitive ranking.

Constraints:

Architecture

Vinted migrated item search from six Elasticsearch clusters to one Vespa deployment with 60 content nodes, 3 config nodes, 12 container nodes, HAProxy routing, and a Golang gateway exposing a stable search contract. The indexing path uses Apache Flink plus Vespa Kafka Connect to feed Vespa in real time. Querying uses custom Vespa searchers that construct YQL behind the gateway contract, while Vespa combines lexical, vector, and structured retrieval with integrated machine-learned inference. The migration used shadow traffic, amplified traffic tests, A/B relevance iterations, inactive-region testing, Prometheus metrics, and stress tests before fully switching traffic.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Apps["Product search applications"] --> Gateway["Golang search gateway"]
  Gateway --> Searchers["Custom Vespa searchers"]
  Searchers --> Vespa["Vespa deployment"]
  SIP["Search indexing pipeline"] --> Vespa
  HAProxy["HAProxy load balancer"] --> Vespa
  Gateway --> Shadow["Shadow traffic path"]
  Shadow --> Vespa
  Vespa --> Metrics["Prometheus metrics"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Product search applications Marketplace product surfaces that issue item-search requests. Golang search gateway
Golang search gateway Middleware service exposing the flat search contract and insulating product clients from the search engine migration. Product search applications, Custom Vespa searchers, Shadow traffic path
Custom Vespa searchers Vespa search components that implement query logic and construct YQL calls. Golang search gateway, Vespa deployment
Vespa deployment Single search deployment with content, config, and container nodes supporting lexical, vector, structured search, and ML inference. Custom Vespa searchers, HAProxy load balancer, Search indexing pipeline, Prometheus metrics
Search indexing pipeline Apache Flink and Vespa Kafka Connect feed path that updates Vespa in real time. Vespa deployment
HAProxy load balancer Routes production traffic to stateless Vespa container nodes. Vespa deployment
Shadow traffic path Migration safety path that mirrored and amplified traffic from Elasticsearch-era serving to Vespa before cutover. Golang search gateway, Vespa deployment
Prometheus metrics Observability surface for query latency, indexing throughput, and bottlenecks. Vespa deployment

Data flow

Product applications send search requests to a Golang gateway using a flat search contract. The gateway calls Vespa custom searchers, which construct YQL for a single Vespa deployment. In parallel, Apache Flink feeds item updates through Vespa Kafka Connect so the index stays near real time. HAProxy routes production traffic to stateless Vespa container nodes, and Prometheus metrics plus inactive-region tests monitor performance before and after rollout.

3 supporting quotes
“This middleware Go service acts as a gateway, accepting search requests in a predefined flat contract that we call a search contract.”article, stated
“These custom searchers eventually construct YQL to call Vespa.”article, stated
“We’ve adopted Vespa’s document schema in our Search Indexing Pipeline (SIP), built on top of Apache Flink.”article, stated

Why this architecture

Vespa let Vinted consolidate search into one horizontally scalable deployment while combining lexical search, vector search, structured queries, and real-time machine-learned inference. The search-contract gateway and shadow traffic path made the engine migration safer, while Flink-based real-time feeding directly reduced feature lead time by shrinking indexing latency.

3 supporting quotes
“Vespa supports vector search, lexical search, and searching within structured data, all in the same query.”article, stated
“The search contract was one of the key elements that allowed us to change the search engine seamlessly.”article, stated
“Indexing latency directly affects the lead time of feature development and the pace of search performance experimentation.”article, stated

Models used: Vespa integrated machine-learned model inference · vector search embeddings · ranking algorithms

Scale

Alternatives considered (roads not taken)

Keep Elasticsearch as the long-term search platform

Rejected because: Elasticsearch had become hard to scale, tune, and reindex as data and query complexity grew.

“Eventually, we started to hit the limits of what Elasticsearch could handle, so we set out to find a new, long-term, and scalable solution.”article, stated
“managing shard and replica configurations – especially during re-indexing processes when fields changed – was time-consuming and error-prone.”article, stated

Adopt a solely vector or hybrid-search database

Rejected because: Vinted concluded that Vespa's breadth across vector, lexical, structured search, and ML inference better fit their scale and complexity.

“As such, we did not consider other solely vector or hybrid search databases to be an alternative.”article, stated
“Our extensive research has found that Vespa is the ideal solution for handling the scale and complexity of our data.”article, stated

Cut over without shadow traffic and relevance A/B iterations

Rejected because: The team first mirrored, amplified, and A/B-tested traffic until performance and relevance were acceptable.

“Initially, incoming query traffic was served by Elasticsearch and shadowed to the Vespa item search.”article, stated
“To port the main search items query, it took about four A/B test iterations until the relevance of the results was satisfactory.”article, stated

Patterns

hybrid-search (retrieval)

Vinted chose Vespa partly because it could combine lexical search, vector search, and structured data queries in one request.

“Vespa supports vector search, lexical search, and searching within structured data, all in the same query.”article, stated

retrieval-ranking (retrieval)

The migration increased ranking depth and used Vespa ranking configurations to improve search relevance.

“We’ve also increased our ranking depth by more than 3 times, up to 200,000 candidate items.”article, stated
“VAP deployment encapsulates the entire application model into a single package, including schema definitions, ranking configurations, and content node specifications.”article, stated

canary-rollout (deployment)

The migration used shadow traffic, amplified traffic, inactive-region testing, and A/B iterations before fully switching traffic.

“We were able to amplify traffic from the Go service to Vespa by a fractional amount and have tested traffic by up to 3x.”article, stated
“testing infrastructural or query workload changes in inactive regions.”article, stated

eval-driven-development (evaluation)

Vinted used peak traffic simulation, stress tests, A/B relevance tests, and accuracy validation to tune the Vespa deployment.

“This testing involved simulating peak traffic loads, stress testing the indexing pipeline, and validating the accuracy and relevance of search results under various conditions.”article, stated

observability-tracing (operations)

Prometheus metrics from Vespa were used to monitor latency, indexing throughput, and bottlenecks before user impact.

“Vespa’s built-in Prometheus metrics system offers detailed insights into every aspect of the search process, from query latency to indexing throughput.”article, stated

latency-optimization (performance)

The platform focused on lower query latency, lower indexing latency, and faster item visibility through Vespa's architecture and real-time indexing.

“Search latency has improved by 2.5x and indexing latency by 3x.”article, stated
“The time it takes for a change to be visible in search has dropped from 300 seconds (Elasticsearch’s refresh interval) to just 5 seconds.”article, stated

Tradeoffs

Consolidate item search into one Vespa deployment

Chose One Vespa deployment with content, config, and container nodes over Multiple Elasticsearch clusters with many data and client nodes.

Rationale: The consolidated Vespa topology reduced server count, improved consistency, removed hot-node issues, and simplified scaling.

“Today, for our item search, we’ve moved to 1 Vespa deployment (cluster) with 60 content nodes, 3 config nodes and 12 container nodes.”article, stated
“The consistency of search results has improved since we’re now using just one deployment (or cluster, in Vespa terms) to handle all traffic.”article, stated

Use Vespa's integrated search and ML platform

Chose Vespa as a unified lexical, vector, structured, and ML-inference search platform over A narrower vector-only or hybrid-search database.

Rationale: Vinted needed one platform that handled scale, query complexity, and real-time ML inference rather than a specialized retrieval store.

“Plus, the integrated machine-learned model inference allows us to apply AI to make sense of our data in real-time.”article, stated
“we did not consider other solely vector or hybrid search databases to be an alternative.”article, stated

Preserve language analysis through upstream Lucene integration

Chose Contribute Lucene text analysis components to Vespa over Losing Elasticsearch language analyzers during migration.

Rationale: The team retained existing language-analysis capabilities while moving to Vespa's scalability and performance model.

“we retained the language analysers and capabilities while benefiting from Vespa’s superior scalability and performance.”article, stated
“One of the major innovations we have contributed to open source is Vespa’s ability to integrate with Lucene text analysis components”article, stated

Gotchas (what bit them)

Search-engine migration is also a client-interface migration unless clients are insulated.

Root cause: Product applications depended on search behavior while the backend engine changed from Elasticsearch to Vespa.

Resolution: A Golang gateway exposed a predefined search contract so clients did not need to track Vespa internals.

“This middleware Go service acts as a gateway, accepting search requests in a predefined flat contract that we call a search contract.”article, stated
“The search contract was one of the key elements that allowed us to change the search engine seamlessly.”article, stated

Fast query serving is not enough if indexing latency slows experimentation.

Root cause: Feature-development lead time depends on how quickly search-index changes become visible.

Resolution: Vinted fed Vespa from Apache Flink in real time and reduced visibility time from 300 seconds to about 5 seconds.

“In modern Search systems, one of the crucial requirements is how fast you can make a change in a system.”article, stated
“Indexing latency directly affects the lead time of feature development and the pace of search performance experimentation.”article, stated

Elasticsearch shard and replica management became a source of operational toil.

Root cause: Reindexing and field changes required complex shard rebalancing, alias switches, and index recreation.

Resolution: Vespa's distributed architecture manages partitioning and replication across content nodes while continuing to serve queries.

“Vespa simplifies this with a distributed architecture that automatically manages data partitioning and replication across content nodes.”article, stated
“eliminating the need for complex shard rebalancing, alias switches, and recreating indices when fields change”article, stated

Evaluation

Vinted validated Vespa through shadow traffic, amplified traffic, A/B relevance iterations, peak-load simulation, indexing stress tests, inactive-region testing, and Vespa Prometheus monitoring.

Metrics: 20,000 requests per second under 150 ms p99 · 10,300 RPS daily feeding rate · 4.64 seconds p99 item update latency · traffic amplification up to 3x · four A/B test iterations for main search relevance · query latency and indexing throughput

3 supporting quotes
“We were able to amplify traffic from the Go service to Vespa by a fractional amount and have tested traffic by up to 3x.”article, stated
“To port the main search items query, it took about four A/B test iterations until the relevance of the results was satisfactory.”article, stated
“The metrics we gathered during these tests were instrumental in fine-tuning our Vespa deployment.”article, stated

Outcomes

The article reports about 1 billion active searchable items, about 20,000 RPS under 150 ms at p99, 10,300 RPS real-time feeding, 4.64-second p99 item update latency, and 21 Vespa deployments.

3 supporting quotes
“We managed to cut the number of servers we use in half (down to 60).”article, stated
“Search latency has improved by 2.5x and indexing latency by 3x.”article, stated
“Today, we have 21 unique Vespa deployments across a diverse range of use cases, from item search and image retrieval to search suggestions”article, stated