NoSQL数据库学习教程 联系客服

发布时间 : 星期五 文章NoSQL数据库学习教程更新完毕开始阅读24a5d7523c1ec5da50e270b1

http://blog.sina.com.cn/mpl398235717

Map Reduce已经烂大街了,不过还是要提一下。 参见:http://zh.wikipedia.org/wiki/MapReduce

Handling Deletes

但我们执行删除操作的时候必须非常谨慎,以防丢失掉相应的版本信息。

通常我们给一个Object标注上\已删除\的标签。在足够的时间之后,我们在确保版本一致的情况下可以将它彻底删除。回收他的空间。

存储实现

One strategy is to use make the storage implementation pluggable. e.g. A local

MySQL DB, Berkeley DB, Filesystem or even a in memory Hashtable can be used as a storage mechanism.

Another strategy is to implement the storage in a highly scalable way. Here are some techniques that I learn from CouchDB and Google BigTable.

CouchDB has a MVCC model that uses a copy-on-modified approach. Any update will cause a private copy being made which in turn cause the index also need to be modified and causing the a private copy of the index as well, all the way up to the root pointer.

http://blog.sina.com.cn/mpl398235717

http://blog.sina.com.cn/mpl398235717

Notice that the update happens in an append-only mode where the modified data is appended to the file and the old data becomes garbage. Periodic garbage collection is done to compact the data. Here is how the model is implemented in memory and disks

In Google BigTable model, the data is broken down into multiple generations and the memory is use to hold the newest generation. Any query will search the mem data as well as all the data sets on disks and merge all the return results. Fast detection of whether a generation contains a key can be done by checking a bloom filter.

http://blog.sina.com.cn/mpl398235717

http://blog.sina.com.cn/mpl398235717

When update happens, both the mem data and the commit log will be written so that if the

节点变化

Notice that virtual nodes can join and leave the network at any time without impacting the operation of the ring.

When a new node joins the network

? 新加入的节点宣告自己的存在(广播或者其他手段)

? 他的邻居节点要调整Key的分配和复制关系。这个操作通常是同步的 ? 这个新加入的节点异步的拷贝数据

? 这个节点变化的操作被发布到其他节点

http://blog.sina.com.cn/mpl398235717

http://blog.sina.com.cn/mpl398235717

Notice that other nodes may not have their membership view updated yet so they may still forward the request to the old nodes. But since these old nodes (which is the neighbor of the new joined node) has been updated (in step 2), so they will

http://blog.sina.com.cn/mpl398235717