SAP HANA Markus Fath, SAP HANA Product Management June 2013
Agenda What is SAP HANA? How do I use SAP HANA? How can I develop applications on SAP HANA? That s it? 2013 SAP AG. All rights reserved. Public 2
What is SAP HANA? SAP HANA is an in-memory data platform that is deployable as an onpremise appliance, or in the cloud. It is a revolutionary platform that s best suited for performing real-time analytics, and developing and deploying real-time applications. At the core of this real-time data platform is the SAP HANA database which is fundamentally different than any other database engine in the market today. 2013 SAP AG. All rights reserved. Public 3
What is SAP HANA? In-memory database hardware - 8 CPU*10 cores, 1TB RAM software - column store, compression, partitioning 3B scans/s/core, 12.5 aggregations/s/core Analytics real-time analyze as data keeps rolling in agility logical views Applications integrated, lightweight application server 2013 SAP AG. All rights reserved. Public 4
What is SAP HANA? Side-by-Side Scenarios (2010) Agile Data Marts Real-time Operational Reporting SAP BW on HANA (2011) SAP HANA as primary persistence SAP NW Application Server on HANA SAP HANA as data platform (2012) SAP HANA for SAP Business Suite SAP HANA for custom applications 2013 SAP AG. All rights reserved. Public 5
How do I use SAP HANA?
Storing data in SAP HANA SAP HANA speaks SQL. > CREATE SCHEMA ka; > CREATE TABLE ka.complaints (cmplid INT, ); > INSERT INTO ka.complaints VALUES (1, ); > SELECT cmplid, FROM ka.complaints; 2013 SAP AG. All rights reserved. Public 7
Storing data in SAP HANA Applications writing directly into SAP HANA Real-time replication using SAP LT Replication Service Data loaded from files using IMPORT / INSERT Message queue integration with Sybase ESP ][ ][ ][ Data loaded at certain events using Business Objects Data Services 2013 SAP AG. All rights reserved. Public 8
Using data in SAP HANA You define views, to make data easily accessible to everyone. 2013 SAP AG. All rights reserved. Public 9
Using data in SAP HANA Attribute View Calculation View T T T T Views enable real real-time computing by transforming data on the fly. T T T T T T T Table Analytic View 2013 SAP AG. All rights reserved. Public 10
Attribute View 2013 SAP AG. All rights reserved. Public 11
Analytic View 2013 SAP AG. All rights reserved. Public 12
Calculation View 2013 SAP AG. All rights reserved. Public 13
Using data in SAP HANA Query SELECT FROM WHERE Statement Processor Calculation Engine Execution plan Op Op Op Op Data Stores Views Op Op Op Op Persistency Layer Save Point Logs 2013 SAP AG. All rights reserved. Public 14
Using data in SAP HANA SAP Business Objects BI Analytical applications build with BI Suite products Apps on HANA Applications on any platform using SQL via ODBC/JDBC SQL, MDX Modeler Views Analytic Engine Calculation Engine Engines Tables SAP HANA Studio App Objects Store SAP HANA 2013 SAP AG. All rights reserved. Public 15
Using data in SAP HANA SAP Business Objects provides an entire suite of BI front-ends to access data in SAP HANA SAP Business Objects Crystal Reports SAP Business Objects WebIntelligence SAP Business Objects Analysis for MS Excel SAP Business Objects Explorer SAP Business Objects Visual Intelligence 2013 SAP AG. All rights reserved. Public 16
Developing for SAP HANA
SAP HANA Programming Model Paradigm Shift - Responsibilities in Runtime Layers Classic Application Server Layers HANA Native Applications Client Display pre-rendered UI Proprietary Protocol Application Server UI Rendering Application Logic DBI/DBSL, DB buffer Browser Complete UI Rendering HANA http(s), OData (pure data only) Extended Application Services Procedural Application Logic HdbNet (minimal data volume) Database SQL SQL Database Data-intense Application Logic 2013 SAP AG. All rights reserved. Public 18
SAP HANA Programming Model Technologies Presentation HTML5 / SAPUI5 Client-side JavaScript Browser Complete UI Rendering http(s), OData (pure data only) Control Flow OData Server-side JavaScript Data Processing SQL / Views / SQLScript Application Function Library (AFL) HANA Extended Application Services Procedural Application Logic Database HdbNet (minimal data volume) Data-intense Application Logic 2013 SAP AG. All rights reserved. Public 19
SAP HANA Native Applications SQLScript What is SQLScript? Interface for applications to access SAP HANA; extension of ANSI Standard SQL Language for creating stored procedures Declarative logic including SELECT queries, built-in Calculation Engine Functions Orchestration logic including Data Definition Language (DDL), Data Manipulation Language (DML), assignment, imperative logic SQLScript allows execution of data intensive calculations inside SAP HANA Eliminates need to transfer large amounts of data from the database to the application Maximum benefit from SAP HANA features such as fast column operations, query optimization and parallel execution Advantages (compared to SQL) Functions can return multiple results Complex functions can be broken down - modular programming, reuse, and understandability Functions can have parameters Supports local variables for intermediate results with implicitly defined types Provides control logic such as if/else 2013 SAP AG. All rights reserved. Public 20
SQLScript Code example using SQL CREATE PROCEDURE getcomplaintsaggsql ( in cmplid INTEGER, out o_complaints tt_complaints) LANGUAGE SQLSCRIPT SQL SECURITY INVOKER READS SQL DATA AS BEGIN /***************************** Write your procedure logic *****************************/ ta_complaints = SELECT CMPLID, MAKE, MODEL, CDESCR, COUNTER FROM "KA"."COMPLAINTS"; ag_complaints = SELECT MAKE, SUM(COUNTER) AS TOTAL_FOR_MAKE FROM "KA"."COMPLAINTS" GROUP BY MAKE; jo_complaints = SELECT T1.CMPLID, T1.MAKE, T1.MODEL, T1.CDESCR, T1.COUNTER, T2.TOTAL_FOR_MAKE FROM :ta_complaints AS T1, :ag_complaints AS T2 WHERE T1.MAKE = T2.MAKE; o_complaints = SELECT CMPLID, MAKE, MODEL, COUNTER, TOTAL_FOR_MAKE FROM :jo_complaints WHERE CMPLID = :cmplid; END; Q1 Complaints Q3 Q4 Result Q2 2013 SAP AG. All rights reserved. Public 21
Using data in SAP HANA Set Operations Operation Calculations on Data Business Function Calls R Procedure Calls Predictive Analysis Algorithms Operations can be all sorts of operations on data not just basic SQL operations but also more complex logic 2013 SAP AG. All rights reserved. Public 22
SAP HANA Application Function Library What is Application Function Library (AFL)? Set of native, pre-built, parameter-driven, commonly used algorithms Optimized for performance Functions can be called from SQLScript The Business Function Library (BFL) contains algorithms primarily related to finance Stock Flow, Lease, Depreciation, Discounted cash flow, Inflated cash flow, The Predictive Analysis Library (PAL) contains algorithms primarily related to predictive analysis and data mining Regressions, KNN, k-means, Exponential Smoothing, Apriori, 2013 SAP AG. All rights reserved. Public 23
SAP HANA Programming Model Technologies Presentation HTML5 / SAPUI5 Client-side JavaScript Browser Complete UI Rendering http(s), OData (pure data only) Control Flow OData Server-side JavaScript Data Processing SQL / Views / SQLScript Application Function Library (AFL) HANA Extended Application Services Procedural Application Logic Database HdbNet (minimal data volume) Data-intense Application Logic 2013 SAP AG. All rights reserved. Public 24
SAP HANA Extended Application Services What are Extended Application Services? Small footprint application server / web server for application development inside SAP HANA Enable application development and deployment while minimizing architectural layers Create apps that have an http-based UI (browser, mobile apps) Apps run directly on SAP HANA, w/o additional external servers or components simplified system architecture; low TCO Tight integration with SAP HANA DB best possible performance Scope Lightweight web-based applications Complex Enterprise Business Applications 2013 SAP AG. All rights reserved. Public 25
SAP HANA Extended Application Services OData Service Implementation 2013 SAP AG. All rights reserved. Public 26
SAP HANA Extended Application Services JavaScript Service Implementation var isearchterm= $.request.parameters.get('searchterm'); var output = ''; var list = []; function createentry(rs){ return { "CMPLID" : rs.getinteger(1), "MAKE" : rs.getstring(2), "MODEL" : rs.getstring(3), "CDESCR" : rs.getstring(4) }; } var query = "SELECT CMPLID, MAKE, MODEL, CDESCR FROM \"KA\".\"COMPLAINTS\" " + "WHERE CONTAINS (CDESCR,?) ORDER BY SCORE() DESC LIMIT 10 "; var dbconn = $.db.getconnection(); var stmt = dbconn.preparecall( query ); stmt.setstring(1, isearchterm); stmt.execute(); var result = stmt.getresultset(); while (result.next()) { list.push(createentry(result)); } result.close(); stmt.close(); dbconn.close(); output = JSON.stringify( {"entries": list } ); $.response.setbody(output); $.response.contenttype = 'text/json'; 2013 SAP AG. All rights reserved. Public 27
SAP HANA Programming Model Technologies Presentation HTML5 / SAPUI5 Client-side JavaScript Browser Complete UI Rendering http(s), OData (pure data only) Control Flow OData Server-side JavaScript Data Processing SQL / Views / SQLScript Application Function Library (AFL) HANA Extended Application Services Procedural Application Logic Database HdbNet (minimal data volume) Data-intense Application Logic 2013 SAP AG. All rights reserved. Public 28
SAP HANA SAPUI5 SAP UI development toolkit for HTML5 (SAPUI5) is a cross-browser JavaScript library for building rich internet applications. 2013 SAP AG. All rights reserved. Public 29
SAP HANA SAPUI5 //Create an instance of the table control var otable = new sap.ui.table.table({ title: "Complaints", visiblerowcount: 10, firstvisiblerow: 1, columnheaderheight: 30, navigationmode: sap.ui.table.navigationmode.paginator }); //Define the columns and the control templates to be used otable.addcolumn(new sap.ui.table.column({ label: new sap.ui.commons.label({text: "ID"}), template: new sap.ui.commons.textfield().bindproperty("value", "CMPLID"), sortproperty: "CMPLID", filterproperty: "CMPLID", width: "50px" })); otable.addcolumn(new sap.ui.table.column({ label: new sap.ui.commons.label({text: "Make"}), template: new sap.ui.commons.textfield().bindproperty("value", "MAKE"), sortproperty: "MAKE", filterproperty: "MAKE", width: "50px" }));... //Create a model and bind the table rows to this model var omodel = new sap.ui.model.odata.odatamodel("../data/complaints.xsodata/", false); otable.setmodel(omodel); otable.bindrows("/complaints"); otable.placeat('result'); 2013 SAP AG. All rights reserved. Public 30
SAP HANA Studio Development Perspective and Repository Environment for building native HANA applications Developing Testing Debugging Supportability Lifecycle Management Application objects are stored in the repository Versioning Packaging Transport 2013 SAP AG. All rights reserved. Public 31
What else?
Using data in SAP HANA HANA Search UI Search UI configured with the Info Access (InA) toolkit for HTML5 running natively on SAP HANA HANA App built with SAPUI5 Application running natively on / against SAP HANA SAP Business Objects BI Analytical applications build with BI Suite products Apps on HANA Applications on any platform using SQL via ODBC/JDBC SQL, MDX Info Access (InA) Service server-side JS, OData Extended Application Services Modeler, Dev. Workbench Views Procedures JS code Search Engine Analytic Engine Calculation Engine Engines Tables Linguistic Processing Entity, Fact Extraction SAP HANA Studio App Objects Store Preprocessor SAP HANA 2013 SAP AG. All rights reserved. Public 33
SAP HANA Fulltext Search and Text Analysis Capabilities Native full text search In-database text analysis Graphical modeling of search models Info Access (InA) toolkit for HTML5 UIs Benefits Exploit unstructured content in SAP HANA without additional costs Extract meaningful information from text Combine structured and unstructured information for unified information access Less data duplication and movement leverage one infrastructure for analytical and search workloads Speed up HTML5 application development InA toolkit 2013 SAP AG. All rights reserved. Public 34
SAP HANA Search Model Example 2013 SAP AG. All rights reserved. Public 35
SAP HANA Info Access (InA) toolkit for HTML5 2013 SAP AG. All rights reserved. Public 36
SAP HANA Text Analysis Source Table COMPLAINTS CREATE FULLTEXT INDEX FTI_COMPLAINTS ON COMPLAINTS(CDESCR) CONFIGURATION 'EXTRACTION_CORE' TEXT ANALYSIS ON; 2013 SAP AG. All rights reserved. Public 37
SAP HANA Text Analysis Downstream Processing Text Analysis results are stored in a table and therefore can be leveraged in all supported HANA scenarios Standard analytics Create Analytic Views and Calculation Views on top e.g. companies mentioned in news articles over time Data mining, predictive Use R, Predictive Analysis Library (PAL) functions e.g. clustering, time series analysis etc. Search Based Applications Create a search model and build a search UI with the HANA Info Access (InA) toolkit for HTML5 Text Analysis results can be used to navigate and filter search results e.g. people finder, search UI for internal documents 2013 SAP AG. All rights reserved. Public 38
Use Cases Real-time analytics on large data volumes Financials Production planning, monitoring Sales optimization Combine structured and unstructured information Patent research Consumer sentiment analysis, brand monitoring Healthcare 2013 SAP AG. All rights reserved. Public 39
How to get started
SAP HANA Developer edition For product evaluations, trials, students, data exploration projects, etc. Software is free, developers pay cloud provider for server usage. Focused on small- to mid-sized data footprint, with non-productive use only Community supported through http://saphana.com/cloud Available of choice on 4 public cloud providers http://developers.sap.com/hana 2013 SAP AG. All rights reserved. Public 41
Additional Resources http://developers.sap.com/hana 30 days trial, development community http://www.saphana.com/welcome Additional information, e.g. use cases http://www.saphana.com/community/implement/hana-academy Videos and courses http://help.sap.com/hana_appliance/ Online documentation, e.g. Developer Guide 2013 SAP AG. All rights reserved. Public 42
Thank you Contact information: Markus Fath SAP HANA Product Management markus.fath@sap.com