#community-help

Typesense RAM Limitation and Memory-Mapped Files

TLDR TJ asked if Typesense would move to a model using memory-mapped files for datasets. Kishore Nallan said they have no concrete plans but appreciated the idea and would consider community feedback.

Powered by Struct AI
4
9mo
Solved
Join the chat
Mar 11, 2023 (9 months ago)
TJ
Photo of md5-3afef4cc9e9291f4f991a88147c78384
TJ
11:42 AM
Hi team, quick question: does Typesense plan to one day move to a model where the entire dataset does not have to fit in RAM? Maybe using the disk with memory-mapped files (like Meillisearch)? I find the current model to be a limitation, especially given the cost of RAM, and I'm wondering if there's a future where that won't always be the case
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:51 AM
We don't have concrete plans but we always let community feedback to drive our roadmap, so I will never say never.

Typesense is currently optimized for fast, real-time search. This requires RAM. Memory mapping is not a magic bullet: it works well when you are most likely to search on a portion of your dataset often so those parts of the data could be kept "hot" in the memory. This might not always hold true for search engines, in which case you will only get the performance of a disk based search engine like Elasticsearch because the kernel will have to continuously page memory in/out of disk.
TJ
Photo of md5-3afef4cc9e9291f4f991a88147c78384
TJ
12:00 PM
Hi Kishore - thanks for the response. I understand that. I wonder if it's something worth exploring in the future, though.

Perhaps you'll find that people can sacrifice a few extra milliseconds for the cost, depending on how bad the performance is, if you explore storing it on disk. Or maybe provide the flexibility on a per collection basis: either indexed entirely in memory or with memory mapping. Just an idea.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:11 PM
Understood. Appreciate the feedback.