- Couchbase Essentials
- John Zablocki
- 377字
- 2021-07-23 20:27:53
Couchbase SDKs
We'll explore the Couchbase SDK and relevant APIs in detail over the next few chapters. But to complete our discussion on balancing and rebalancing, it's useful to understand the process from client to cluster. When an SDK is initialized in a client application, it makes a persistent connection to the cluster over a RESTful API. This API broadcasts a JSON message containing the cluster's topology. As nodes are added or removed, the cluster sends a new message with an updated topology.
This behavior sets Couchbase apart from other databases, whether relational or nonrelational. Most database systems have a central point of communication that is responsible for client communications. 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. On a cluster with only four nodes, Couchbase is capable of achieving nearly 1 million operations per second.
Returning to the idea of balancing data across nodes, there's an additional detail that I didn't mention. The cluster maintains an abstraction known as vBuckets, which are used to direct a key to the correct server. Rather than mapping a key directly to a node, Couchbase SDKs map the key to one of the vBuckets. The endpoint for a vBucket is provided to the client as part of its topology message from the cluster. Regardless of the number of nodes, the number of vBuckets remains the same. The keys always hash to the same vBucket, even if the cluster changes the endpoint of the vBucket.
While you'll generally not need to worry about the existence of vBuckets, it is important to understand what happens on the client as the cluster changes its topology. The client maintains a map of vBuckets to the nodes. If that map changes due to a node failure, brief client failures may appear while the map is updated.
Tip
The only case where you're likely to care about vBuckets is if you are developing an application using Mac OS X. On this platform, Couchbase Server uses 64 vBuckets instead of the standard 1024. While this difference generally won't impact your development, it will impede your ability to move data from your local server to another cluster running Linux or Windows.
- Oracle 11g從入門到精通(第2版) (軟件開發視頻大講堂)
- Docker技術入門與實戰(第3版)
- Docker進階與實戰
- 無代碼編程:用云表搭建企業數字化管理平臺
- Python高效開發實戰:Django、Tornado、Flask、Twisted(第3版)
- Magento 1.8 Development Cookbook
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- 算法訓練營:提高篇(全彩版)
- 程序設計基礎教程:C語言
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Learning jQuery(Fourth Edition)
- 創意UI Photoshop玩轉移動UI設計
- Python Web自動化測試設計與實現
- Android編程權威指南(第4版)
- IBM RUP參考與認證指南