Why Should You Care About MapReduce?

(From:http://www.theserverside.com/news/1321219/Why-Should-You-Care-About-MapReduce)

 

 

 

Why Should You Care About MapReduce?

By Eugene Ciurana

01 Feb 2008 | TheServerSide.com

What is MapReduce?

MapReduce is a distributed programming model intended for processing massive amounts of data in large clusters, developed by Jeffrey Dean and Sanjay Ghemawat at Google. MapReduce is implemented as two functions, Map which applies a function to all the members of a collection and returns a list of results based on that processing, and Reduce, which collates and resolves the results from two or more Maps executed in parallel by multiple threads, processors, or stand-alone systems. Both Map() and Reduce() may run in parallel, though not necessarily in the same system at the same time.

Google uses MapReduce for indexing every Web page they crawl. It replaced the original indexing algorithms and heuristics in 2004, given its proven efficiency in processing very large, unstructured datasets. Several implementations of MapReduce are available in a variety of programming languages, including Java, C++, Python, Perl, Ruby, and C, among others. In some cases, like in Lisp or Python, Map() and Reduce() have been integrated into the fabric of the language itself. In general, these functions could be defined as:

List2 map(Functor1, List1);
Object reduce(Functor2, List2);

The map() function operates on large datasets split into two or more smaller buckets. A bucket then contains a collection of loosely delimited logical records or lines of text. Each thread, processor, or system executes the map() function on a separate bucket to calculate a set of intermediate values based on the processing of each logical records. The combined results from all of these should be identical as having been executed as a single bucket by a single map() function. The general form of the map() function is:

map(function, list) {
  foreach element in list {
    v = function(element)
    intermediateResult.add(v)
  }
} // map

The reduce() function operates on one or more lists of intermediate results by fetching the each from memory, disk, or a network transfer and performing a function on each element of each list. The final result of the complete operation is performed by collating and interpreting the results from all processes running the reduce() operations. The general form of the reduce() function is:

reduce(function, list, init) {
  result = init
  foreach value in list {
    result = function(result, value)
  }
  outputResult.add(result)
}

The implementation of MapReduce separates the business logic from the multi-processing logic. The map() and reduce() functions across multiple systems, synchronized over shared pools and communicating with one another over some form of RPC. The business logic is implemented in user-definable functors that only work on logical record processing and aren’t concerned with multiprocessing issues. This enables quick turnaround of parallelized processing applications across massive numbers of processors once the MapReduce framework is in place because developers focus their effort on writing the functors. MapReduce clusters are reused by replacing the functors and providing new data sources without having to build, test, and deploy a complete application every time.

Implementation of MapReduce

MapReduce is intended for large clusters of systems that can work in parallel on a large dataset. Figure 1 shows a main program, running on a master system, coordinating other instances of itself that either execute map() or reduce(), and collates the results from each reduce operation.

 

 

The main application is responsible for splitting the basic dataset into buckets. The optimal bucket size depends on the application, the number of nodes, and the I/O bandwidth available. These buckets are normally saved to disk, but could be split in main memory if appropriate, depending on the application. The buckets will become the input into the map() functions.

The main application is also responsible for launching or forking several copies of the MapReduce core, all of which are identical except for a controller that assigns and coordinates map() or reduce() tasks to idle processes or threads. The controller keeps track of each map() and reduce() tasks state (waiting, running, complete) and may act as a conduit for routing the intermediate results between map() and reduce() tasks.

Each map() task processes an assigned bucket through and produces a list of intermediate results that are stored into a shared memory area. The shared memory can be designed in the form of a distributed cache, disk, or other. The task notifies the controller when a new intermediate result has been written and provides a handle to its shared memory location.

The controller assigns reduce() tasks as new intermediate results are available. The task sorts the results by application-dependent intermediate keys implemented through comparators so that identical data are grouped together for faster retrieval. Very large results may be externally sorted. The task iterates over the sorted data and passes each unique key and collated results to the users’s reduce() functor for processing.

Processing by map() and reduce() instances ends when all buckets are exhausted and all reduce() tasks notify the controller that their output has been generated. The controller signals the main application to retrieve its results. The main application may then operate on these results directly, or re-assign them to a different MapReduce controller and tasks for further processing.

Real world implementations of MapReduce would normally assign controllers, map(), and reduce() tasks to a single system. The Google operational model is based on deploying MapReduce applications across large clusters of commodity systems, or white boxes. Each white box has its own local storage required for processing of its bucket, a reasonable amount of primary memory (2 to 4 GB RAM), and at least two processing cores. White boxes are interchangeable, and the main application may assign any machine in the cluster as the controller, and this one in turn assigns map() or reduce() tasks to other connected white boxes.

Java-based MapReduce Implementation

The Google environment is customized for their needs and to fit their operational model. For example, Google uses a proprietary file system for storing files that’s optimized for the type of operations that their MapReduce implementations are likely to perform. Enterprise applications, on the other hand, are built on top of Java or similar technologies, and rely on existing file systems, communication protocols, and application stacks.

A Java-based implementation of MapReduce should take into account existing data storage facilities, which protocols are supported by the organization where it will be deployed, the internal APIs at hand, and the availability of third-party products (open-source or commercial) that will support deployment. Figure 2 shows how the general architecture could be mapped to robust, existing Java open-source infrastructure for this implementation.

 

 

This architecture assumes the presence of tools such as Terracotta or Mule that are common in many enterprise setups, and the availability of white boxes in the form of physical or virtual systems that can be designated as part of the MapReduce cluster through simple configuration and deployment. A large system may be partitioned into several virtual machines for efficiency, and assign more or fewer nodes as needed. Capacity issues and processor availability can help determine whether to use physical white boxes, virtual machines, or a combination of both in the cluster.

The Terracotta clustering technology is a great choice for sharing data between the map() and reduce() tasks because it abstracts all the communications overhead involved in sharing files or using RPC calls to initiate processing of the results. The map() and reduce() tasks are implemented in the same application core, as described in the previous section. The data structures for sharing intermediate result sets could be kept in memory data structures that are in turn shared transparently by Terracotta. Interprocess communication issues disappear to the MapReduce implementers since the Terracotta runtime is in charge of sharing those data structures across the cluster with MapReduce that uses its runtime. Instead of implementing a complex signaling system, all the map() tasks need to do is flag intermediate result sets in memory and the reduce() tasks will fetch them directly.

Both the controller and the main application are likely to be in a wait state for a while even with the massive parallelization available through the MapReduce cluster. Signaling between these two components, and between the reduce() tasks and the controller when reduction is complete, is done over the Mule ESB. In this manner, results output could be queued up for processing by other applications, or a Mule service object (or UMO) can take these output results and split them into buckets for another MapReduce pass, as described in the previous section. Mule supports synchronous and asynchronous data transfers in memory, across all major enterprise protocols, or over raw TCP/IP sockets. Mule can be used to move results output between applications executing in the same machine, across the data center, or in a different location entirely with little programmer participation beyond identifying a local endpoint and letting Mule move and transform the data toward its destination.

Another Java-based implementation could be through Hadoop, a Lucene-derived framework for deploying distributed applications running on large clusters of commodity computers. Hadoop is an open-source, end-to-end, general-purpose implementation of MapReduce.

Conclusion

Indexing large amounts of unstructured data is a difficult task regardless of the technologies involved. Traditional methods of applying dedicated algorithms and heuristics result in hard to maintain, unwieldy systems with performance degradation over time. RDBMSs are optimized for indexing and searching of large structured data sets but they are inadequate for unstructured data. MapReduce provides a simple, elegant solution for data processing in parallelized systems with these advantages:

  • Reduced Cost
  • High programmer productivity since the business logic is implemented independently of the parallelization code
  • Overall better performance and results than using traditional RDBMS techniques or custom algorithms/heuristics
  • Ease of deployment using known techniques and existing tools that are familiar to enterprise Java architects and developers

Google has an impressive track record with MapReduce, and more tools appear every day that can ease its adoption for mainstream, enterprise-class applications. If you’re ready to give it a shot, start with a simple task like analyzing the traffic patterns into your Web cluster based on the IP address of the requesters, or something similar. An exercise like this will be a great way of familiarizing yourself with the issues and opportunities of MapReduce in preparation to use it for your mission-critical applications.

About the Author

Eugene Ciurana is the Director of Systems Infrastructure at LeapFrog Enterprises, an open-source software evangelist, and a contributing editor to TheServerSide.com. He can be found in several places across the IRC universe (##java, #awk, #esb, #iphone) under the /nick pr3d4t0r.

基于源码100%开放策略,企业微信AI SCRM,积极拥抱开源,已推出一个完全开源、免费使用的源雀SCRM AI开源版工具,结合智谱等AI大模型,让企业快速拥有更强大、更丰富、更智能的企业微信管理能力 基于源码100%开放策略,企业微信AI SCRM,积极拥抱开源,已推出一个完全开源、免费使用的源雀SCRM AI开源版工具,结合智谱等AI大模型,让企业快速拥有更强大、更丰富、更智能的企业微信管理能力。 立即下载

相关推荐

大型国有银行应用系统全链路性能劣化智能根因定位与自愈Agent平台详细设计方案.docx

大型国有银行应用系统全链路性能劣化智能根因定位与自愈Agent平台详细设计方案.docx

Hadoop 大数据平台入门:从三层架构到 HDFS、YARN、MapReduce 实战

本文系统阐述学习Hadoop的必要性:它是大数据技术的地基,通过HDFS(存储)、YARN(资源管理)、MapReduce(计算)三组件构建分布式体系。文章从生态全景、集群规划入手,深入解析HDFS块机制与读写流程,YARN资源调度与多队列隔离配置,并以WordCount为例拆解MapReduce的Map-Shuffle-Reduce模型及Combiner优化,帮助读者建立清晰的技术认知框架,为后续学习Spark、Hive等奠定坚实基础。

2503_92337058的博客 295

母婴行业智能体开发平台大模型应用方案.docx

母婴行业智能体开发平台大模型应用方案.docx

Yarn 工作机制详解:从 MapReduce 程序提交到 MRAppMaster 注销的完整流程

Yarn 的工作机制本质上是一套“申请—分配—执行—回收”的资源管理闭环:客户端通过 YarnRunner 申请 Application 并上传资源,ResourceManager 负责调度,NodeManager 负责创建容器和执行任务,MRAppMaster 负责单个作业的统筹与协调。把这 15 个步骤记牢,再配合流程图和排查思路,就能在遇到 MapReduce 作业异常时快速判断问题出在哪个环节。

2401_83857914的博客 334

钢铁行业可信数据空间AI大模型服务平台建设方案.docx

钢铁行业可信数据空间AI大模型服务平台建设方案.docx

流域十五五国家水网骨干工程智慧水利调度系统项目详细设计方案.docx

流域十五五国家水网骨干工程智慧水利调度系统项目详细设计方案.docx

2026 专转本计算机|大数据关键技术:Hadoop、MapReduce、NoSQL 与处理流程(附例题)

大数据 5V 特征包括 Volume(大量)、Variety(多样)、Velocity(高速)、Value(______)和 Veracity(真实性)。:江苏专转本、计算机大类、大数据、Hadoop、MapReduce、NoSQL、数据挖掘。NoSQL 结构灵活、高扩展,一般不强调严格事务与关联查询。MapReduce 模型中,对数据逐条处理并抽取键值对的阶段是( )。Hadoop 框架中,负责海量数据分布式存储的组件是( )。下列属于非关系型数据库的是( )。下列属于大数据处理环节的有( )。

大今野 431

231232fdfdsf

321

深入理解 MapReduce 工作原理:从分片、溢写到 Shuffle 与 Reduce 的完整链路

分片并行地 Map,分区排序地 Shuffle,分组归并地 Reduce。它的每一个环节都有明确的设计动机——分片为了并行与本地性,环形缓冲区为了平衡内存与磁盘,溢写与归并为了在有限内存下处理超大数据,分区与排序为了让 Reduce 能高效聚合,容错与推测执行为了在不可靠硬件上稳定产出结果。掌握 MapReduce 不只是记住流程,更重要的是理解“数据在哪里、以什么形态流动、在哪个环节被放大当你能根据作业的溢写次数、拉取数据量和分区分布判断瓶颈所在时,才算真正把 MapReduce 用起来了。

2401_83857914的博客 455

餐饮服务基于DeepSeek AI大模型应用方案.docx

餐饮服务基于DeepSeek AI大模型应用方案.docx

集团面向5G+人工智能融合场景的工厂全连接智能体调度平台详细设计方案.docx

集团面向5G+人工智能融合场景的工厂全连接智能体调度平台详细设计方案.docx

MapReduce —— Hadoop生态中那个“被误解的基石”

别急着给MapReduce判“过时”🙅‍♂️ 这篇文章带你重新校准认知:它不是老古董计算引擎,而是分布式数据处理的契约式抽象层——用确定性换容错,以延迟换可预测性。从金融风控批任务到PB级脏数据清洗,它仍在不可替代地兜底。

2601_94912102的博客 339

【深度学习开发环境配置】基于PyTorch的计算机视觉项目依赖管理:requirements.txt文件解析与版本控制方案

内容概要:该文件为一个Python项目的依赖包配置文件(requirements.txt),列出了项目运行所需的软件包及其最低版本要求。主要包括深度学习框架PyTorch及其视觉扩展 torchvision、科学计算库 numpy 和 scipy、数据处理工具 pandas、机器学习库 scikit-learn、图像处理库 opencv-python 和 Pillow,以及数据可视化工具 matplotlib 和 seaborn 等。该配置确保项目在不同环境中具备一致的运行条件。; 适合人群:从事深度学习、计算机视觉或数据科学相关工作的开发者与研究人员,熟悉Python环境管理的技术人员; 使用场景及目标:①用于搭建项目开发环境,确保依赖一致性;②支持模型训练、图像处理、数据分析等任务的环境准备;③便于项目共享与部署,降低环境配置成本; 阅读建议:在实际使用时,建议通过 pip install -r requirements.txt 安装依赖,并根据具体硬件环境适当调整版本兼容性,尤其注意 PyTorch 与 CUDA 版本的匹配。

Hadoop 手册:HDFS · YARN · MapReduce 三角色拆解与集群实战

学习记录

YWX_XX的博客 513

顶刊复现改进优化反演控制的水面舰艇自适应跟踪控制程序

内容概要:本文档介绍了名为“【顶刊复现】改进优化反演控制的水面舰艇自适应跟踪控制程序”的Matlab仿真资源,聚焦于水面舰艇与无人船在复杂海洋环境下的高精度路径跟踪与运动控制问题。该资源基于先进的非线性控制理论,如反演控制(Backstepping)、李雅普诺夫稳定性理论和自适应控制方法,构建了具备强鲁棒性和抗干扰能力的控制器,能够有效应对模型不确定性、外部扰动及环境变化。文档还列举了多项相关Matlab仿真项目,涵盖多智能体协同控制、事件触发通信、模糊PID控制、模型预测控制(NMPC)、滑模控制等多种前沿控制策略,充分体现了其在智能船舶控制、海洋工程自动化和无人系统领域的高水平学术价值与实际应用潜力。; 适合人群:具备自动控制理论基础和Matlab编程能力的科研人员、控制科学与工程及相关专业的研究生,以及从事无人船、水面航行器、水下机器人等智能航海装备控制系统开发的工程技术人员。; 使用场景及目标:① 复现顶级期刊(如SCI一区)中关于水面舰艇或无人船的先进控制算法,支撑高水平学术论文的研究与撰写;② 作为高校课程或科研实验的教学案例,开展非线性系统控制、自适应控制、轨迹跟踪等方向的教学与实践;③ 为智能船舶、海上无人集群系统等实际工程项目提供算法验证、性能测试与仿真优化的技术平台。; 阅读建议:此资源以Matlab代码为核心载体,建议使用者结合现代控制理论教材与原始参考文献,深入理解反演控制与自适应机制的设计逻辑与数学推导,并通过修改参数、调整初始条件和扰动设置等方式调试仿真程序,全面掌握算法的实现细节与性能边界,实现从理论分析到仿真实践的完整闭环。

电气数据大规模复杂配电网故障溯源数据集

内容概要:本文档介绍了《大规模复杂配电网故障溯源数据集》这一面向电力系统领域的专业技术资源,聚焦于现代配电网在高比例分布式电源接入、源荷不确定性等复杂运行条件下的故障诊断与溯源问题。资源提供了基于Matlab/Simulink平台构建的大规模、高复杂度仿真模型与真实或仿真数据集,涵盖IEEE标准测试系统(如IEEE 33、IEEE 9节点)及实际配网拓扑,支持对故障定位、异常检测、网络重构、韧性提升、应急电源调度等关键课题的深入研究。文档列举了多项配套技术案例,如配电网故障重构、状态估计、分布式电源承载力评估、应急移动电源动态调度等,突出了在新型电力系统背景下故障响应机制与智能决策算法的研发需求,适用于开展高水平科研与工程验证。; 适合人群:电气工程、自动化、能源系统及相关专业的高校研究生、博士生、科研机构研究人员,以及从事智能电网、配网自动化、故障诊断与电力系统仿真的工程技术人员。; 使用场景及目标:① 支撑复杂配电网中故障传播路径分析与根源定位算法的开发与验证;② 服务于配电网韧性评估、故障恢复策略优化、网络重构与应急调度等前沿课题的数据需求;③ 结合Matlab/Simulink环境进行电力系统建模、仿真与控制策略设计;④ 为高水平学术论文撰写、科研项目申报及实验平台搭建提供高质量数据支撑与案例参考。; 阅读建议:建议结合文档中提及的“荔枝科研社”资源平台获取完整的数据集与配套代码,根据具体研究方向筛选匹配的仿真模型与案例,优先关注与自身课题相关的故障场景与算法实现,并利用Matlab工具进行复现实验与算法性能对比分析。

jdk - 25.0.5.1 - windows-x64.zip

Java SE Development Kit 25.0.5.1 downloads JDK 25 binaries are free to use in production and free to redistribute, at no cost, under the Oracle No-Fee Terms and Conditions (NFTC). JDK 25 will receive updates under the NFTC, until September 2028, a year after the release of the next LTS. Subsequent JDK 25 updates will be licensed under the Java SE OTN License (OTN) and production use beyond the limited free grants of the OTN license will require a fee.

代永涛_毕设任务书_输电绝缘子运行状态视觉识别方法研究(绝缘子缺陷YOLOv9).docx

代永涛_毕设任务书_输电绝缘子运行状态视觉识别方法研究(绝缘子缺陷YOLOv9).docx

上一篇: FreeBSD Install Nginx Webserver
下一篇: HTTP multipart/form-data 上传方式说明
excpp
博客等级 码龄15年 0粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址