gpt4 book ai didi

c - Couchbase 在多大程度上是 Memcached 的替代品

转载 作者:行者123 更新时间:2023-12-04 04:53:38 26 4
gpt4 key购买 nike

Official couchbase documentation说。

"If you already have an application that uses the Memcached protocol then you can start using your Couchbase Server immediately. If so, you can simply point your application to this server like you would any other memcached server. No code changes or special libraries are needed, and the application will behave exactly as it would against a standard memcached server. Without the client knowing anything about it, the data is being replicated, persisted, and the cluster can be expanded or contracted completely transparently."



我们已经有一个基于 C 的应用程序,它通过使用 libmemcached C API 与 memcached 一起工作。
我们想搬到沙发基地,因为我们想要持久性(主要是)。
我们看到了前面提到的 Couchbase 引用并尝试了这个(使用 Couchbase 存储桶),这是一个惊喜。它起作用了,就像那样。为此+1。

我们发现还存在一个 Couchbase C api , 下面是问题,
  • 如果 libmemcached API 足以使用 Couchbase,那么 Couchbase C API 提供了什么?
  • (继续)使用(现有)libmemaced API 与 Couchbase 服务器的 Couchbase 类型存储桶对话有什么缺点?
  • 升级我们的应用程序以使用 Couchbase C api 与 Couchbase 服务器对话有什么好处?
  • 最佳答案

    1) If libmemcached API is enough to use Couchbase, what does the Couchbase C API offer ?



    当然,couchbase 使用新操作扩展了 memcached 协议(protocol),例如触摸、观察、获取锁定、解锁、从副本读取等。其中一些虽然可以在 libmemcached 中实现(我已经为触摸命令做了补丁),而不是由 vanilla memcached 服务器支持,因此在 libmemcached 中测试和维护将更加困难。其他命令,如观察、从副本读取,根本无法根据 libmemcached 实现。 Couchbase 的另一组 API 是对数据库索引的 View 查询,它使用 map/reduce 构建,libcouchbase 可以做到。

    2) What are the disadvantages of ( continuing ) to use (existing ) libmemached API to talk to Couchbase type bucket of Couchbase server ?



    与您可以找到的任何其他 memcached 客户端一样,Libmemcached 被视为“哑”或“传统”客户端,而不是“智能”客户端。区别在于客户端是否知道集群拓扑。旧客户端必须通过集群中的单个入口点或进行某种平衡(如循环)。默认情况下,它将使用服务器端代理,它知道拓扑并且可以在该节点不拥有 key 的情况下重新路由。因此,当网络/CPU/内存容量实际上足以处理请求时,您可能会达到此代理的限制(尽管可以在客户端设置此代理)。智能客户端知道集群拓扑并跟踪其变化,因此它可以消除 key 的重新路由。

    3) What are the advantages of upgrading our application to use Couchbase C api to talk to Couchbase server ?



    您将能够访问 memcached 的其他 API 和扩展 API。 Couchbase 客户端还可以优化网络使用。

    关于c - Couchbase 在多大程度上是 Memcached 的替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17066371/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com