Couch's MapReduce query

Source: Internet
Author: User
1. MapReduce介绍传统的关系型数据库中,只要你的数据是结构化的,你可以进行任何类型的查询。Apache Couch与此相反,它使用MapReduce(预定义的map和的reduce方法)进行查询。这种查询方式具有更好的灵活性,因为他们能适应各种类型的文档结构,并为每个文档索引独立计算和并行计算。这种将map和reduce结合使用的方式在CouchDB术语中称为“视图(View)”。与关系型数据库不同的是,Apache Couch不是声明哪些表中有哪些结果集,也不是依赖数据进行有效的查询,reduce查询基于map方法生成的索引进行分组查询。Map方法在每个文档作为参数时调用一次,该功能可以选择跳过文档或提交一个或多个视图行作为键值对。Map方法可能不依赖文档之外的任何信息,这种依赖是指允许增量和并行生成CouchDB视图。CouchDB视图存储在行中并根据key排序,这样能保证在成千上万个视图中的查询效率问题。创建CouchDB map方法时,首要目标是创建一个索引存储关键词相关的数据。2. 准备相关数据通过可视化创建简单数据。

{
"RED": 20,
"BLUE": 30,
"GREEN": 40
}

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Couch's MapReduce query

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.