NoSQL 数据库性能测试

发布于 2024-12-29 10:01:26 字数 486 浏览 3 评论 0原文

假设您有一个 nosql 数据库 - redis、cassandra、mongodb。你需要检查这个数据库的整体性能——各种平台、操作系统,甚至用于测试的编程语言。它不依赖于特定的应用程序或模式。

  • 你想看什么测试?您能帮我制定要求吗?
    • 数据库如何在集群中运行?
    • 在破碎的集群中?
    • 在云环境中?
    • 打开 10k 个连接时如何执行查询?
  • 您将使用什么工具?
    • 是不是类似 JMeter->http 服务器->数据库之类的东西?
    • Jmeter->tcp 应用程序->数据库?
    • 其他?

我发现的有关数据库性能测试的所有材料就像测试数据库作为某些产品的一部分(特定方案,特定环境)。 当数据库本身就是产品时,您是否考虑过数据库性能测试?

期待您的帮助。

-沃瓦

Let's assume you've got a nosql database - redis, cassandra, mongodb. And you need to check the overall performance for this database - various platforms, operation systems, even programming languages which are used for test. It's not tied to a specific application or schema.

  • What tests you want to see? Can you please help me to form requirements?
    • How database operates in cluster?
    • In broken cluster?
    • In cloud env?
    • How it can perform queries when 10k connections opened?
  • What tools you will use?
    • Is it something like JMeter->http server->database?
    • Jmeter->tcp app->database?
    • Other?

All material I've found about database performance testing is like testing database as a part of some product (specific scheme, specific env).
Have you thought about database performance testing when database is product itself?

Looking forward for you help.

-vova

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

命硬 2025-01-05 10:01:26

NoSQL 基准测试和性能评估中,我将它们放在一起正确的基准列表,因为它们清楚地定义了基准的目的并比较相似的功能(同类比较);有太多的基准测试至少未能满足基准测试的这些基本要求之一。通过这些,您将能够提取对您自己的基准测试感兴趣的部分,并了解使用了哪些工具并获得一些基准测试代码。

到目前为止,最通用的 NoSQL 基准是 YCSB(雅虎云服务基准)。最近,Cubrid 博客发布了针对某些数据库运行此基准测试的结果最流行的 NoSQL 解决方案,可能会让您了解如何解释结果。

In NoSQL benchmarks and performance evaluations I've put together a list of the benchmarks that are correct in the sense that they clearly define the purpose of the benchmark and compare similar features (apples-to-apples comparisons); there are way too many benchmarks out there that are failing at at least one of these fundamental requirements of a benchmark. Going through those you'll be able to extract the bits that are interesting for your own benchmark plus learn what tools have been used and get some benchmarking code too.

So far the most generic NoSQL benchmark is YCSB (Yahoo Cloud Servicing Benchmark). Recently the Cubrid blog posted the results of running this benchmark against some of the most popular NoSQL solutions and that might give you an idea of how to interpret results.

知你几分 2025-01-05 10:01:26
  • 检查此数据库的整体性能

除非您需要这样做是为了好玩,或者您只是想为了获得基准而获得基准,否则我建议您根据实际问题/要求定制性能基准。

例如,您真的需要疯狂的快速写入吗?您可以接受丢失数据吗?您介意花时间配置故障转移吗?您打算扩大规模还是缩小规模?您是否正在规划 TB 级的数据?等等..

从你给出的例子=> Redis、Cassandra 和 MongoDB 有很大不同:

Redis 主要是缓存,而且速度非常快,但只是一个缓存,它对进行中等复杂度的聚合没有多大帮助。然而,它是目前最好的缓存(我认为)。 “Redis + 杀手级数据库”是一个理想的组合。它还有一个内置的基准测试工具,您可以尝试一下。

Cassandra 是一款模仿 Google Big Table 的可靠产品(但我相信您已经知道这一点)。如果您有很多节点,那么它的扩展性会很好,但如果您的数据量达到 TB,则添加节点可能需要几天的时间。它也不是最容易获得的。但如果您愿意付费,Datastax 的优秀人员可以消除所有复杂性。我有一个非常简单的 Cassandra Bombardier 可以帮助您开始。

MongoDB 是一个伟大的数据库,有多种原因:非常性感且简单的查询语言、良好的文档、庞大的社区等。在其他方面不太好:需要花时间正确地分片,然后重新分片再次[与例如Riak相比,它是自动完成的]。如果数据(不仅仅是索引)适合 RAM,它会非常快(写入),如果不适合,它会很快开始变慢。有一种持续的猜测,您可能丢失数据(来自一位 Basho 工程师:“我个人花了一些时间寻找方法来证明 MongoDB 在遇到故障时会丢失写入”),对于不太大的数据集,聚合查询可能需要一段时间。我有一个 Mongo Performance Playground,你可能会觉得有用。

  • check the overall performance for this database

Unless you need to do it for fun, or you just want to get a benchmark for the sake of getting a benchmark, I would recommend to tailor a performance benchmark to the actual problem/requirements.

For example do you really need crazy fast writes? Are you ok with losing data? Do you mind spending time on configuring fail over? Do you plan to scale up or out? Are you planning for TBs of data? etc..

From the examples you gave => Redis, Cassandra and MongoDB are quite different:

Redis is mostly cache, and it is really fast, but being just a cache it would not help you much in doing medium complexity aggregation. However it is currently the best cache (my opinion) out there. "Redis + a killer DB" is an ideal combination. It also has a built in benchmark tool you can try.

Cassandra is a solid product modelled after Google Big Table (but I am sure you already know that). It scale writes well if you have lots of nodes, but if you reach TBs of data for example, it can take days to add nodes. It is also not a simplest one to get. But if you are ok to pay, there are excellent guys from Datastax who can take all the complexity away. I have a very simple Cassandra Bombardier that may help you to start off.

MongoDB is a great DB for multiple reasons: very sexy and simple query language, good documentation, huge community, etc.. Not so great in other aspects: need to spend time sharding it correctly, and then resharding it again [compare to e.g. Riak, where it is done automatically]. It is very fast (writes) if the data [not just the index] fits in RAM, it starts slow down very quickly if it does not. There is a ongoing speculation that you may lose data (from one of the Basho engineers: "I had personally spent some time finding out ways to demonstrate that MongoDB will lose writes in the face of failure"), aggregation queries may take a while given a not so large dataset. I have a Mongo Performance Playground that you may find useful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文