StreamBase Terms and Components

StreamBase DocumentationGetting Started

http://docs.streambase.com/latest/index.jsp

————————————————————————————————————————-

Quick Facts: StreamBase Terms and Components

Purpose 목표

When you start using a new product, you often have some basic questions, such as:

처음 제품을 사용할 때 이런 의문을 갖는다 :

  • What is it? 이게 뭔데?
  • How will it help me do my job? 이거 쓰면 뭐가 좋아?
  • What is the development cycle and environment? 개발주기나 사용 환경이 어때?
  • What are the product’s components, and what new terms do I need to understand? 구성품은 뭐뭐가 있고 내가 이해해야 할게 뭐가 있지?

This topic addresses those initial questions in enough depth to understand the various lessons taught in the tutorial. 다양한 튜토리얼을 배우면… 이런 첫 질문에 대한 답을 알 수 있을듯…

————————————————————————————————————————-

What is StreamBase? ??스트림베이스??

StreamBase is a new type of computing platform, designed specifically to meet the performance requirements of high-volume, real-time streaming applications. At its core, StreamBase implements a unique Stream Processing Engine™ named StreamBase Server. In contrast to the traditional database model where data is first stored and indexed and then subsequently processed by queries, StreamBase processes the inbound data while it is in flight, as it streams through the server.

스트림베이스는 새로운 종류의 계산computing 플랫폼으로, 특별히 실시간, 대용량, 어플리케이션에 적합하게 디자인 됐다. 핵심은 Stream Processing Engine™ named StreamBase Server. 기존의 데이터베이스 모델은 먼저 저장을 하고 인덱싱을 한 다음에서야 쿼리를 처리했는데 스트림베이스는 데이터가 날라오는 동안에 처리해서 서버에 넣어준다.

Data arrives on a stream as discrete messages called events. Each message contains a tuple, and is processed by StreamBase Server in real time, using the business logic that you defined. Results are and delivered as they are produced, typically in milliseconds. Events are inherently transient: their data can be stored, but it is optional. In many cases, client programs that you write will consume the processed results in real time, and take appropriate actions based on your code’s direction.

데이터는 event라고 불리는 각각의 message로 전달된다. 각각의 message는 tuple을 포함하고 있고, 이것은 StreamBase Server에서 미리 정의 해 놓은 login대로 실시간 처리된다. 이 데이터는 밀리초 내에 처리된다. Event는 순식간에 저장된다 : 데이터는 저장될 수 있지만… 다 저장되는건 아니다. 데이터 저장하는데 시간이 걸려서 처리속도가 늦어질 수 있기 때문에 이 부분은 개발자가 알아서 하도록 한다.

StreamBase can also connect to an external data source, enabling applications to incorporate selected data into the application flow, or to update the external database with processed information. With StreamBase Enterprise Edition an application can connect to a JDBC-compliant database.

StreamBase는 외부데이터 접근도 가능하다. 정해진 데이터를  application flow에 포함시키거나 처리결과를 외부 데이터베이스에 저장할 수 있다. Enterprise Edition은 JDBC-compliant database에 접속할 수 있다.

The following diagrams illustrate the conceptual differences between the older Outbound Processing model and the new StreamBase Inbound Processing model.

밑의 다이어그램은 기존의 데이터 처리 모델과 StreamBase 데이터 처리 개념을 비교해준다.

Outbound Processing Model Used by Traditional Database Products

Inbound Processing Model Used by StreamBase

In StreamBase applications, events deliver data records called tuples that flow through the query and application processing steps, which may in turn transform this data while it is moving. StreamBase provides a set of operators, data processing units that you can add and configure to apply your business logic on the streaming data. With the operators and a supporting cast of data constructs, you can perform such tasks as:

스트림베이스 어플리케이션에서 event는 tuple이라고 불리는 data record를 가져온다. tuple은 이동과 동시에 쿼리와 어플리케이션 처리과정으로 들어간다.  StreamBase는 set of opreator을 제공한다. data processing unit에서는 streaming data에 네 login을 넣을 수 있다. opreator과 supporting cast of data constructs를 이용해서 이런 작업이 가능하다:

  • Applying aggregating functions to windows of real-time data 윈도우의 실시간 데이터를 통합처리
  • Computing new field values by applying mathematical expressions, adding new fields, or dropping fields, from the data streams
  • Filtering data into separate streams for conditional processing
  • Performing approximate buffered sorts of the real-time data
  • Joining previously split streams of data based on key values
  • Within the StreamBase application’s process, populating a shared data table so that other portions of the application can lookup data based on key values

StreamBase also features a graphical rapid-development environment, called StreamBase Studio. It lets you design, test, and deploy streaming applications. StreamBase users report that by using StreamBase Studio, their development teams are able to build streaming applications in less time and at lower costs, when compared with their efforts to create or redesign streaming applications.

스트림베이스는 StreamBase Studio라는 그래픽 기반으로 빠른 개발환경이 특징입니다. StreamBase Studio는 디자인하고 테스트하고 스트림 어플리케이션을 배치하는데 도움을 줍니다.  사용자들이 말하길…. 옛날에 쓰던걸 스트림베이스로 다시 만들어보니 더 짧은시간에 더 낮은 비용으로 만들수가 있었다고 하네요.

————————————————————————————————————————-

How Will StreamBase Help Me Do My Job? 스트림베이스가 내 일에 어떤 도움을 줄까?

For developers and administrators, StreamBase provides graphical, text-based, and command-line tools to build streaming applications quickly and efficiently. 스트림베이스는 빠르고 효율적.

In StreamBase Studio, a collection of views called the SB Authoring perspective lets you design the StreamBase application either graphically, using the text-based StreamSQL language, or with a combination of both. As part of this design step, you define properties for the operators and other components that will apply your business logic on the inbound data. We’ll discuss the SB Authoring perspective’s features in the next section. 스트림베이스 내의 SB Authoring perspective라는 콜렉션은 그래픽언어와 텍스트기반StreamSQL언어를 사용하여 또는 둘다를 사용하여 개발할 수 있게 해 준다.  설계단계에서 비지니스로직의 인바운드데이타 처리에 사용할 연산자와 컴포넌트들을 선언해야한다. 그럼 우리 다음 시간에 SB Authoring perspective의 특징에 대해 말해볼까?

Whether you are developing the application on Windows or Linux, you can use StreamBase Studio to start a StreamBase Server instance. The StreamBase Server loads the application, processing the inbound data according to your definitions in the operators, and responding to any other requests, such as requests for data from Java, C++, or .NET clients that you write. The StreamBase Client Libraries are documented, and we provide examples of writing enqueuer clients (sometimes called producers) that feed data into the application, and dequeuer clients (sometimes called consumers) that accept data from the application for further processing.

 

Once the server is started, StreamBase Studio provides a second perspective, Test/Debug, that contains tools to enqueue or dequeue data on the running application, or run a debugger to pause the application and step through its processing units, or view performance statistics.

Finally, StreamBase provides Client libraries for Java, C++, and on Windows, .NET, that you can use to develop client applications that enqueue to (or dequeue data from) StreamBase applications.

The following diagram illustrates the StreamBase development cycle and platforms.

StreamBase Development Cycle

————————————————————————————————————————-

StreamBase Components and Terms 스트림베이스 컴포넌트와 규정

So far you have learned that StreamBase Studio has a graphical development environment for building StreamBase applications. Let’s take a closer look at the product’s components and terms.

To begin with, what is a stream? A stream is a sequence of data records called tuples. A tuple is similar to a row in a database table. In a high-volume streaming application, the streams flow into the application and are processed in real time, before any (optional) on-disk storage occurs. The tuples in a stream have a schema, which defines each field’s name, position, data type, and size. A field is simply a named value in a tuple, such as a stock’s Symbol in a trade record. A field is similar to a column in a database table. The following diagram illustrates a stream of data containing tuples:

During the course of processing streaming data, you can add, remove, or modify the fields that comprise the tuples, in a highly dynamic fashion. In other words, the initial schema of the stream does not determine its contents during the entire processing execution. 스트리밍 데이터가 처리되는 동안에 튜플을 구성하는 필드를 신나게~ 더하고 빼고 고치는게 가능하다. 다시말해서…. 스트림의 초기 스키마를 보고 프로세스가 끝난 다음의 형태를 알 수는 없다.

Of course, an important step in building any application is determining which fields will comprise the inbound data, how that data should be organized, named, and typed (examples: string, int, long, boolean, double, timestamp), and usually which field(s) will contain key values. Often, though, you have already made those metadata decisions for your existing applications, and you want to know how to define the schemas for StreamBase. We will introduce the schema definition steps later in this tutorial. For now, notice how in the screen below the schema for an application component is defined:

당연히… 어플리케이션을 만드는 가장 중요한 단계는 어떤필드를 인바운드 데이터에 포함시킬까 하는것이다. 이것들을 어떻게 만들어줄지 string, int, long, boolean 등등 뭘로 저장할지… 키값은 어떻게 될지….

이런것은 너의 어플리케이션에서 이미 정의되어 있겠지?(아닌데요). 다음튜토리얼에서 이런것들을 어떻게 하는지 배워볼까? 먼저 지금은.. 스키마의 어플리케이션 컴포넌트가 어떻게 정의되는가나 봐 둬.. 밑에그림

The sample screen above is a peek at just one of many features in StreamBase Studio, our graphical development environment. Let’s take a step back, though, and learn how data gets into a StreamBase application.  위의 샘플화면은 스트림베이스 그래픽개발환경의 몇 가지 특징을 보여준다.

————————————————————————————————————————-

How Does Data Get into StreamBase? 데이터를 어떻게 스트림베이스에 넣어줄까?

The entry points for a StreamBase application are called input streams. Your application may define one or more input streams. The previous sample screen showed the schema definition for a StockIn input stream. But how is data sent to a named input stream? The options are:

스트림베이스에 데이터를 넣는 구멍은 들어가는 구멍(input streams)이라고 부른다.  너의 어플리케이션은 한개이상의 input streams를 갖겠지…

위의 그림은 보여준다. (뭐를?) 스키마를… 정의된… ~을 위해서 StockIn input stream. 근데 데이터는 어떻게 넣는거지? 옵션은:

  • From an adapter program that performs the conversion from an external source (such as a stock market data feed) into the StreamBase protocol. For example, StreamBase provides an adapter that converts TIBCO® Rendezvous™ messages into StreamBase tuples, and vice versa. 스트림베이스는 TIBCO® Rendezvous™라는 어뎁터를 제공한다. 이걸 통해서 넣고 빼고 한다.
  • From an enqueue client program (Java, C++, or .NET) that submits inbound data to one or more input streams defined in your StreamBase application. A client extends the documented StreamBase Client library to interact with a running StreamBase application. JAVA, C++, or .NET으로 만든 enqueue용 손님client프로그램을 이용해서 만든다
  • From an external database connected to your StreamBase application, using SQL queries to read the data. Currently you can connect to a JDBC database. This method enables your application to work with long-lived (historical) data along with the streaming data from its input streams. 외부 데이터베이스 연결은 JDBC를 통해 SQL쿼리를 이용한다. 역사적 데이터를 이용할 때 쓰는거…
  • And you can use StreamBase commands in terminal windows to perform an even greater level of enqueuing operations with running applications. 커맨드라인을 쓰라는데… 몬소린가 이거…이렇게 하면 성능이 이분 더빨라진다고? – 별 중요한것은 아닌듯… 어차피 이렇게는 안할테니까..
  • While designing your application, you can use a graphical feature of StreamBase Studio, called the Feed Simulation Editor, to submit randomly generated data or pre-recorded data from an input file such as a comma-separated value (CSV) file. The Feed Simulation Editor includes defaults or customized settings to control the rate of inbound test data. Feed Simulation Editor을 통해서… CSV파일같은걸로 가져다 쓴다. – 간편하지만.. 실시간에는 적합하지 않을듯…

————————————————————————————————————————-

How Do I Get Data from StreamBase? 스트림베이스에서 데이터 꺼내쓰려면?

You can define output streams that serve as named exit points in your StreamBase application. There are several ways to perform dequeue operations:

스트림베이스 어플리케이션에서 exit points 를 쓰면된다. 몇 가지 방법이 있는데…:

  • Using an adapter program that can return the processed data from StreamBase to the original external source.
  • Using a dequeue client program that listens for outbound data on the application’s streams. A client can be written in Java, C++, or .NET, extending the documented StreamBase Client library to interact with the running application.
  • Using insert or update queries to an external JDBC-compliant data source that is connected to your StreamBase application.
  • You can also use a graphical feature of StreamBase Studio to view the Application Output.
  • And you can use a StreamBase command to dequeue tuples from streams.

위에 나온 방법과 동일한듯… 반대로 하면 되겠지

The following high-level diagram illustrates the different ways that data can enter and exit a running StreamBase application.

Data In and Out of a StreamBase Application

In the preceding diagram, note that the StreamBase adapters are available separately from the StreamBase base kit, and each adapter has its own installation procedure.

————————————————————————————————————————-

StreamBase Studio Development Environment 개발환경

StreamBase Studio supports both graphical and text-based application development:

그래픽환경과 텍스트 환경을 지원한다.

  • EventFlow applications are XML files that are edited graphically using StreamBase Studio’s EventFlow Editor. 이벤트 플로우 어플리케이션은 XML형태로 돼 있는데 그래픽환경으로 처리
  • StreamSQL applications are coded using a query language to describe the application and query streams of data. StreamSQL Applications are stored in text files with an .ssql extension. 스트림SQL어플리케이션은 query language로 돼 있는데 텍스트환경편집 필요

You can also build parts of applications – modules – that can be included as components in other applications. In fact, any EventFlow or StreamSQL application can be used as a module in another application. 모듈형태로 만들 수 있으니까 쪼개서 만들어서 재활용해라~

————————————————————————————————————————-

Building EventFlow Applications 이벤트 흐름 어플리케이션 만들기

To create an EventFlow application in StreamBase Studio, you can drag and drop the icons for various components from a Palette View to the EventFlow Editor’s drawing canvas. As noted earlier, the components include: 이벤트 플로우 어플리케이션을 만들려면 컴포넌트를 드래그앤드롭하면 돼~ 내가 말 했지? 컴포넌트 이런거가 있어~ …..라는데요.

  • Input streams and output streams. 입구. 출구.
  • Operators that can apply your business logic on streaming data, such as aggregating tuples, or merging tuples, or retrieving data from a table. Each operator performs the work that you specify in its Properties view.
  • Data constructs that store information used by an associated StreamBase operator. For example, Query operators are associated with Query Table data constructs. 데이터를 구성하려면 StreamBase operator을 이용해서 해야돼. 예를들어 Query operators는 Query Table data operator을 모아놓은거야.. .. (이게 몬소린지…)  오퍼레이터를 활용해서 데이터를 축적하라는 말인듯…

We will use some of these components during the tutorial, and you can read more about them in the Authoring Guide.

튜토리얼 하면서 이런 컴포넌트를 다 써 보게 될거야… 설명서에서 컴포넌트에 대해 더 읽어볼 수 있어.

Here’s an illustration that shows the drag and drop step, from the left-side Palette to the EventFlow Editor’s drawing canvas.

드래그앤드롭 하는 방법… ..얼마나how 친절kind 눡덜youare

Once a component is placed on the canvas, you define its runtime behavior by setting parameters and (for most components) defining expressions in the Properties View. In the next screen, we have selected the Update_Bids_and_Asks Query operator in the EventFlow Editor to open its Properties view. In the General tab, we can change the name of the selected operator and add a description that documents our design. We can use the other tabs to define the behavior of the component.

 

————————————————————————————————————————-

Building StreamSQL Applications

StreamSQL어플리케이션 만들기

If you prefer to work with SQL queries instead of boxes and arrows, you can build applications using StreamSQL. StreamSQL will look familiar to SQL programmers, but there are some important differences. While SQL operates on tabular data that is stored somewhere on disk or in memory, StreamSQL supports operations on streams of continuously changing data. The two application formats are functionally equivalent; in fact StreamBase Studio provides a utility that converts EventFlow sbapp files to StreamSQL ssql files.

SQL쿼리도 그림으로 처리하고싶으면 StreamSQL을 만들어…. StreamSQL은 기존 SQL이나 비슷해… 근데 쪼오금 다른점이 있지…

기존 SQL은 정리된 데이터를 대상으로 했지만 StreamSQL은 동적인 데이터를 대상으로 한다는점. 두 어플리케이션의 형식은 같다; 스트림베이스는 sbapp파일을 ssql파일로 변환하는 툴을 제공한다.

You can use any text editor to write StreamSQL applications. However, coding in StreamBase Studio offers several advantages:

StreamSQL을 메모장 같은 텍스트에디터로도 할 수 있는데… 바보가 아닌한…. 누가 그럴라고 ..편한이유 읽어볼 필요도 없을듯

  • The SB Authoring perspective includes a StreamSQL editor that facilitates writing StreamSQL queries. The editor’s Content Assist feature makes entering keywords easy, and StreamBase checks your syntax as you work. 키워드를 쉽게 찾아준데
  • StreamBase Studio views make it easy to combine StreamSQL applications and other StreamBase components. For example, you might want to reference a StreamSQL application within a StreamBase EventFlow application. Or, going the other way, you might embed existing StreamBase applications as modules within a StreamSQL query. 아이 편해

The following image shows the StreamSQL Editor in the SB Authoring perspective:

이 그림이 뭔지는 보면 알겠지…:

————————————————————————————————————————-

Applications As Modules 모듈화프로그래밍

As we mentioned earlier, an EventFlow or StreamSQL application can be used as a module in another application. For example, you can create an application that performs a common task, and include it in any number of other applications. This reuse can save time in both development and maintenance. Obviously, the functionality in the module must make sense for the application that uses it. For example, both must use compatible data.

내가 말했지? 이벤트 플로우나 스트림SQL이나 이런거 다 모듈로 만들어서 딴 어플에 쓸 수 있다고. 예를들어서 ………………………………예를들필요있나… 프로그램 해봤음 다 알잖아… 모듈화 코드재사용 객체지향

If you are working on an EventFlow application, StreamBase Studio lets you simply drag an existing application from the Package Explorer to the canvas of the EventFlow Editor. In the following figure, an StreamSQL module has been added:

StreamSQL을 만들고나서… 이렇게 긁어넣으면 이렇게 들어가는거야

If you are writing a StreamSQL application, you can include an existing application as a module.

StreamSQL어플리케이션 만들어놓은고… 화면에 긁어넣어.

 

————————————————————————————————————————-

Summary and Next Steps 다음장으로….

We have covered some of the key StreamBase components and terms, and the ways in which you can create applications. It’s time to start using the tool. You can learn much more about the product by following the remaining topics in this guide, where you will have an opportunity to build your first StreamBase application.

To get started, click Next.