You are on page 1of 45

DEV203 Developing Cloud-Native Apps

on SAP HANA Cloud Platform

Public
Speakers

Las Vegas, Sept 19 - 23 Bangalore, October 5 - 7 Barcelona, Nov 8 - 10

Matthias Steiner Abhik Gupta Rui Nogueira

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 2


Disclaimer

The information in this presentation is confidential and proprietary to SAP and may not be disclosed without the permission of
SAP. Except for your obligation to protect confidential information, this presentation is not subject to your license agreement or
any other service or subscription agreement with SAP. SAP has no obligation to pursue any course of business outlined in this
presentation or any related document, or to develop or release any functionality mentioned therein.

This presentation, or any related document and SAP's strategy and possible future developments, products and or platforms
directions and functionality are all subject to change and may be changed by SAP at any time for any reason without notice.
The information in this presentation is not a commitment, promise or legal obligation to deliver any material, code or functionality.
This presentation is provided without a warranty of any kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or non-infringement. This presentation is for informational
purposes and may not be incorporated into a contract. SAP assumes no responsibility for errors or omissions in this
presentation, except if such damages were caused by SAPs intentional or gross negligence.

All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially
from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only
as of their dates, and they should not be relied upon in making purchasing decisions.

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 3


Disclaimer II

Not your grandfathers SAP

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 4


Disclaimer II

Code Base: Enterprise Granny


(HCP Sample Best practices using Java Open-Source)

but your Grannys!


2016 SAP SE or an SAP affiliate company. All rights reserved. Public 5
Agenda

Intro
Context && definition of cloud-native
Platform
Services, Containers && compute units
Characteristics
Stateless && scaling, 12-factor apps
Cloud-native
Dev && Ops, Resilience
Microservices && APIs

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 6


Why cloud? Business Agility

Time to market Fast innovation cycles

minimum
IDEA viable X.Y
product
Total cost of Continuous
development (TCD) delivery

re-use open source DevOps

APIs microservices culture

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 7


Adapt or else!

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 8


Cloud native?!?

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 9


Cloud native: 1/2

[...] There is a rough consensus on many Cloud Native traits. Containers as an atomic unit, for
example. Micro-services as the means of both construction and communication. Platform
independence. Multiple language support. Automation as a feature of everything from build to
deployment. High uptime. Ephemeral infrastructure (cattle not pets). And so on. [...]

- Stephen O'Grady (RedMonk)

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 10


Cloud native: 2/2

Cloud native systems will have the following properties:

(a) Container packaged. Running applications and processes in software containers as an isolated unit of
application deployment, and as a mechanism to achieve high levels of resource isolation. Improves overall
developer experience, fosters code and component reuse and simplify operations for cloud native applications.

(b) Dynamically managed. Actively scheduled and actively managed by a central orchestrating process.
Radically improve machine efficiency and resource utilization while reducing the cost associated with
maintenance and operations.

(c) Micro-services oriented. Loosely coupled with dependencies explicitly described (e.g. through service
endpoints). Significantly increase the overall agility and maintainability of applications. The foundation will shape
the evolution of the technology to advance the state of the art for application management, and to make the
technology ubiquitous and easily available through reliable interfaces.

[Charter]

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 11


Cloud Maturity Model

- Microservices && APIs

- Resilience: (hystrix), monitoring,


logging, ex handling
- Dev && Ops
- Cloud agnostic (Spring Cloud Connectors)

- 12 factor apps

- Stateless && scaling

- Containers && compute units

- Platform && services

Source: Allan Beck & John McTeague (JPMorgan Chase & Co.)

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 12


SAP HANA Cloud Platform
Technical and Business Services
App Center New Apps / App Extensions

SAP HANA Cloud Platform (PaaS)


On-Premises /
SaaS
Managed 1

Cloud
Service Enablement | API Management

SAP S/4HANA SAP S/4HANA


Runtimes YaaS YaaS YaaS Dev
Business Services Commerce Marketing Service & SAP SuccessFactors
SAP Business Suite
Ops
Java SAP Cloud for
SAP Business
Warehouse
Platform Services Integration IoT Security Analytics
Customer
XSJS
UX Mobile Collaboration SAP Ariba
HTML5
Concur
Node.js1
Data & Storage SAP ASE Redis1
Big Data Services: SAP Fieldglass
Other1 Services
SAP HANA SAP HANA Vora1 /
PostgreSQL1 MongoDB1 Hadoop1 SAP Business
ByDesign

1
IaaS SAP Data Centers Customer Data Centers1
SAP HANA Cloud Platform, virtual machines1

1) planned innovations / future direction

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 13


SAP HANA Cloud Platform
Services && capabilities

Collaboration User Experience Integration Internet of Things Analytics

Security Mobile Data & Storage Business Services Dev & Ops

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 14


Containers && compute units

containers vs containers

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 15


Stateless && scaling

stateful communication preferably stateless


via cookies | url-rewriting communication

sticky session round robin


load-balancing load-balancing

local session
state

poor scaling/
resource consumption
X X no | shared state
Horizontal scaling

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 16


The 12-factor app [http://12factor.net/]

I. Codebase
- One codebase tracked in revision control, many
deploys
(
VII. Port binding
- Export services via port binding )
VIII. Concurrency
II. Dependencies - Scale out via the process model
- Explicitly declare and isolate dependencies
IX. Disposability
III. Config - Maximize robustness with fast startup and
- Store config in environment graceful shutdown

IV. Backing Services X. Dev/prod parity


- Treat backing services as attached resources - Keep development, staging, and production as
similar as possible
V. Build, release, run
- Strictly separate build and run stages XI. Logs
- Treat logs as event streams
VI. Processes
- Execute the app as one or more stateless processes XII. Admin processes
- Run admin/management tasks as one-off
processes

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 17


I. Codebase
- One codebase tracked in revision control, many deploys

git
single repo - single app (1:!)
shared-code via libraries &
explicit dependency handling
feature branches

Source: http://12factor.net/codebase

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 18


II. Dependencies
- Explicitly declare and isolate dependencies

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 19


Dependency Management (Java) [http://bit.ly/neogitmaven]

recipe

<repositories/> shops

<dependencies/> ingredients

cooking
<build/>
instructions

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 20


III. Config
- Store config in environment

Strict separation of config from code


(configuration varies across deploys, code base is the same)

e.g.
store config as environment variables (12-factors) - VCAP_SERVICES
destination service
Spring Cloud Config

/**
* Detects the current landscape the application is run on and initializes the Spring {@link ApplicationContext} accordingly.
*
* @see ApplicationContextInitializer
*/
public class EnvironmentContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext>

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 21


Spring: environment && profiles

<beans profile="local" >


strict separation
<jee:jndi-lookup of config
id="dataSource" from code
jndi-name="java:comp/env/jdbc/DefaultDB" />
</beans>config varies across deploys, code is the same

<beans profile="cloud">
e.g.
<cloud:data-source id="dataSource"/>
</beans> store config as environment variables (12-factors)
destination service
Spring Cloud Config
<beans profile="test">
<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource>
<property
/**
name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="url"
* Detects value="jdbc:derby:memory:DemoDB;create=true"/>
the current landscape the application is run on and initializes the Spring {@link ApplicationContext} accordingly.
*
<property name="username" value="demo"/>
* @see ApplicationContextInitializer
<property
*/ name="password" value="demo"/>
public class EnvironmentContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext>
</bean>
</beans>

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 22


IV. Backing Services
- Treat backing services as attached resources

messaging,
social
queing,
tech business networks
scheduling APIs
services services

mail, proxies lookup


push notifications, networks discovery business
iot security (auto-) wiring networks

dependency injection

connectivity,
digital
integration,
marketplaces
orchestration
In-memory Relational NoSQL

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 23


V. Build, release, run [http://bit.ly/saphcp_ci]
- Strictly separate build and run stages

http://bit.ly/saphcp_jenkins
http://bit.ly/saphcp_travis-ci
http://bit.ly/saphcp_di
2016 SAP SE or an SAP affiliate company. All rights reserved. Public 24
VI. Processes
- Execute the app as one or more stateless processes

preferably stateless
communication

round robin
load-balancing

no | shared state
Horizontal scaling
memcached | redis |

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 25


VIII.Concurrency [http://bit.ly/saphcp_elastic]
- Scale out via the process model

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 26


IX. Disposability
- Maximize robustness with fast startup and graceful shutdown

compute unit compute unit compute unit compute unit

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 27


X. Dev/prod parity
- Keep dev, staging, and production as similar as possible

= =

stubs (backing) services proxies

runtime | buildpacks | containers env

OS | vm

dev (local) staging prod


2016 SAP SE or an SAP affiliate company. All rights reserved. Public 28
XI. Logs
- Treat logs as event streams http://bit.ly/saphcp_logging

A twelve-factor app never concerns itself with routing or storage of its output stream. It
should not attempt to write to or manage logfiles. Instead, each running process writes its event
stream, unbuffered, to stdout. [...]

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 29


XII. Admin processes
- Run admin/management tasks as one-off processes

Separately, developers will often wish to do one-off administrative or maintenance tasks for
the app, such as:

Running database migrations [...]


Running a console [...] to run arbitrary code or inspect the apps models against the live
database [...]
Running one-time scripts committed into the apps [...]

http://bit.ly/saphcp_liquibase1
http://bit.ly/saphcp_liquibase2

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 30


Cloud agnostic

lookup
discovery
(auto-) wiring
dependency injection

(backing) services

runtimes| buildpacks | containers

SAP HCP

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 31


Spring Cloud Connectors [http://bit.ly/spring-cloud-sap]

lookup
discovery
(auto-) wiring
dependency injection

(backing) services

runtime | containers

SAP HCP

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 32


DevOps

development +
operations
2016 SAP SE or an SAP affiliate company. All rights reserved. Public 33
Resilience [hystrix Circuit Breaker]

Source: https://github.com/Netflix/Hystrix/wiki/How-it-Works
2016 SAP SE or an SAP affiliate company. All rights reserved. Public 34
Microservices: characteristics [http://martinfowler.com/articles/microservices.html]

Componentization via Services


Vertical cut (full-stack) based on biz domain vs traditional (silo-ed) functional teams
Granularity/size of micro-services
DevOps (products/services not projects), ownership over the full life-cycle
Smart endpoints (APIs/services) vs complex ESB
Decentralized Governance - SOA done right ?!?
Decentralized Data Management
Infrastructure automation
Design for failure
Evolutionary design

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 35


APIs [http://bit.ly/ensw_api]

An application programming interface (API) is a specification intended to be used as


an interface bysoftware components to communicate with each other.

- Wikipedia

https://api.sap.com

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 36


Exemplary: Architecture Blueprint (Java)

Presentation Layer

Cross-cutting concerns (XCC)


DTO

AOP REST Faade


Apache CXF (+(JAX-RS)
Olingo)
- Spring Framework Domain
Filters,
Business Logic Layer (Services)
JavaBeans Model
Interceptors,

Data Access

Connectivity
HTTP Client Persistence

Environment
Spring abstraction
Cloud Connectors

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 37


Questions && answers

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 38


Credits
Elderly Man icon designed by Peacock Dream on the @NounProject. https://thenounproject.com/term/elderly-man/9728
Elderly Woman icon designed by Peacock Dream on the @NounProject. https://thenounproject.com/term/elderly-woman/9727
Light Bulb icon designed by Takao Umehara on the @NounProject. https://thenounproject.com/term/light-bulb/14973
Sustainability icon designed by Diego Naive on the @NounProject. https://thenounproject.com/term/sustainability/219630
pull request icon designed by Richard Slater on the @NounProject. https://thenounproject.com/term/pull-request/116191
Dinosaur icon designed by Jennifer Cozzette on the @NounProject. https://thenounproject.com/term/dinosaur/13786
Dinosaur icon designed by Jennifer Cozzette on the @NounProject. https://thenounproject.com/term/dinosaur/13787
meteor icon designed by Erik Kuroow on the @NounProject. https://thenounproject.com/term/meteor/345452
Container hook icon designed by Korawan.M on the @NounProject. https://thenounproject.com/term/container-hook/496239
Browser cloud icon designed by Sergey Demushkin on the @NounProject. https://thenounproject.com/term/browser-cloud/534265
Load Balancer icon designed by Alex WaZa on the @NounProject. https://thenounproject.com/term/load-balancer/43671
network server icon designed by Chad Remsing on the @NounProject. https://thenounproject.com/term/network-server/530820
database icon designed by Rockicon on the @NounProject. https://thenounproject.com/term/database/524054
Cloud icon designed by Gregor renar on the @NounProject. https://thenounproject.com/term/cloud/232545
Share Cloud icon designed by LeftHandedGraphic on the @NounProject. https://thenounproject.com/term/share-cloud/66775
hosting icon designed by Gregor renar on the @NounProject. https://thenounproject.com/term/hosting/232489
Expansion icon designed by Magicon on the @NounProject. https://thenounproject.com/term/expansion/308097
Server icon designed by Creative Stall on the @NounProject. https://thenounproject.com/term/server/105040
Cloud icon designed by TukTuk Design on the @NounProject. https://thenounproject.com/term/cloud/53820

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 39


Demo

Public
SAP TechEd Online

Continue your SAP TechEd


education after the event!
Access replays of
Keynotes
Demo Jam
SAP TechEd live interviews
Select lecture sessions
Hands-on sessions

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 41


Further information

Related SAP TechEd sessions:


DEV101 - HANA Cloud Platform Now and the Road Ahead
DEV102 - Extending SAP Business Suite and SAP S/4HANA with SAP HANA Cloud Platform
DEV103 - Cloud LoB extensions with the SAP HANA Cloud Platform
DEV106 - Cloud Application Monitoring and Profiling: Implementation and Tools

ITM212 - Application Lifecycle Management for SAP HANA Cloud Platform


DEV205 - Using Cloud FoundryBased Features of SAP HANA Cloud Platform
DEV262 - Business Services for SAP Hybris as a Service on SAP HANA Cloud Platform

SAP Public Web


hcp.sap.com

openSAP
openSAP courses

Watch SAP TechEd Online


www.sapteched.com/online

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 42


Feedback
Contact information:
Please complete your
Matthias Steiner
session evaluation for Cloud Platform Evangelist
matthias.steiner@sap.com
DEV203

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 43


Thank you

Contact information:
http://twitter.com/steinermatt
Matthias Steiner
Cloud Platform Evangelist | SAP Mentor Alumnus http://scn.sap.com/people/steinermatt/
SAP HANA Cloud Platform
http://about.me/steinermatt
2015 SAP SE or an SAP affiliate company. All rights reserved. Public 44
2016 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate
company) in Germany and other countries. Please see http://www.sap.com/corporate-en/about/legal/copyright/index.html for additional trademark information and notices.

Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its
affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as
constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop
or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated companies strategy and possible future
developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time
for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-
looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place
undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2016 SAP SE or an SAP affiliate company. All rights reserved. Public 45