Git Product home page Git Product logo

hello-world's People

Contributors

cknnsshxs avatar

hello-world's Issues

Elasticsearch

一些提供 Elasticsearch 类似功能的开源项目

主要基于参考资料1的博客,可能存在一定时效性的问题(2021.8.17)

主要考虑使用 C/C++、Rust、Go 等相比于 Java 效率更高的编程语言开发的开源项目,GitHub Stars一定程度上反映了项目的影响力。

  • RediSearch, 为 Redis 设计的查询、二级索引和全文搜索的解决方案,主要使用 C 语言,由 Redis团队开发,目前 GitHub Stars 3.9K+

    Redis 是一个内存数据库,数据存储在内存中

  • Postgre FTS, PostgreSQL 数据库支持的全文搜索解决方案,属于 PostgreSQL 原生支持,PostgreSQL 主要使用 C 语言开发,PostgreSQL 目前在 GitHub 的镜像仓库 Stars 10.8K+

  • TypeSense, Algolia 的开源替代,更容易使用的 Elasticsearch 替代方案,主要使用 C++ 语言开发,目前 GitHub Stars 10.6K+

    Algolia 是一家美国的创业公司,通过 SaaS(Software as a service) 模式提供网络搜索产品

  • MeiliSearch, 一个强大、快速、开源、易于使用和部署的搜索引擎,主要使用 Rust 开发,目前GitHub Stars 28.7K+

特性对比

https://miro.medium.com/max/1050/1*MkHsEdoDZmU7gRay-kqGTQ.png

  • Storage: 存储方式
  • Distributed: 是否支持分布式部署;primary/replica→主从模式,RAFT→分布式一致性算法
  • Replicated: 是否支持数据复制备份
  • Languages:支持存储的语言类型
  • Typo Tolerance: 错别字容忍度
  • Boosting: 是否支持 Boosting Query,即调整查询结果的分数来达到查询结果的排序,为不喜欢的查询减分
  • Exact Search: 是否支持精确检索
  • Synonyms: 是否支持同义词配置

各自的一些局限

Elasticsearch

  • 每个 cluster 超过 1000 个索引(或 20k 个 shards)就会变得不稳定

TypeSense

  • 存储大小受可用 RAM 限制

Meilisearch

  • 每个搜索查询支持的最大词汇数受限(10)
  • 最大数据库大小为 100 GiB(每个实例可以更改)
  • 最多支持 200 个索引
  • 每个字段(field)最多 1000 个词

Benchmark 对比

测试数据

测试硬件环境

2x General Purpose / 32 GB / 8 vCPUs DigitalOcean droplets (one for load generation + one for storage)

测试结果

索引时间

indexing_time

对于索引,只计算索引器在搜索后端请求中花费的时间。Elasticsearch, PostgreSQL 和 Typesense 在这部分表现出了类似的性能,而 RediSearch 慢了大约2倍。这个结果与 RedisLabs 的基准测试结果相矛盾,所以这里的设置可能不是最优的。另一方面,Meilisearch 在这部分的表现非常出色,它的搜索速度几乎是其他搜索引擎的7倍。

查询延迟

quey_latency

同样,RediSearch 在所有的查询中都是一个较慢的异常点,而 RedisLabs 也得到了不同的结果。另一个令人惊讶的异常值是 Typesense上的 "三个单词 "查询,由于某些原因,它平均花费了大量的时间。Meilisearch 显示了相当稳定的性能,特别是对于前缀和错别字查询。

对于不受支持的查询类型使用了0,但是对于精确短语和三个单词 and 查询,RediSearch 的耗时在1毫秒以内。

原始数据

raw_data

总结

  • Elasticsearch 仍然表现优异,它为索引和所有类型的查询提供了稳定的性能
  • RediSearch 的索引性能一般,而且 RedisLabs 竭力推销他们的云计算解决方案,所以文档也是不合格的,但它可以为某些类型的查询提供亚毫秒的延迟
  • PostgreSQL 对于简单的单词查询性能有一个奇怪的峰值,而且接口相当复杂,如果你已经有一个 Postgres 数据库,它可能是一个不错的解决方案
  • 一般来说,TypeSense 的特性集和性能都很好,但在多词查询时出现了一个奇怪的峰值
  • MeiliSearch 拥有绝对出色的性能(索引和查询),但代价是:特性集和数据集的大小是有限的,而且由于没有可用的分布式选项,极大地限制了其应用场景

杂项

关于市场份额

SLINTEL 的数据(截至2022.8.17) 显示,Elasticsearch 在 Hosted Search 类别下的市场占有率为 37.86%,Elastic Stack的市场占有率为 47.40%。

Datanyze 的数据显示,Elasticsearch 在 Enterprise Search 类别下的市场占有率为 12.94%, Apache Solr的市场占有率为 26.38%,Apache Lucene 的市场占有率为 26.28%,Google Search Appliance 的市场占有率为 6.61%。

DB-Engines 关于搜索引擎的排名数据中,Elasticsearch 多年位居第一:

dbengines_data

其中得分 Score 的计算方法主要依据以下原则:

  • Number of mentions of the system on websites: 该系统在网站上的提及次数
  • General interest in the system: 对该系统的普遍兴趣
  • Frequency of technical discussions about the system: 关于系统的技术讨论的频率
  • Number of job offers, in which the system is mentioned: 提及该系统的工作机会的数量
  • Number of profiles in professional networks, in which the system is mentioned: 在专业网络中提到该系统的简介数量
  • Relevance in social networks: 社交网络中的相关性

其他一些或许值得注意的项目

Manticore

使用 C++开发的 Elasticsearch 更快的开源替代方案,支持全文搜索和数据分析,基于 Sphinx 的基础进行开发,目前 GitHub Stars 2K+,仓库简介如下

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon

一些和 Elasticsearch 的 Benchmark 对比如下:

manticore_benchmark1

manticore_benchmark2

manticore_benchmark3

manticore_benchmark4

性能似乎很不错,详细信息可以参阅参考资料 9-10 的链接进一步了解。

参考资料

  1. Benchmarking Performance: Elasticsearch vs Competitors
  2. Compare Algolia vs ElasticSearch vs Meilisearch vs Typesense
  3. Meilsearch Documentation
  4. Elasticsearch Alternatives and Reviews (Jun 2022)
  5. Elasticsearch - Market Share, Competitor Insights in Hosted Search
  6. Enterprise Search Market Share Report | Competitor Analysis | Apache Solr, Apache Lucene, Elasticsearch
  7. DB-Engines Ranking - popularity ranking of search engines
  8. 开源搜索引擎排名第一,Elasticsearch是如何做到的? - 腾讯云开发者社区-腾讯云
  9. Manticore: a faster alternative to Elasticsearch in C++ with a 21-year history
  10. manticoresoftware/manticoresearch: Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.