Zilliz case study: How Cốc Cốc uses Milvus for search and advertising retrieval

Zilliz describes five Cốc Cốc production systems handling 700 million vectors. Hybrid retrieval records 32.1 ms P90 at about 67 backend requests/second with 60% application-cache hits. The 1.5-billion-vector figure is planned capacity; results depend on the stated setup.
Editor's verification (2026-11-24): This is a customer case study published by Zilliz. Its performance figures apply to the stated index, load, and cache configurations and have not been independently retested. The 99%–100% recall figures refer to nearest-neighbor retrieval, not answer accuracy or user search satisfaction. Neither RAG nor private deployment automatically guarantees factual accuracy or data security. Related Cốc Cốc engineering case study on Milvus (opens in a new tab) | Original Zilliz case study (opens in a new tab)
A leading Vietnamese search engine and browser provider with more than 600 million searches per month, Cốc Cốc is Vietnam's second-largest search engine and browser after Google. It has more than 30 million users in Vietnam, approximately one-third of the country's internet users.

Since 2023, Cốc Cốc has accelerated its AI efforts, launching AI chat and AI search, deeply integrating semantic understanding into the search experience, and extending these AI capabilities into its advertising business.
This transformation has also forced a complete upgrade of Cốc Cốc's underlying retrieval approach. Beyond traditional keyword matching, search in the AI era should use semantic understanding to retrieve relevant results accurately in milliseconds from content libraries with hundreds of millions of items.
Cốc Cốc ultimately chose Milvus as the core foundation for semantic retrieval, stably handling 700 million vectors across its five production systems.
01
Challenges
Deploying semantic retrieval in a search engine and advertising platform serving tens of millions of users requires tackling three major challenges simultaneously:
First, processing and querying hundreds of millions of vectors.
During its early exploration of solutions, Cốc Cốc tried FAISS and USearch in some smaller projects, where their performance was reasonably good.
However, both products are fundamentally indexing tools rather than complete database systems. They cannot support distributed deployments of hundreds of millions of vectors, or maintain retrieval availability during continuous data writes while meeting production requirements for stable 24/7 operation.
Second, supporting two retrieval paths: keywords and semantics.
New search terms and trending topics emerge every day—for example, a phone released that morning, breaking news from an hour earlier, or an idiomatic Vietnamese expression that has never appeared on existing webpages.
Traditional keyword retrieval only matches literal text. For these long-tail and entirely new queries, the retrieved results are often of little value, creating a need for hybrid retrieval supporting both keywords and semantics.
The challenge becomes greater in advertising recommendation systems. Ad matching requires dual retrieval paths connecting advertisers' precise keywords with users' fuzzy semantic inputs, while also meeting requirements for high concurrency and low latency.
Running both retrieval paths and combining them into a single ranked result is technically very difficult under these conditions.
Cốc Cốc also required the replacement solution to support private deployment on its own servers, ensuring that core search and advertising data remained within its infrastructure throughout.
02
The implementation
Cốc Cốc's core web search uses the mainstream "retrieve–rerank" architecture. Milvus sits at the very beginning of the business pipeline, handling the core candidate-retrieval stage. Specialized downstream models then filter and rerank the results further. The overall architecture is shown below:

With this architecture, the Milvus cluster supports five production systems simultaneously. Each system avoids having to build separate infrastructure but uses its own dedicated Collection, with different meanings for its vectors and different index configurations:
- Core web search—Uses semantic retrieval to find relevant results for previously unseen terms and long-tail queries.
- AI search and shopping ads—Uses semantic and hybrid retrieval to match user intent accurately with relevant advertisements.
- More search recommendations—Uses vector similarity to recommend follow-up queries closely related to the current context.
- Lookalike audience targeting—Vectorizes users' browsing histories to identify users with similar interests and support display advertising.
- Internal RAG chatbot—Uses Milvus as the retrieval layer so that model responses are grounded in Cốc Cốc's internal documents, providing a retrieval basis for answers without guaranteeing their factual accuracy.
Across these five systems, vectors represent different entities: webpages, search queries, advertisements, user profiles, or text passages.
Most vectors are generated by a dual-encoder model the team fine-tuned from PhoBERT. Cốc Cốc's local team optimizes it specifically for Vietnamese understanding, and this localization capability is one reason the company has established itself in its domestic market.
To meet production latency and memory requirements, Cốc Cốc also optimized the model to make it lighter, reducing production vectors to 128 dimensions without a noticeable decline in retrieval quality. Lower dimensions mean less memory per vector and faster distance calculations, helping control per-node memory overhead at a scale of hundreds of millions of vectors and giving the team a compact, high-quality vector foundation.
03
Why Cốc Cốc chose Milvus
Before formally deploying Milvus, Cốc Cốc completed a proof of concept using approximately 30 million query vectors in Milvus. The results far exceeded the team's expectations, and Milvus subsequently became its official vector database.
As deployments expanded and the business continued to grow, Cốc Cốc discovered further advantages of Milvus:
Advantage 1: Stable latency despite exponential data growth.
This was a core requirement in selecting the solution. From 30 million vectors in the proof of concept to 700 million in production, Milvus's vector retrieval speed remained stable.
When Cốc Cốc first switched all production traffic to hybrid retrieval, peak load was approximately 166 requests per second, and hybrid retrieval P90 latency reached approximately 120 milliseconds, exceeding the production target.
The team then added an application-level TTL cache with a 24-hour lifetime in front of the retrieval layer. With approximately a 60% cache hit rate, Milvus's actual peak load fell to approximately 67 requests per second, bringing latency back within production requirements.
Cốc Cốc's dataset is not static: inserts, updates, index building, and compaction all take place on a running system. Milvus handles these operations as background tasks, so the dataset remains searchable during writes and index rebuilding.
To keep latency within targets and predictably stable, the Cốc Cốc team also scheduled background tasks in the low-traffic window from 2 a.m. to 4 a.m., avoiding competition for resources between maintenance operations and user traffic.
Advantage 2: Private deployment with full control over data and infrastructure.
Milvus is fully open-source and can be deployed directly in Cốc Cốc's own data centers, keeping user data within its infrastructure. The team controls deployment topology, index configuration, resource allocation, and upgrade schedules. This helps it control data-deployment boundaries and business configuration, while data security still depends on actual permissions and operational measures.
Advantage 3: Native hybrid retrieval without building a second system.
Ad matching must match advertisements using both precise keywords and user intent. The conventional approach is to build a keyword-retrieval cluster and a vector database, then combine their results in application code. Milvus removes this architectural split: its built-in BM25 algorithm generates sparse vectors, allowing dense-vector approximate nearest-neighbor retrieval and sparse-vector retrieval to be combined in a single query. Cốc Cốc's ad engine therefore needs only one database and one operational interface for both lexical and semantic retrieval. This saves the cost of a separate keyword-retrieval cluster and avoids complex result-combination logic in application code.
Milvus then uses its built-in WeightedRanker operator to combine the two result sets with weights configured by Cốc Cốc: 0.6 for dense vectors and 0.4 for sparse vectors, slightly favoring semantic understanding while retaining the commercial importance of precise keyword matching. This configuration improves ad-retrieval quality. The dense-vector side covers expressions of user intent that advertisers did not specify, while the sparse-vector side preserves commercially valuable exact-match scenarios. If the balance needs adjusting later, a parameter can be changed without reworking the architecture.
Advantage 4: A broad index toolbox for choosing the best solution for each business need.
Cốc Cốc's businesses have different requirements. Online search seeks the lowest latency with high recall, while offline batch processing requires exact results and is less sensitive to runtime. One Milvus cluster supports HNSW, the IVF family, FLAT, and other indexes, allowing the team to choose for each scenario. For online services, the team compared IVF-SQ8, IVF-PQ, and HNSW on recall, index size, and performance, ultimately selecting HNSW for its best recall and lower latency, albeit at higher cost. For offline batch jobs such as daily inference and data processing, it uses FLAT for exact nearest-neighbor search with 100% recall, ensuring downstream processing is based on exact results.
Advantage 5: Low deployment, operational, and learning costs.
Milvus is straightforward to deploy, manage, and scale in production, reducing the engineering team's operational burden. Milvus Distributed has a modular architecture, with detailed monitoring dashboards for each component, letting the team pinpoint bottlenecks and scale hardware accordingly. Comprehensive, clear official documentation also accelerated initial deployment and simplified integration with Cốc Cốc's existing systems.
04
Results and benefits
- 700 million vectors in production, with planned capacity of 1.5 billion. Cốc Cốc's current deployments handle approximately 700 million vectors across multiple production use cases. The infrastructure is designed to scale smoothly beyond one billion, with total planned capacity of approximately 1.5 billion vectors, without redesigning the retrieval-layer architecture.
- 19.8-millisecond P90 semantic retrieval latency at peak load. At peak traffic of 34 requests per second, standard semantic retrieval records P50 latency of 11.1 milliseconds, P90 of 19.8 milliseconds, P95 of 26.7 milliseconds, and P99 of 88.3 milliseconds.
- Hybrid retrieval P90 falls to 32.1 milliseconds, allowing a retrieval-quality upgrade previously held back by latency to launch. At peak traffic of 166 requests per second, with a 60% cache hit rate reducing actual backend traffic to approximately 67 requests per second, hybrid retrieval records P50 latency of 17.1 milliseconds, P90 of 32.1 milliseconds, P95 of 41.6 milliseconds, and P99 of 126 milliseconds.
- 99%–100% online recall and 100% offline recall. Among the tested indexes, HNSW provides near-exhaustive recall at the lowest latency for user-facing services. FLAT provides exact nearest-neighbor results for offline pipelines, ensuring batch outputs are based on exact rather than approximate results.
- 30% of search requests are answered through Milvus-powered semantic retrieval. AI search coverage has increased from 63% to 92%, with better retrieval results than keyword-only search.
Closing thoughts
From a proof of concept to serving tens of millions of users, the Cốc Cốc team also offers other Milvus users some practical advice:
- During the proof-of-concept stage, start with a few million vectors, such as three months of data. Connect a small service to real production traffic, get it working, and gradually expand to one or two years of data. Monitor CPU and memory utilization continuously during expansion and configure hardware according to actual observations.
- In production, do not simply use default settings across the board. Evaluate different index types and different configurations within each type, then load-test P50, P90, and P95 latency. The optimal online and offline configurations will usually differ.
- Provide dedicated server nodes for the vector database. Sharing infrastructure with other services creates operational problems that become more serious as scale increases.
This article is from "Zilliz," by "Zilliz."
Related topics
After reading
Join the AINRK community
Read how to join the community and connect with people working in AI.




