Design Techniques for Building Streaming Data, Cloud-Native Applications: Part 1 - Spark, Flink, and Friends

A Look at Streaming Engines and Fast Data Architectures

This is the first of six posts in our cloud-native series that focuses on streaming data applications. We’ll discuss requirements, architecture considerations, design patterns, specific tools, etc.

For a more detailed examination of these topics, see my free O’Reilly report, Fast Data Architectures for Streaming Applications. The last several posts in this series on streaming will discuss serving machine learning and artificial intelligence models in streaming applications. My colleague Boris Lublinsky will write those posts. For an in-depth analysis of this topic, see his free O’Reilly report, Serving Machine Learning Models.

In this first post, I’ll discuss some requirements to consider, a few architecture points, and then discuss streaming data engines, which are standalone services that do a lot of heavy lifting for streaming data pipelines.

The next post will look at an alternative approach, using streaming data libraries to embed streaming semantics in your microservices. This approach provides greater flexibility, but requires you to implement some of the capabilities you get “for free” from the engines.

Requirements for Streaming Data Applications

In brief, these forces drive requirements for streaming (“fast data”) architectures, where I’ll use the term batch processing as a catch-all term for data warehousing and other “off-line” forms of data analytics:

  1. It’s a competitive advantage to extract useful information from data as quickly as possible.
  2. Many applications need data faster than batch processing, like ad serving and mobile apps; however, some data analytics can be done using batch processing ahead of time).
  3. Because of the time sensitivity, streaming analytics need to be integrated with other processing systems in the environment, more than is typical for batch processing.
  4. Stream processing applications are “always on,” which means they require greater resiliency, availability, and dynamic scalability than their batch-oriented predecessors.

Characteristics of Streaming Data Architectures

While the requirements in the previous section can be implemented many ways, the following characteristics are widely used in implementation architectures. See also Figure 1 below:

  • A stream-oriented data backplane is required for capturing incoming data and serving it to consuming services, which then need to use the same backplane for results needed by downstream services. Today, Apache Kafka is the most popular choice for this data backplane. As an interservice integration tool, Kafka helps support heterogeneous environments, since everything needs to be closely linked, but not too closely linked.
  • The microservices community has developed mature techniques for meeting the requirements for resiliency, availability, and scalability. Hence, streaming systems need to adopt these techniques, making them work more like conventional microservices compared to batch systems.
  • If we extract and exploit information more quickly, leading to a more integrated environment between our microservices and stream processors, then our streaming architectures must be flexible enough to support heterogeneous workloads. This dovetails with the parallel trend toward large, heterogeneous clusters manage with Kubernetes or similar resource managers.
Figure 1: Representative Streaming Architecture

Figure 1 is taken from my Fast Data Architectures for Streaming Applications report. The numbers correspond to notes in the report. I won’t discuss all the details here, but note a few things. Kafka plays the central role of integrating services, both data processing and microservices, and capturing incoming data. Apache Spark and Apache Flink are popular tools for processing data. (We’ll discuss Akka Streams and Kafka Streams in the next post.) A wide range of persistence options are possible, depending on the requirements.

Characteristics of a Streaming Engine

If you know the Hadoop ecosystem, you know that the three core components of Hadoop are the following:

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

  1. Hadoop Distributed File System (HDFS) for data storage
  2. MapReduce, Spark, or similar for processing the data (“compute”)
  3. YARN for managing resources and application instances (e..g, jobs and tasks in Hadoop parlance)

In the streaming world, the analogs are these:

  1. Kafka for storage of “in-flight, i.e., streaming data
  2. Spark, Flink, Akka Streams, Kafka Streams, or similar for compute
  3. Kubernetes or similar for managing resources and application instances

Akka Streams and Kafka Streams are examples streaming libraries, as discussed above. In this post, we’ll focus on Spark and Flink as the two most popular streaming engines, representative of many alternatives available, both commercial and open-source.

Spark and Flink share a few common characteristics:

  • They provide high-level abstractions for working with data as a whole, such as SQL with streaming extensions and APIs that support definitions of “data flows”.
  • They support large datasets and high volumes of data per unit time by partitioning the data and distributing it across a cluster.
  • The mechanics of partitioning large data sets across a cluster and managing multiple services and application instances for processing the partitions is largely hidden from the user.
  • The levels of abstraction between high-level constructs, like SQL, and low-level runtime implementation details allows these tools to support several useful features:
    • Sophisticated streaming semantics, like event-time windowing, processing triggers, SQL over streams, etc.
    • Durability and resiliency mechanisms to enable effectively once processing of records and preservation of evolving application state, even in the presence of failures.

All the work these engines do for you is a great labor-saving benefit, but they have a few drawbacks.

  • Integration with other microservices usually requires that you run the engines separately from the microservices and exchange data through Kafka topics or other means. This adds some latency and more running applications at the system level, but also helps prevent monolithic applications.
  • If your application doesn’t fit the runtime model of the engine, you have to use something else.
  • These systems can be difficult to tune and manage.
  • The overhead of these systems make them less ideal for smaller data streams, e.g., those that don’t require partitioning.

[출처] https://www.lightbend.com/blog/cloud-native-streaming-data-with-spark-flink

 

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
194 [JavaScript] How to Write a Simple Interpreter in JavaScript file 졸리운_곰 2021.04.13 519
193 [HTML] HTML로 간단한 웹페이지 만들기 file 졸리운_곰 2021.02.13 642
192 무료 반응형웹 템플릿 사이트 모음 file 졸리운_곰 2021.02.13 548
191 [javascript, 자바스크립트] 자동 실행 함수 (window.onload, $(document).ready()) 졸리운_곰 2021.02.13 449
190 배민찬은 Vue를 어떻게 사용하나요? file 졸리운_곰 2020.12.02 354
189 [속깊은 자바스크립트 강좌] 자바스크립트의 Scope와 Closure 기초 file 졸리운_곰 2020.09.16 447
188 [Javascript] with 명령에 대하여 졸리운_곰 2020.09.16 459
187 Webpack 완전정복하기!! file 졸리운_곰 2020.07.20 727
186 [javascript] 압축(Minify) / 난독화(Uglify) 졸리운_곰 2020.07.01 293
185 HTML div 왼쪽, 오른쪽 배치 졸리운_곰 2020.06.02 471
184 [html] iframe을 사용하지 말아야 할 이유. (단점) 졸리운_곰 2020.05.10 568
183 자바스크립트 자료구조 연결 리스트(Linked List) file 졸리운_곰 2020.03.30 325
182 Javascript) innerText vs innerHTML 졸리운_곰 2020.03.13 425
181 InnerHTML 사용시 알 수 없는 런타임 오류 졸리운_곰 2020.03.13 505
180 How to Create an addChild() Function in JavaScript file 졸리운_곰 2020.03.09 438
179 JavaScript post request like a form submit 졸리운_곰 2020.03.09 474
178 [pure javascript] Vanilla JS equivalents of jQuery methods 졸리운_곰 2020.03.09 375
177 [Javascript] innerHTML 의 함정 졸리운_곰 2020.03.08 374
176 jQuery append() in Pure Javascript 졸리운_곰 2020.03.08 313
175 HTML 테이블 표 가로 및 세로 합치기 (td tr 병합 방법) file 졸리운_곰 2020.02.27 486
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED