展示 HN:SeaSearch – 基于 S3 的轻量级多租户搜索引擎
2 分•作者: Daniel-Pan•5 天前
各位 HN 的朋友们,大家好,我是 Daniel,Seafile 的联合创始人。
很高兴向大家介绍我们的开源项目 SeaSearch。这是一个用 Go 语言编写的搜索引擎(基于 ZincSearch),我们已经在 Seafile 项目中生产运行了两年多。
在使用了 Elasticsearch 几年后,我们认为 Elasticsearch 存在两个主要问题:
* 它不够轻量级,维护集群很困难。
* Seafile 所有租户的数据都存储在单个索引中,搜索单个库中的文件速度很慢,因为需要搜索整个索引。
三年前,我们开始开发一个解决方案来解决这两个问题。我们没有从头开始构建搜索引擎,而是在 ZincSearch 的基础上进行开发。ZincSearch 是用 Go 实现的,而不是 JVM,运行时占用空间更小,并且兼容 Elasticsearch API。但在此过程中,我们发现它仍然缺少一些东西。
现在,我们已经开源了 SeaSearch,包含了我们所需的组件:
* **S3 后端存储:** 索引数据存储在 S3 中。计算节点共享同一个后端,使得扩展/故障转移即时完成(无需数据复制)。
* **智能缓存:** 使用本地磁盘缓存不可变段,即使后端是 S3 也能保持快速响应。
* **兼容 ES API:** 可以作为大多数 Elasticsearch 查询端点的即插即用替代品。
* **轻量级 Go 运行时:** 没有 JVM 的开销。
* **向量搜索:** 内置支持 HNSW/IVFPQ,用于混合语义搜索。
希望这能帮助到那些在构建多租户 SaaS 应用程序时遇到类似问题的开发者。期待大家的反馈。
查看原文
Hi HN, I'm Daniel, co-founder of Seafile.<p>I'm glad to share our open-sourcing project SeaSearch, a search engine written in Go (built on ZincSearch) that we’ve been running in production for over two years for Seafile project.<p>After years of using Elasticsearch, we think there are two main problems with Elasticsearch:<p>It is not lightweight and hard to maintain a cluster<p>All of seafile tenants' data was stored in a single index and it is slow to search a file in a single library because the whole index need to be searched<p>Three years ago, we started developing a solution to solve the two problems. Rather than building a search engine from scratch, we built on top of ZincSearch, that is implemented in Go rather than JVM with a smaller runtime footprint and has Elasticsearch API compatibility, but it was still missing something that we get to find out along the way.<p>We have now open-sourced SeaSearch with the pieces we needed:<p>S3-backed Storage: Index data lives in S3. Compute nodes share the same backend, making scaling/failover instant (no data replication needed).<p>Smart Caching: Uses a local disk cache for immutable segments to keep things fast despite the S3 backend.<p>ES API Compatible: Works as a drop-in replacement for most Elasticsearch query endpoints.<p>Lightweight Go Runtime: No JVM overhead.<p>Vector Search: Built-in support for HNSW/IVFPQ for hybrid semantic search.<p>Hope this helps fellow devs who are stuck in this problem when building multi-tenant SaaS applications. Looking forward to your responses.