我们将会在后面的几章中详细学习 Couchbase SDK 以及相关 APIs。但是要结束我们在 balancing 和 rebalancing 上的讨论,理解从客户端到集群的过程是有用的。当一个SDK在客户端应用中初始化后,它就会在一个 RESTful API 之上建立起到集群的一个持久化连接。该API广播一个JSON消息,其中包含了集群的拓扑。当被加进来或移除掉,集群会发送一个新的消息,里面带的是更新过的拓扑。
This behavior sets Couchbase apart from other databases,不管是关系型的或是非关系型的。大多数数据库系统都有一个中心交互点负责客户端交互。Couchbase owes some of its massive throughput to its smart clients。Eliminating the bottleneck of a man-in-the-middle allows performance levels to reach a massive scale。在一个只有4个节点的集群中,Couchbase 能够实现几乎每秒1百万个操作。
再回到 the idea of balancing data across nodes,有一个额外的细节,我没有提到。集群维护了一个抽象,叫 vBuckets,它用于指引某个key到正确的服务器上去。而不是将key直接映射到一个节点上,Couchbase SDKs 将 key 映射到某个 vBucket。The endpoint for a bucket is provided to the client as part of its topology message from the cluster。不管节点的数量是多少,vBuckets的数量保持一样。The keys always hash to the same vBucket, even if the cluster changes the endpoint of the vBucket。
虽然你通常不需要担心 vBuckets 的存在,但理解集群改变了它的拓扑时,客户端这边都会发生什么是很重要的。客户端维护了 vBuckets 到 nodes 的一个映射。如果由于一个节点故障而使得map变了,brief client failures may appear while the map is updated。
【
唯一的情况,你可能会担心 vBuckets,是如果你用的是 mac os x 在开发应用。在此平台上,Couchbase server 用的是 64 vBuckets,而不是标准的 1024。虽然这个区别通常不会影响你的开发,但它会影响你将数据从你的本地服务器移植到运行Linux或Windows的集群中。
】
相关推荐
Developing with Couchbase Server
couchbase-server-community_5.1.1-windows_amd64,couchbase 社区版5.11 比redis 更强悍的nosql 数据库
python写couchbase增删改查 python写couchbase增删改查 python写couchbase增删改查 python写couchbase增删改查
主要讲解couchbase的安装和基本使用。按照教程的讲解,应该足够入门使用了。希望能帮助有需要的童鞋。 couchbase继承了memcache和nosql 同时如果有任何疑问,欢迎交流
linux下c++实现从couchbase集群读取,写入数据,测试可用
Couchbase使用说明文档,文档中详细介绍了Couchbase从下载,安装到使用过程所需要注意的一切问题,包括下载,安装,设置,集群,.Net调用实例(增删改查)
couchbase官方教程
sync_gateway, 将 Couchbase Lite连接到Couchbase服务器 同步网关功能管理基于http的 Couchbase Lite移动客户端的数据访问利用 Couchbase服务器,因为它是水平缩放数据存储聚集到水平可以扩展的层提供访问控制和数据...
go-couchbase - Go语言中的Couchbase敏捷客户端
Couchbase Server administration
It also brings coverage of multiple new features, including the new generation of client SDKs, security and LDAP integration, secondary indexes, and multi-dimensional scaling. Pro Couchbase Server ...
couchbase架构设计,学习couchbase的设计原理。
Laravel开发-laravel-couchbase Laravel 5.6的CouchBase提供商
CouchBase 开发人员入门资料。 This manual provides information on how to build applications using Couchbase Server 2.0. The guide is designed to be used in conjunction with the language-specific guide...
couchbase java 客户端代码
couchbase-lite-java-core, Couchbase Lite核心库 是什么? Couchbase Lite Android库分为两个部分:这个模块没有对 Android API的依赖,而且在非Android环境中可用。couchbase-lite-android - 对 Android API有
couchbase-python-client 是 Couchbase Server 的官方库。 标签:couchbase 分享 window._bd_share_config = { "common": { "bdSnsKey": {}, ...
couchbase-java-client, Couchbase服务器的正式Java客户端 官方 Couchbase SDK这个项目是Couchbase在使用 Java ( 或者在JVM上) 时的官方驱动程序。 它通过异步和同步api提供管理。CRUD和查询设施。特性高性能键/值和...
Couchbase 4.5.1-el6 自动化安装包,只需要稍作修改即可部署集群。
couchbase的初始化问题及索引相关问题解决方法,包括couchbase在shell中初始化、追加新节点、手动进行负载均衡、NQ1L初始化、N1QL order by 排序慢这几个问题