percona nosql 与其他 nosql

发布于 2024-12-05 15:59:08 字数 173 浏览 1 评论 0原文

我正在评估用于存储键/值对(作为应用程序的一部分)的 nosql 存储,并遇到了 percona,它在 mysql 世界中提供本机键/值。这似乎是一个很好的解决方案,因为它允许存储保留在一个位置(因为其余功能存在于 mysql 中并且将继续按原样运行)。与其他键/值存储(例如 cassandra)相比,还有其他优势吗?有什么缺点?

I am evaluating nosql stores for storing key/value pairs (for a part of application), and came across percona which offers native key/value within mysql world. It seems a good solution as it allows the storage to remain at a single place (since rest of the functionality exist in mysql and would continue to as-is). Are there any other advantages over other key/value store such as cassandra? What are the disadvantages?

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

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

发布评论

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

评论(1

别理我 2024-12-12 15:59:08

您指的是 HandlerSocket 接口,它绕过 SQL 查询层并允许您通过主键在单个 InnoDB 表中获取和存储行。这个想法是,避免 SQL 的开销允许应用程序运行更高的 QPS 率。

HandlerSocket 表现出了希望,但到目前为止我们发现(我在 Percona 工作)瓶颈在于仓促编写的客户端接口。也就是说,PHP、Ruby 等的客户端 API 在其当前的实现状态下具有如此大的开销,以至于 HandlerSocket 并不比为 INSERT 和 SELECT 编写简单的 SQL 语句快。 InnoDB 已经针对主键访问进行了优化,因为表实际上是按主键存储为聚集索引的。

随着时间的推移,为 HandlerSocket 客户端库编写优化代码的未来开发应该会改进这一点。如果您想帮助完成此过程,请参与开源项目来开发这些客户端库。

HandlerSocket 的另一个缺点是,据我所知,它不支持值的就地递增,这是其他一些键/值存储提供的优化。使用 HandlerSocket,您必须获取值、读取它、递增它,然后将其发布回数据库。这引入了竞争条件,因此您必须以某种方式锁定该行。

You're referring to the HandlerSocket interface, which bypasses the SQL query layer and allows you to fetch and store rows in a single InnoDB table by primary key. The idea is that avoiding the overhead of SQL allows applications to run a much higher rate of QPS.

HandlerSocket shows promise, but so far what we've found (I work for Percona) is that the bottleneck is the hastily-written client interfaces. That is, the client API for PHP, Ruby, etc. in their current state of implementation have such overhead that HandlerSocket is no faster than writing simple SQL statements for INSERT and SELECT. InnoDB is optimized for primary key access already, since the tables are really stored as clustered indexes by primary key.

Future development on writing optimized code for the HandlerSocket client libraries should improve this over time. If you want to help this process along, get involved in the open-source projects to develop those client libraries.

Another drawback of HandlerSocket is that AFAIK, it doesn't support in-place incrementing of values, which is an optimization some other key/value stores offer. With HandlerSocket, you'd have to fetch the value, read it, increment it, then post it back to the database. This introduces a race condition, so you'd have to lock the row somehow.

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