展示HN:SeaSearch – 轻量级的、基于S3的多租户搜索引擎

2作者: Daniel-Pan5 天前原帖
嗨,HN,我是Daniel,Seafile的联合创始人。 我很高兴能分享我们的开源项目SeaSearch,这是一个用Go语言编写的搜索引擎(基于ZincSearch),我们已经在Seafile项目中运行了超过两年。 经过多年的使用Elasticsearch,我们认为Elasticsearch存在两个主要问题: 1. 它不够轻量,维护集群困难。 2. 所有Seafile租户的数据都存储在一个单一的索引中,在一个库中搜索文件速度较慢,因为需要搜索整个索引。 三年前,我们开始开发解决这两个问题的方案。我们没有从头开始构建搜索引擎,而是基于ZincSearch进行开发,ZincSearch是用Go语言实现的,具有更小的运行时占用,并且兼容Elasticsearch API,但在这个过程中我们发现它仍然缺少一些东西。 现在,我们已经开源了SeaSearch,并包含了我们所需的组件: - S3支持的存储:索引数据存储在S3中。计算节点共享相同的后端,使得扩展/故障转移变得瞬时(无需数据复制)。 - 智能缓存:使用本地磁盘缓存不可变段,尽管有S3后端,仍能保持快速。 - 兼容ES API:作为大多数Elasticsearch查询端点的替代品。 - 轻量级Go运行时:没有JVM开销。 - 向量搜索:内置支持HNSW/IVFPQ进行混合语义搜索。 希望这能帮助那些在构建多租户SaaS应用时遇到类似问题的开发者。期待你们的反馈。
查看原文
Hi HN, I&#x27;m Daniel, co-founder of Seafile.<p>I&#x27;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&#x27; 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&#x2F;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&#x2F;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.