← All IntelClip / Developer ToolsPostmortem: regex search collapsed as the dataset grew, Atlas Search replaced it
From Serving 2 Million Models Without Melting: Scaling the Hugging Face Hub — Arek Borucki, Hugging Face · ≈10:05
A concrete migration story — $regex over an array plus a five-minute trending-score sort worked until it didn't, and the Lucene-backed $search operator fixed the latency without changing the query API.
What’s in it
- A concrete migration story — $regex over an array plus a five-minute trending-score sort worked until it didn't, and the Lucene-backed $search operator fixed the latency without changing the query API.
Clip transcript
have metal lama 3.1 metal lama etc. Next there must be a query. In the past we were using classical MongoDB find method on models collection with reax operator and this reax operator we're searching in search tokens arrays models which are equal to llama and then we were s sorting results by trending score which is calculated every five minutes. This is number of downloads and number of likes is as far as I remember from the last seven days. This solution was working well as long as data set was small. Reax doesn't scale well. So when our data set started to grow very quickly, we started to having problems with latency. So we decided to switch to Atlas search that's a feature which is using Apache lucine under the hood. So MongoDB doesn't provide in core MongoDB server full text search there is additional process MongoD uh this MongoDBT process is a wrapper around Apache lucine for end user users this is transparent you are just using Unifi MongoDB query API and when You use aggregation pip pipeline together with dollar search operator. MongoDB will know that you would like to search Apache Lucin index. Obviously you need to put the name of this index which is in this scenario model search autocomplete model equal to llama path search tokens and we still sort results by trending score and this solution is much more efficient and is so far scale Well, so we don't have any more latency issues in our search bar.
Comments
Sign in to comment.
Loading comments…