How to use SAP HANA smart data streaming – in six steps
As you probably heard, SAP HANA smart data streaming is a new HANA capability introduced with SAP HANA SPS09. This is an optional capability that can be added to a HANA system to add high-speed real-time event stream processing, with the ability to capture raw or derived streams in the HANA database as well as to perform real-time complex event processing for low latency (sub-second) “sense and respond” scenarios.
This white paper provides a technical overview of smart data streaming, how it can be used, how it scales, and the basic features of the server and the CCL language. But here I’d like to provide a quick overview of the six steps you need to take to put this new capability to work.
1. Download it and install it in your HANA system landscape
Smart data streaming is an optional component and is not installed by default on a HANA system. Download the smart data streaming from SAP Service Marketplace (look under “H” for HANA, and then you’ll see SAP HANA smart data streaming”). This HANA Academy tutorial will show you how.
Note that smart data streaming requires and additional license. If you aren’t licensing for smart data streaming, talk to your SAP representative.
2. Download and install the streaming plug-in for HANA Studio
From the “support packages and patches” section of Service Marketplace. Look under “H”, go to SAP HANA smart data streaming, and then “Comprised software component versions” and choose “Smart Data Streaming Studio 1.0”
Watch one of these HANA Academy tutorials for installation instructions: this one is for installing the streaming plugin when you install HANA Studio; this one is to add the streaming plugin to an existing HANA Studio installation.
Important: you need to be using HANA Studio 2 (the new version delivered along with HANA SPS09)
You’ll then want to follow the steps in these tutorials to configure the studio plugin, include connecting it to a streaming server, and then add a data service definition so that your streaming project(s) can query and write to the HANA database
3. Build a streaming project
Streaming projects are written in CCL – continuous computation language – which is the event processing language used by smart data streaming. CCL is derived from SQL – so it’s easy to learn, and it also includes a powerful scripting language called CCL Script that can be used to define complex operations that go beyond basic SELECT statements.
The streaming plugin for HANA Studio includes both a CCL editor as well as a visual editor – you can work in either and switch between them at any time to view and edit your project. Check out this HANA Academy tutorial that takes you through the steps of building a simple project using the streaming visual editor in HANA studio.
4. Connect your project to one or more data sources
Smart data streaming includes a number of input and output adapters that can be used to attach streaming projects to data sources and data destinations. These include adapters for message buses, web services, files, sockets, email and others. It also includes a web service provider that exposes streams as web services, with support for REST, SOAP and WebSockets, allowing client applications to easily connect via http.
And the HANA output adapter is used to connect any stream or window in a streaming project to a HANA table, such that the data flows directly from the stream into the connected table in the HANA database – continuously.
5. Test your streaming project
The streaming plugin for HANA Studio includes two perspectives, the streaming development perspective and the streaming run-test perspective. The latter has a number of tools to make it easy for you to test your project before you deploy it on a production system. This tutorial video takes you through the most basic steps, using the playback tool to stream in test data from a file and the stream viewer to view the output. Other tools include: manual input, event tracer, performance monitor (for tuning) and a debugger (set breakpoints)
6. Deploy your streaming project
When you’re finished testing your project, while you can run it from the studio, if you are connected to a streaming server, more typically for a production system you would put it into the HANA repository and then activate it from there or include the streaming project(s) in a HANA Delivery Unit.
Visit the Smart Data Streaming Developer Center for more information or to ask questions or share your ideas.