Lambda Architecture

数据系统架构——Lambda architecture(Lambda架构) 传统系统的问题 “我们正在从IT时代走向DT时代(数据时代)。IT和DT之间,不仅仅是技术的变革,更是思想意识的变革,IT主要是为自我服务,用来更好地自我控制和管理,DT则是激活生产力,让别人活得比你好”——阿里巴巴董事局主席马云。 数据量从M的级别到G的级别到现在T的级、P的级别。数据量的变化 数据管理系统(DBMS)和数仓系统(DW)也在悄然的变化着。 阅读详情

为什么要用Lambda Architecture

在大数据处理系统中,数据处理的可靠性和实时性是一对矛盾,往往不可兼得。可靠性是指在任何异常出现的情况下,数据处理都能够做到不重不丢,并且最终得到准确的结果。实时性是指数据从输入到处理完毕输出的时间间隔。一般来说,对于像Hadoop MapReduce这样的批处理系统来说,可靠性很高,而实时性很差;对于Storm这样的流式处理系统来说,则情况正好相反。

那么,有没有办法使得数据处理系统即可以做到高可靠,又可以做到低延迟呢?Lambda Architecture就是这个问题的答案。

Lambda Architecture是为了满足如下需求:

  • 系统故障或人为错误不丢数据
  • 数据分析低延迟
  • 系统具备线性扩展能力
  • 系统中很容易增加新特性

Lambda Architecture是什么


Lambda Architecture

如上图所示,Lambda Architecture由batch layer、speed layer、serving layer组成。在输入端集中接收数据,并拷贝数据,分别导入到batch layer和 speed layer。

Batch Layer

Batch layer的职责是保证数据处理的准确性和可靠性。

Batch layer首先把数据以其原始格式存储在HDFS上,以加强系统的可靠性。然后,利用Hadoop MapReduce作业对数据进行处理,并将结果保存起来(这种处理之后的数据称之为batch view)。Hadoop作业具有很好鲁棒性,在运行过程中出现各种异常时都不会损失数据。对于存储系统来说,这种批处理方式只需要随机读、追加写,不需要处理随机写、加锁、数据一致性等问题,因此大大简化了存储系统的设计。但是batch layer对数据处理的延迟是很大的,通常是几个小时到几天。

Speed Layer

Speed layer的职责是满足所有实时性处理的需求。

Speed layer通常基于Storm这样的流式计算平台,通过快速的增量式算法,以分钟级、秒级甚至毫秒级来读取、分析、保存数据。对于存储系统,由于需要支持持续的update操作,其设计要复杂的多。为了简化问题,通常使用划窗机制来保存一段时间的数据,划窗的时间一般和batch layer的数据处理一致。

流式处理往往使用内存计算,这意味着当出现异常(比如升级或工作节点异常)时,可能会导致数据的丢失或计算结果错误。然而,Lambda Architecture却不需要过多考虑这类问题,因为下一次batch layer的作业会再次处理所有数据并获得准确的结果。

Serving Layer

Serving layer的职责是将speed layer输出数据merge到batch layer输出数据上,从而得到一份完整的输出数据,并保存到诸如HBASE这样的NoSQL数据库中,以服务于在线检索应用。在batch计算结果之上meger少量实时数据,其结果同完全使用batch计算相比,具有很好的近似性。

Lambda Architecture的收益

Lambda Architecture带来了如下收益:

  • 算法可以同时分析历史数据和短期实时数据,兼顾了准确性和实时性
  • 向存储介质的随机写入大大减少了,提升了性能
  • Batch Layer(在HDFS上)保存了原始数据,可以避免人为错误造成的数据损失

当然,获得这些收益也是有代价的。Batch layer和speed layer事实上做了重复的计算。从资源的角度看,Lambda architecture消耗了更多的资源。

Lambda Architecture在产品中的应用案例


product.png

上图是一个用户画像产品的大数据处理架构的简化版本,略去了和这个主题无关的部分。可以看到这个产品采用了典型的Lambda Architecture:

  1. Bigpipe百度自研的分布式流式数据传输系统,实时传输在线系统的日志,下游可以通过订阅的方式来获取数据。Bigpipe保证数据在传输过程中不重不丢。
  2. Data Warehouse是基于HDFS的数据仓库,保存收到的所有原始数据。
  3. Batch layer:一系列的Hadoop App完成用户特征的挖掘,App之间通过HDFS来交换数据。Batch layer每天运行一次,数据的延迟是一天。
  4. Speed layer:利用百度自研的DStream实时流式计算平台,完成当天用户特征的实时挖掘。
  5. MolaDB是百度自研的一个面向在线业务的低延迟KV数据库,存储挖掘后用户特征,并为在线系统提供服务。
  6. Search Router是在线业务的检索入口,根据在线业务的检索请求查询MolaDB。
    通过采用Lambda Architecture,即实现了海量用户画像数据的实时处理,同时也最大限度的保证了系统的可靠性。
Lambda Architecture在IoT领域的应用与挑战 1.背景介绍 随着互联网物联网(IoT)技术的发展,我们已经看到了大量的物理设备被连接到互联网上,从而形成了一个巨大的数据生态系统。这些设备产生了大量的数据,包括传感器数据、位置信息、设备状态等,这些数据可以用于各种应用,如智能城市、智能交通、智能能源等。然而,这些数据的规模和复杂性使得传统的数据处理技术无法满足需求。因此,我们需要一种新的架构来处理这 阅读详情

相关推荐

Lambda Architecture in Action: Use Cases and Success Stories

1.背景介绍 大数据处理技术不断发展,各种数据处理架构也不断涌现。Lambda Architecture 是一种用于实时大数据处理的架构,它结合了批处理和流处理的优点,为实时分析提供了高效的解决方案。在本文中,我们将深入探讨 Lambda Architecture 的核心概念、算法原理、实例代码和未来发展趋势。

AI天才研究院 908

Lambda Architecture-大数据处理系统经典架构解析

LA是通用的大数据处理系统架构

ybdesire的专栏 5468

Lambda Architecture and Apache Kafka: A Winning Partnership

大数据技术在过去的几年里发展迅速,成为了企业和组织中不可或缺的一部分。随着数据的规模和复杂性的增加,传统的数据处理方法已经不能满足需求。为了解决这个问题,人工智能科学家和计算机科学家们提出了一种新的数据处理架构——Lambda Architecture。同时,Apache Kafka 作为一种分布式流处理系统,也成为了 Lambda Architecture 的重要组成部分。

AI天才研究院 193

实时数据处理:Lamda Architecture的优势和应用

1.背景介绍 实时数据处理是现代数据科学和人工智能领域中的一个关键概念。随着数据的增长和数据处理的复杂性,实时数据处理技术变得越来越重要。Lambda Architecture 是一种有趣且具有挑战性的实时数据处理架构,它试图在处理实时数据和历史数据的同时,实现低延迟和高吞吐量。在本文中,我们将深入探讨 Lambda Architecture 的核心概念、优势、应用和实现方法。 1.1 实时数...

AI天才研究院 731

【机器学习】【期末复习】有关机器学习的计算题可供期末复习参考(带本人手写解答与思考)

本文为学校课程《机器学习》的期末复习材料,主要是关于一些机器学习模型的计算题的解答过程。

网瘾中心呼唤爱的博客 1万+

深入解析Vivado FIFO的Standard与FWFT模式:性能对比与应用场景

本文深入解析了Vivado FIFO的Standard与FWFT两种工作模式的核心差异。通过对比数据就绪时机、读延迟、控制逻辑和有效深度等关键特性,并结合图像处理、数据包转发等典型应用场景,为FPGA设计者提供了清晰的选择依据和实战配置指南,帮助优化数据流性能与设计效率。

weixin_29219189的博客 263

【大数据架构(3)】Lambda vs. Kappa Architecture-选择你需要的架构

【大数据架构(3)】Lambda vs. Kappa Architecture-选择你需要的架构

hiliang521的博客 2126

IEEE PHM 2012轴承数据实战:用LSTM预测剩余寿命的完整流程与调参心得

本文详细解析了如何利用IEEE PHM 2012轴承数据集和LSTM模型进行轴承剩余寿命预测。从数据预处理、特征工程到LSTM模型架构设计和调参技巧,提供了完整的实战流程。特别分享了FEMTO-ST数据集的处理方法、RUL标签构建策略以及提升预测精度的关键技巧,帮助工程师实现更准确的预测性维护。

weixin_31100517的博客 370

Lambda Architecture的可扩展性与性能优化

1.背景介绍 随着数据的增长和复杂性,数据处理和分析的需求也不断增加。为了满足这些需求,我们需要构建出高性能、高可扩展性的数据处理系统。Lambda Architecture 是一种可扩展的大数据处理架构,它将数据处理分为三个部分:批处理(Batch)、速度(Speed)和服务(Service)。这种架构可以提供实时数据处理和分析,同时保持数据的完整性和一致性。 在本文中,我们将讨论 Lamb...

AI天才研究院 1135

Vast.ai GPU服务器租用与SSH密钥连接实战指南

本文详细介绍了如何在Vast.ai平台租用GPU服务器并通过SSH密钥安全连接的全流程。从注册、选配GPU型号到SSH密钥生成与配置,再到实战中的端口转发和文件传输技巧,帮助用户高效利用云端GPU资源进行深度学习等计算密集型任务。

weixin_29574585的博客 538

IsaacLab从入门到精通(二) 导入自定义机器人

IsaacLab系列第二讲,导入自定义的机器人及设置

DejaWu33的博客 8476

aws-lambda-hexagonal-architecture:构建灵活高效的AWS Lambda架构

aws-lambda-hexagonal-architecture:构建灵活高效的AWS Lambda架构 项目介绍 在软件开发领域,灵活性是衡量架构优劣的重要标准。aws-lambda-hexagonal-architecture 是一个使用 AWS Lambda 和 Node.js 实现六边形架构(Hexagonal Architecture)的开源项目。六边形架构是一种设计模式,旨在实现业务...

gitblog_00054的博客 419

芒果YOLOv5改进05:损失函数IoU 篇之Repulsion Loss:原创改进损失函数 Repulsion:解决目标遮挡场景下检测,为解决密集人群检测中遮挡设计的损失函数,打造高效检测器涨点

YOLOv5改进代码实践|结合Repulsion 解决目标遮挡场景下检测🚀

包括YOLOv5、YOLOv7、YOLOv8等模型改进 4572

Kappa_Lambda_architecture

Lambda架构和Kappa架构是两种处理大数据的架构模式,它们各自有不同的特点和适用场景。

2401_83026894的博客 1027

置顶必读(2) |《滚雪球学数学建模》专栏目录 & 历年国赛/美赛真题库 & 真题解析(持续更新中)

本专栏《滚雪球学数学建模》采用“从零开始、逐步滚雪球”的学习路径,把数学建模的基础理论、方法工具与大量实战真题(尤其是国赛题,涵盖2025-1992所有真题)有机融合,形成一套系统化训练路线。非常适合零基础入门、希望提升模型与工程化能力的本科/研究生,以及备战全国大学生数学建模竞赛(国赛/省赛)的同学。加油,我们一起把建模能力打造成可迁移的核心竞争力!

**My Coding Family** 26万+

816华为OD机试真题 新系统 - 电池充电时间计算 (Java/Py/C/C++/Js/Go)

816华为OD机试真题 新系统 - 电池充电时间计算 (Java/Py/C/C++/Js/Go)

算法大师! 488

Lambda architecture and Kappa architecture.

Lambda architecture and kappa architecture. From Mastering Azure Analytics by Zoiner Tejada 阅读笔记 Lambda Architecture Lambda architecture was originally proposed by the creator of Apache Storm, Nathan ...

hjw199089的博客 838

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Big Data Lambda Architecture 翻译

Big DataLambda Architecture Posted on September5, 2012 by dbtube In orderto meet the challenges of Big Data, you must rethink data systems from theground up. You will discover that some of the most

dazheng 1574

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Building a Scalable Lambda Architecture with Apache Flink

1.背景介绍 大数据处理是现代数据科学的核心。随着数据规模的增长,传统的数据处理方法已经不能满足需求。为了处理大规模数据,我们需要一种更高效、可扩展的架构。Lambda 架构是一种流行的大数据处理架构,它可以处理大规模数据并提供低延迟和高吞吐量。在本文中,我们将讨论如何使用 Apache Flink 构建可扩展的 Lambda 架构。 2.核心概念与联系 2.1 Lambda 架构概述 L...

AI天才研究院 708

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SQS-Lambda Event Source Mapping Architecture

AWS Event Source Mapping (ESM) connects SQS with Lambda, managing polling, concurrency, and throttling. The architecture consists of SQS queues, ESM service with worker pools and Lambda execution slots.

quwenqian的专栏 544

Lambda Architecture vs. Kappa Architecture: Which is Right for Your Project?

1.背景介绍 大数据处理技术不断发展,不同的数据处理架构也在不断演进。Lambda Architecture和Kappa Architecture是两种非常常见的大数据处理架构,它们各自有其优缺点,适用于不同的项目场景。在本文中,我们将深入了解这两种架构的核心概念、算法原理、具体操作步骤以及数学模型公式,并讨论它们在实际项目中的应用和未来发展趋势。 2.核心概念与联系 2.1 Lambda ...

AI天才研究院 1013

What are the advantages of Lambda architecture

What are the advantages of Lambd architecture

在路上 412

数据系统架构——Lambda architecture

传统系统的问题 “我们正在从IT时代走向DT时代(数据时代)。IT和DT之间,不仅仅是技术的变革,更是思想意识的变革,IT主要是为自我服务,用来更好地自我控制和管理,DT则是激活生产力,让别人活得比你好”——阿里巴巴董事局主席马云。 数据量从M的级别到G的级别到现在T的级、P的级别。数据量的变化,数据管理系统(DBMS)和数仓系统(DW)也在悄然的变化着...

weixin_33743661的博客 256

Building Lambda Architecture with Spark Streaming

The versatility of Apache Spark’s API for both batch/ETL and streaming workloads brings the promise of lambda architecture to the real world. Few things help you concentrate like a last-minute change...

微信公众号:大数据从业者 233
上一篇: 深度学习如何入门?
下一篇: 零基础入门深度学习(1) - 感知器
Trader_Python
博客等级 码龄11年 392粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址