You are on page 1of 21

openSAP

SAP Cloud Platform Essentials (Update Q3/2017)


Week 3 Unit 1

00:00:07 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
1. This whole week will be all about persistence.
00:00:18 We will be working with the SAP HANA database on SAP Cloud Platform. We will also be
working with the document service available there.
00:00:25 And then we will look at what this looks like in the Cloud Foundry environment, the SAP
HANA database there, and then also some open-source databases available in the Cloud
Foundry environment.
00:00:38 This first unit is just an introduction to the week, so we will cover a bit of theory, and then we
will also continue with some more hands-on exercises.
00:00:49 So "Data & Storage" we saw already in the first week – an overview of the capabilities of
SAP Cloud Platform. This week will be about data and storage, so databases, data
management, and things like that.
00:01:07 So what actually are persistence and storage and why do we need them? Data and storage
services as a whole on SAP Cloud Platform give you the ability to store some of your data
persistently,
00:01:26 meaning we make sure that all of that data is backed up for disaster recovery and that kind
of thing – all that's done. We offer you databases as a service, for example SAP HANA as a
service,
00:01:39 but we also have SAP ASE and some open- source databases. What also falls in the area
of data and storage is document storage.
00:01:50 So not necessarily only databases, relational databases, but also ways in which you can
store documents like PDF files. You perhaps do not like to store them in a database.
00:02:05 Even with PDF files it might be okay, but if you have bigger video files, you probably would
not like to store them in a database. Then you use a document storage.
00:02:15 Also, in Cloud Foundry we have several open- source storage systems available, for
example an in-memory cache with Redis. There we also have PostgreSQL as a relational
database,
00:02:31 but also MongoDB, which is a database for NoSQL storage, but you can also use it to store
documents for example. What we ensure is that everything there is available, that the data
is available via the database's document service and so on.
00:02:52 We also take care of resilience for the databases so that from a pure, let's say, database
application standpoint, from pure database standpoints, that's taken care of.
00:03:05 You can manage your database via the cloud and, depending on the database, also via
Eclipse tools and that kind of thing, or via the command line, but via the cockpit, we offer
you a lot of functionality to manage your database.
00:03:19 You can do, for example, monitoring, you can send out alerts if certain thresholds are
reached. Backup and recovery we also take care of,
00:03:30 but, for example, if you're a customer and for some reason your application crashed and so
on, you could also initialize a backup, or a recovery of a backup more or less.
00:03:43 We also take care of load balancing. You can do a lot of configuration for your database via
the cockpit, for example – we will also be doing this – you can bind it to an application,
00:03:53 and via the database you can also isolate data in an application, between different
applications, but also between different users in the same application if necessary.
00:04:07 So what are the options that you have available? We have SAP HANA, so the SAP Cloud
Platform SAP HANA service.
00:04:16 SAP HANA is a relational in-memory database, it is highly optimized for read access, also
for OLAP, so analytical read access where it can also store the data in columnar storage.
00:04:34 There is then the benefit of compressing data and also very easily reading data. But you
can also use it for many processing and transactional... as a transactional database – it's
also optimized for that.
00:04:54 And then in the background, the SAP HANA appliance can manage how it handles that so
that part of your data can be optimized for write access, part of your data can be optimized
for read access, and so on.
00:05:08 And everything is in memory, meaning compared to a database, which stores everything on
disks, this is faster by a factor of 10 or so because you already store the data in memory.

00:05:24 So you store all your data in RAM, meaning if you have a bigger database, you have 1 TB
of RAM, and therefore access is usually quite fast.
00:05:34 Also SAP HANA gives you a lot of possibilities for creating stored procedures via SQLScript,
or also for using SAP HANA views or CDS for modeling in the database.
00:05:47 So a lot of database development capabilities are also included there. Then we have ASE –
adaptive server enterprise – which we acquired together with our Sybase acquisition.
00:06:01 It's a high-performance SQL database, also relational, but it's not an in-memory database,
meaning it's also cheaper. In the Neo environment, we also have our document service
available,
00:06:15 so very specifically a service that supports the CMS protocol and is there for you to store
documents. In Cloud Foundry, we also have the SAP HANA service available,
00:06:31 but additionally, we have several open-source storage solutions, like PostgreSQL, which is
a relational database management system, we have MongoDB for document-oriented
NoSQL storage, we have Redis as an advanced key-value cache.
00:06:49 So, for example, you might want to use leverage in a cloud-native application, which we
covered a bit in the application week, to save the state of your applications in that in-
memory cache so that you have stateless services.
00:07:06 And we also offer an ObjectStore which is based on Amazon S3. So if you now want to dive
a bit deeper into the theory, there's the capabilities page on our Web site, our
documentation...
00:07:25 At Sapphire 2017 in May this year, when the Cloud Foundry open-source services became
generally available and our overall Cloud Foundry offering became generally available,
00:07:37 we published a blog where you can read about all that we did there for data management.
And then you can have a look at our Data Management FAQ, where you'll find a lot of
answers to many questions you might have.
00:07:52 Otherwise, let's wrap up this unit, and then in the next units continue with some hands-on
experience with all of those services. So what did we cover in this unit?
00:08:03 We covered what data and storage means, what persistence options are offered on SAP
Cloud Platform, what's offered there in the Neo environment, and also what's offered there
in the Cloud Foundry environment.
00:08:16 That's it for this unit. Thanks a lot and see you in the next unit.

2
Week 3 Unit 2

00:00:07 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
2. Let's continue with the topic of this week: persistence.
00:00:18 So part 1 of the persistence service where we focus on SAP HANA and SAP ASE. So we'll
demonstrate it and focus mainly on SAP HANA, but it also works the same for SAP ASE.

00:00:31 So what can an administrator do on SAP Cloud Platform? An administrator manages


database systems, so he can create or monitor database systems, he creates databases or
tenants of a database,
00:00:49 he binds databases or tenants thereof to an application, he's also able to share databases,
meaning if you have a database in one subaccount, you might want to share that database
with another subaccount
00:01:03 so that you do not necessarily need another database in that other subaccount. That's one
option which you can also configure there.
00:01:13 SQL traces are also very interesting, so enabling the SQL traces in your application or
looking up your SQL traces in the logs,
00:01:22 meaning the connections from your application to the database, and then via that, you can
also analyze what the performance of the database connection is like.
00:01:34 And most of the administration, or some of the administration like bindings, creating a
database, and so on, happens via the cockpit, and then monitoring of the database and
other things inside the database would happen more or less via the HANA cockpit,
00:01:50 which you can access via the SAP Cloud Platform cockpit. So what is a database system?

00:01:57 A database system is a service that enables users to define, create, query, update, and
administer data. And here, the interaction is usually between an application and a database,

00:02:12 but it can also be between one application and multiple databases. And the database
system provides access to all the data contained in the database.
00:02:24 Examples of that are, of the persistence service, the SAP HANA service and the SAP ASE
service. A database is then a technical unit that contains the data.
00:02:36 You can also see that way you usually have a database system, or database management
system – DBMS in short – which manages one or more databases, and the data is then
actually stored in individual databases.
00:02:58 So what else does an administrator takes care We as the platform provider and the
database provider make new versions of the database available.
00:03:11 This means that an admin in the cockpit sees, for example, that a new version of HANA has
come but what we don't do is force upgrades of the database.
00:03:21 So we show you that a new version is available, but you do the update yourself. Meaning
you also have time to test your application in a DEV system or in a TEST system
00:03:35 with the new version of the database to make sure that everything runs fine, and only then
do you do the actual upgrade in your productive system. You can also install a couple of
components which are included with the database system.
00:03:52 Now perhaps the first step that you do to create a database. So let's switch to our cockpit.
00:04:01 I'm currently still logged in in the Cloud Foundry environment, so let's go back to "Home".
And then to "Europe (Rot) - Trial", so to the Neo environment in our trial region there.
00:04:16 Go to our account, then let's go to SAP HANA/SAP ASE... and then to "Databases &
Schemas"...
00:04:25 because as a productive customer or with enterprise accounts, and if I had licensed an SAP
HANA database, then here I would see my database system.
00:04:38 As a... just with the trial accounts, we don't have that option. With the trial accounts, we
have two things available to us – so let's delete that one.

3
00:04:50 We have schemas, meaning shared SAP HANA databases on which you can get access to
a schema. So, for example, with our HelloWorld application, when we created it,
00:05:02 a schema was automatically created in the background and became available to us. What is
the second option that we have already in the Neo environment?
00:05:12 In the Cloud Foundry environment, we only have this schema-based or HDI-container-
based approach. As it is, we have XS advanced and HANA too.
00:05:22 In the Neo environment, we also have the ability to get our own MDC container. So MDC
stands for "multitenant database container", and with that container, we get our own, let's
say, database in a database.
00:05:39 So you can have one big HANA system, and you can have multiple MDC systems in there.
In an MDC system, there you can get admin access, you can have all the configuration
tools, everything you can...
00:05:55 For you, it's transparent if this is an MDC system or if it was a fully dedicated HANA system.
So let's create such an MDC system.
00:06:09 We also have full admin access with the system user, and for that... we need to provide a
password.
00:06:19 "Web Access" important... oh... Oh, obviously my password is not strong enough.
00:06:45 So let's try that way. Okay, so we've now created our database system, or we created our
database, our MDC tenant,
00:06:59 and there you see my user, the time, the event "Create", so let's wait while this loads up.
Yeah, so it takes a bit of time until that is created because you really get your own dedicated
MDC system.
00:07:18 What you already see below here are links to the administration tools. So the SAP HANA
cockpit, which is specifically for monitoring and configuring SAP HANA, or that SAP HANA
system.
00:07:31 Also, the Web-based Development Workbench, which is for XS classic development, which
is available in the Neo environment. And also SHINE – SHINE stands for SAP HANA
Interactive Education, so a sample application.
00:07:47 But we won't dive deeper into these. So let's see what else is available.
00:07:56 Next are data source bindings. So data bindings – you can see that here – are very
important because they manage, just via configuration,
00:08:08 a binding from our database to our application, or also the other way around, usually from
our application to our database. Because with that, the application is able to access our
database.
00:08:24 And one feature which I already mentioned is that an administrator is able to share
databases. So if you now had an enterprise account, you would have a database in one of
your subaccounts.
00:08:38 You could share that database with another subaccount in the same global account. Also,
it's possible to share your database with a different global account.
00:08:50 The next point is SQL traces, which I've also mentioned. When you have a Java application
deployed which performs some database access,
00:08:58 via "Applications" and then "Monitoring" you can access "Logging" – you can also do that
via Eclipse, both options are possible – and then you take that SQL trace, you set it to
DEBUG, and then you can see all the SQL traces when you perform database access.
00:09:23 So, the database cockpit – let's also see what the status of our database is. Let's log in...
ah, it's still creating. Okay.
00:09:38 So the cockpit... we have the SAP Cloud Platform cockpit. and the SAP Cloud Platform
cockpit is for managing the SAP Cloud Platform and for administering that.
00:09:52 And then we have the SAP HANA cockpit. So if you already have an SAP HANA on-
premise installation, you might know that.
00:09:58 And there, that's a cockpit specifically for administering and monitoring SAP HANA. And
what we did here was also bring that cockpit together with the SAP HANA database into the
cloud

4
00:10:10 so that you also get all the features for monitoring and configuring your database in the
cloud, which you might know from on premise. So when that database creation is finished,
you can also access the SAP HANA cockpit here.
00:10:29 It might be that the user with which you are accessing that does not automatically have the
roles, so you might need to go via the Web-based Development Workbench and just add
the necessary roles
00:10:43 so that you are able to access the SAP HANA cockpit, but if that's the case, then all this is
explained in the documentation which is available there as well.
00:10:54 What further reading is there? Because actually, in this unit, we do not need to wait until our
database creation is finished
00:11:02 because only in the next unit will we then really use the database. So here the database
systems versus databases – to really understand that, it's explained in our documentation.
00:11:14 Also, many of the other points which we just discussed are explained in the documentation.
And then there are also two blog posts linked, on the MDC and also on sharing databases
across accounts.
00:11:32 So with that, we are at the end of this unit. In this unit, we mainly covered how to work with
the administrative capabilities of the persistence service,
00:11:44 of the SAP HANA service and the SAP ASE service, how to manage your database, how to
create a database.
00:11:50 We created our own HANA MDC tenant – that's a database that's available to us for a
couple of days, and then we get a notification or it's available for one workday more or less,
then it's shut down,
00:12:07 and then it's still available to us and still has our data for a couple more days, and if we don't
use it, it's deleted, but that's just on the trial landscape.
00:12:15 On a full productive landscape with enterprise accounts, it's your database, dedicated for
you, and all your data is always there. We also covered SQL tracing, sharing databases,
and the SAP HANA cockpit.
00:12:33 So with this, a last look here. That's still creating, probably for you as well now, so you can
continue with the self-test and then with the next unit.
00:12:42 Thanks a lot for this unit and see you in the next unit.

5
Week 3 Unit 3

00:00:06 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
3. And we will directly continue where we left off with our persistence service, specifically
the SAP HANA service there.
00:00:23 Last week we covered a lot about Java development. We saw that in the Cloud Foundry
environment as well as in the Neo environment.
00:00:31 Now when you develop such a Java application, there are multiple ways in which you can
leverage persistence together with those applications, because usually you would like to
store some data in a database.
00:00:44 The two main options there are to use either JPA 2.0 or JDBC. JPA stands for Java
Persistence API, and JDBC stands for Java Database Connectivity.
00:00:57 JPA is the framework, so the specification for a framework. The reference implementation
here is EclipseLink and that's also what we recommend and what we will be using in the
sample.
00:01:12 JPA really means that you don't have to write the actual queries to the database – that's all
taken care of for you by the framework. You just define some annotations and then that's
taken care of.
00:01:30 JDBC gives you more control, but therefore is more work. When it comes to performance,
like for most scenarios, JPA would be better because it's less work.
00:01:43 But for some scenarios where specific performance requirements are needed, or where you
need, for some reason, to write a query in specific way, JDBC might be the better option.

00:01:55 But for most projects, JPA will be the best option. Locally, we also included in our SDK an
Apache Derby database
00:02:08 which you use for mocking an SAP HANA database, more or less, or also the SAP ASE
database, so you mock the persistence service when you test in your Eclipse locally,
00:02:19 and when you deploy it to the cloud, then you actually leverage the database. So let's begin
with JPA – Java Persistence API, which I've already mentioned.
00:02:31 It provides developers with a mechanism to elegantly manage data persistence in an object-
oriented manner without having to write your own queries.
00:02:42 That's taken care of for you by the framework – you just put in your annotations. EclipseLink
is the recommend implementation.
00:02:51 And here you can download the PDF of the slides below and open that slide, click here on
the link, and then you are taken to our documentation where we have a tutorial on JPA,
which is also included in our SDK.
00:03:07 So let's dive right in there. First I will open our SDK.
00:03:14 We installed it last week – the SAP Cloud Platform Neo environment SDK for Java. Here,
that's the Tomcat 8 SDK. Let's just look into there. What's included here in the SDK?
00:03:29 We have our "java.doc", so the whole "java-doc" for the SDK. The "license", the "readme",
and then here, besides the tools, we also have some samples in our SDK.
00:03:42 And here you will find the "persistence-with-jpa" sample – later we will also use the
"persistence- with-jdbc" sample. Now, that's the sample which we want.
00:03:55 The next thing would be to click on the link here, and that then takes you to our
documentation. This here is the tutorial for JPA – "Adding Application-Managed Persistence
with JPA".
00:04:09 This is the sample and it's here in your SDK when you download that. Here are all the steps
that describe it.
00:04:19 You don't need to actually do them and we won't do them now, but those are all the steps if
you would like to write that application from scratch.
00:04:30 We won't do that now – we will just take the finished application from our SDK and deploy
that and test it. But if you want to read through it, you can have a look here.

6
00:04:43 So the sample application consists of a dynamic Web project, it has a servlet in there. Then
EclipseLink is used as the JPA implementation.
00:05:00 Then the application also has a Java persistence entity that's defined. So here a person is
the object that will be mapped into the database,
00:05:12 and you can then create persons and they have an ID, they have a first name, a last name,
and that kind of thing. You can add some metadata, then you can configure your project to
use JPA,
00:05:31 and then here you can actually put in the implementation for the persistence, and that's the
test if you test it locally,
00:05:41 and then here, that's actually what we will be doing now – we will be deploying the
application to the cloud. So switching over to my Eclipse, and then you can just do a right-
click, you choose "Import" and "Import...",
00:05:58 and then you could choose "Existing Projects into Workspace", "Next", and then you browse
to the location of your SDK,
00:06:07 and then into the "samples" folder, and you select the "persistence-with-jpa" sample. You
open that... and then here is the project, and then you can just finish and import it.
00:06:21 I've already done that here – let's just open the classes. We have here the servlet which
contains all the implementation, what's displayed in the Web, and also the usage.
00:06:36 For example, here the "createEntityManagerFactory" we just created contains all the code
that's necessary to connect to the data source and so on.
00:06:47 Then we have here our "Person" class which contains the annotations that are needed to
make it an entity so that it's mapped by the framework into the database.
00:07:03 Also, we have here in the "META-INF" folder a "persistence.xml" file. That file defines what
you actually use.
00:07:11 Here we have the property for the EclipseLink implementation that's used here for the JPA.
And then perhaps as the last thing, in "WebContent", "WEB-INF", there's the "web.xml" file.

00:07:26 And here the database is defined, and it's the default database. So in our application, we
don't define the database yet.
00:07:39 We created a database in the last unit and we will be using that database but it's not defined
in the application. What we will do is create in our cockpit the database binding which then
actually binds the application to our database.
00:07:54 So in the next step, now you have that application ready, you can click on the application, or
better still you can go to your servers view and then you create a new server by going to
"New" and "Server",
00:08:13 then you select "SAP Cloud Platform", you type in your region host,
"hanatrial.ondemand.com", click on "Next", then you type in your application name,
"persistence1", our first application,
00:08:32 and then you can put in the runtime, Java Web Tomcat 8 for example, you put in your
subaccount name, you put in your user name, your password,
00:08:42 again with the subaccount and the user name. Let's switch to our cockpit for a second.
00:08:48 Here at the top, you also see your subaccount name – for me that's this "p" with the
numbers and then "trial". "Trial" will always be at the end for the subaccounts on the trial
landscape of the Neo environment.
00:09:01 If you just want to see your user name, on the top right here, next to your logout, you can
find the "p" number – the user name. And then you just click on "Next" and you create that
server.
00:09:17 Now under "Java Applications", I've already created the server, "persistence1". And next I
need to go to my databases and "hana01" which we created in the last unit,
00:09:31 then I go to "Data Source Bindings" and then I just choose a new binding, and what you
then do, let's see here, when you create a new binding... sorry, that was one step too far.
00:09:49 When you create a new binding, you select the database, "Data Source: <default>" – you
leave that. That's actually the same as what we configured in our application.

7
00:10:01 Then you select your Java server, so it would be "persistence1". And then you type in the
database user and password.
00:10:07 So the database user is the user which we got when we created the database, so here I'm
just using the system user. That's fine for this demonstration – in a productive environment,
you would have a specific database user just for that binding.
00:10:22 "SYSTEM" user and... the password which you defined when you created the database. So
if it's wrong, the credentials are automatically verified.
00:10:36 That's fine – you create the database binding, and now you have your server and your
database binding. As the last step, you need to right-click on your server, go to "Add and
Remove...",
00:10:49 and then you need to add the "persistence-with- jpa" project to your server and click on
"Finish". Then that's deployed to the server, you start your server, and then your application
runs.
00:11:03 Let's have a look at the application, so let's go here again, "Java Applications",
"persistence1", and that's my application. So here, I can click on the URL and that's the JPA
sample.
00:11:18 The database is currently empty, that schema of the database, so I could put in my
colleague Rui, his name, I could add him to the database, and there it is, he was added to
the database: first name, last name, ID.
00:11:37 With the Java application, we also see here some requests, the CPU load, some events, we
could log our traces – so that's the JPA sample.
00:11:55 So let's go back to our slides... here. The project building blocks – I already mentioned
them.
00:12:04 We have our entity, so our "Person" object which has the annotations so that it works
together with the EclipseLink. We have our "persistence.xml" file which defines our
persistence unit.
00:12:16 In our "web.xml" file, we have the JNDI resource lookup for our "DefaultDB" which takes the
DB which we mapped with our database binding in the cockpit.
00:12:30 And then in the servlet we also have our "EntityManager" implementation which contains
the classes which are actually mapped by the framework to the "Person" object
00:12:43 to add a person entry for the person from our database. Now coming to JDBC – Java
Database Connectivity...
00:12:53 JDBC is similar to ODBC, but just for Java. Actually, you write your queries to the database
and therefore you also have more control.
00:13:05 We again have a tutorial available and a sample in the SDK, so let's switch over to the SDK
first... We had it here, that's the sample in the SDK.
00:13:20 And then here we also have the tutorial available for this – same, we will just import it. Also,
all the steps that you need to perform if you want to write it from scratch are explained here.

00:13:32 You can do that if you would like to, so let's just go through it. Again, we have our servlet,
we have a "Person" entity, similar to the last time,
00:13:44 and now we also have a "Person" database object. Now that's needed to actually be put in
the implementation to retrieve and put something into the database,
00:13:55 which was previously taken up by the framework. And here we now have our statements,
our queries to the database which we need to write ourselves.
00:14:10 Then preparing the Web application project – similarly, the same "DefaultDB"... that's all the
same. Here, the servlet implementation to use the persistence.
00:14:22 Testing locally – we won't do that right now but we will deploy it to the cloud as well. So
switching to our Eclipse, we can also... let's close that... again just click on "Import",
"Import...", "Existing Projects into Workspace",
00:14:40 and select here from our "samples" folder the "persistence-with-jdbc" sample. We can add
that again and click on "Finish" to import it.

8
00:14:53 Here, in "Java Resources", we again have a servlet which then creates our "Person"
database object here and also performs also the JDBC lookup.
00:15:07 Then here we again have here our "Person" class. Now, we don't have any of those
annotations because with JDBC they are not needed.
00:15:15 They are only needed if you use JPA because the annotations map them to things that a
framework does. Now we have our database object implementation, which actually contains
all the queries to the database.
00:15:30 Again in our Web... so what we don't have is this "persistence.xml" file because we don't
use EclipseLink, but what we still have is here our JNDI lookup for the "DefaultDB",
00:15:44 which means we will also use database mapping. So let's create the second server: "New",
"Server".
00:15:56 Then select again "SAP Cloud Platform", select "hanatrial.ondemand.com", then put in an
application name, "persistence2" for example,
00:16:08 select the runtime, for example "Java Web Tomcat 8", put in your subaccount name, user
name, and then click on "Finish" to create a new server.
00:16:19 Again, we switch to our cockpit... and there to "Databases & Schemas", to our "hana1"
database, to "Data Source Bindings",
00:16:31 and now we create a new data source binding for our new "persistence2" server. "Data
Source: <default>" again so that maps again, put in "SYSTEM" user, the password, and
save that again.
00:16:48 Now we have this mapping again, and as the second-to-last step we just need to add our
application to the server and then start the server.
00:16:59 So then here, under "Configured", just add the "persistence-with-jdbc" application, click on
"Finish", start your server, it will take a minute or two, and then the server is started with
your application.
00:17:14 So let's have a look at my applications, "persistence2", and here is now our implementation.
So it's "jdbc" and the application looks the same because it's the same servlet
implementation for the UI,
00:17:34 but actually, underneath something else is used to connect to the database. The database
is also empty because with this new database binding, a new schema is used in our
database.
00:17:44 So again, we can add my colleague "Rui"... and now he's in. The ID was also generated
automatically – that's in the code.
00:17:59 And we have a person in our database. Again, here we see the requests, CPU
consumption, the trace files, all those things.
00:18:10 We could do some monitoring but that's not needed now. So let's switch back to the slides.

00:18:17 Here, the defining data, we have our model, the "Person" object, we have our JNDI
resource lookup to the "DefaultDB", we have our database object that's specific to the JDBC
that performs the CRUD options,
00:18:34 so creating, removing, updating something in our database. And then here, one more thing
which we have with JDBC:
00:18:44 We have this data source lookup and then we create our database object that's in the
servlet implementation. Some tips and tricks if you do Java development and want to use,
for example, SAP HANA
00:18:59 or you want to use the persistence service on SAP Cloud Platform. EclipseLink already
includes a number of performance features that you can use so that this database
connection is efficient,
00:19:12 because if you write it the wrong way, it won't be efficient and your application might
encounter problems. So one thing is if you're using lists with JPA and if you don't use proper
memory safeguards there
00:19:29 and everything is retrieved from the database and loaded into your application, first it takes
a lot of time, and second it takes a lot of memory,

9
00:19:39 and if you don't have enough memory in your application server, then you will get an "out of
memory". So be careful of that.
00:19:46 Use the specific annotations to make that access efficient. Also, here – so download the
slides, you can click on that link – we have linked more resources on where you can find
useful information on
00:20:02 making your database access from your Java applications using JPA very efficient and very
good performance-wise. Some further reading again.
00:20:14 So what have we learned in this unit? We have learned how we can connect Java
applications to the persistence service,
00:20:23 mainly the SAP HANA service, but also the SAP ASE service – they both work exactly the
same. We have learned about JPA, which is suitable for most application scenarios.
00:20:36 We have also learned about JDBC, which is a bit more work but also gives us a bit more
control and might be needed for very specific scenarios as well.
00:20:46 With this, thanks a lot and see you in the next unit.

10
Week 3 Unit 4

00:00:07 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
4: "The Document Service", and that's exactly what we'll be talking about – we'll be talking
about our document service offering on SAP Cloud Platform.
00:00:23 So the SAP Cloud Platform Document service – what exactly is it and why would you like to
use It's an on-demand storage repository for unstructured or semi-structured content.
00:00:36 So you can store documents like PDF files there, but perhaps you might also like to store
them to a database.
00:00:44 Video or audio files which you don't want to store in a database because they are perhaps
too big – those you might like to store via this document service.
00:00:56 You have standards-based access via the CMIS protocol, which stands for Content
Management Interoperability Services. It's a standard protocol from OASIS, and it's also
provided via a client API.
00:01:14 There's an open-source library – OpenCMIS – provided by the Apache Chemistry project
that's already included in our SDK, in our runtimes, and you can use those to access our
document service.
00:01:28 Also, you can access our document service with any other library which is CMIS compliant –
that would also work. But that one is our recommend option and that's the easiest one.

00:01:42 So what are some of the features and how does it work? If you look on the right side, you
will see our setup.
00:01:48 So we have the document service running on SAP Cloud Platform, Then we have the API of
that where, via the CMIS protocol and the CMIS implementation,
00:02:01 your applications can then "speak" with the document service and you consume your apps
as usual via the Internet and then on your native device.
00:02:12 What are some of the features? You can store files, you can arrange them in folders and
hierarchies,
00:02:18 you can also retrieve them, it's pretty easy to consume, the setup is a high availability sort of
setup, which you would expect of a cloud service.
00:02:28 It's also multitenancy-enabled, so it's one big service from us that is running, and then each
customer gets a tenant of that service.
00:02:36 It also supports access control lists with which you can control access to the documents and
folders. You can also enrich your documents and folders with metadata and that kind of
thing.
00:02:51 And here we have also linked the tutorial, so download the PDF of the slides below. Click on
the link and then you are in our documentation where we have a tutorial on how to write a
sample application for that.
00:03:04 Again, like in the previous unit, we have already included the finished sample application in
the But before we dive in there, let's cover a bit about what some of the features are.
00:03:20 The CMIS standard gives certain functionality out of the box – if you support that, which we
do. So the control of files and folders – adding, creating, downloading, deleting, that kind of
thing.
00:03:33 You can put in metadata for your files and folders again, so who the author of the file is and
so on. Queries are written via CMISQL,
00:03:43 and you also have versioning, so you can have multiple versions of a file, and if you delete
something in the most recent file, then you save it and you shouldn't have done, you can go
back to previous versions.
00:03:56 You have permission handling via ACL, and also retention management. What we do now is
support a full CMIS standard,
00:04:04 and we are adding also some features of our own which we believe are necessary for us
and also for The most important thing there is for encryption – everything is AES-encrypted,

11
00:04:17 so everything you store in the document service is fully encrypted. You can also enable a
virus scan on upload, so when you upload something, we can perform a virus scan
00:04:30 to make sure that everything that's stored there is clean. The multitenancy concept which
we added for our service is also included,
00:04:39 as are a lifecycle for your repositories and backups to multiple locations for disaster
recovery and that kind of thing. With that, let's take a look at our tutorial and at the sample
provided with the SDK.
00:04:56 This here is the tutorial – just click on the link, then it will open. In our SDK, we again have
the project.
00:05:06 So let's first take a short look at the project and what's written in our documentation, then
let's switch over to our SDK and import that into Eclipse.
00:05:15 Here is some more explanation, but we've already covered that. So the next thing would be
here, the servlet which we have included,
00:05:28 which shows you a simple Web application that then interacts with the document service.
Here we see the sample application,
00:05:41 and also the ECM service – ECM stands for Enterprise Content Management – which is
retrieved here. So it's a JNDI lookup again – not for a database here, but for our service.
00:05:59 We also have a secret key that's in there to create a repository, because if you would like to
delete that repository at a later point in time, you would need that secret key.
00:06:13 So what else do we have here? Yep, here we also have... when a session is opened, you
store something in the database and so on and so forth.
00:06:23 Here, in the "WEB-INF" folder, in the "web.xml" file there, you also add your ECM service –
so your document service – as a resource, and then that service can be used in your
application.
00:06:42 Here are also some more links on the deployment and all that, so let's do that right now. So
we have a look at our SDK – we are here – then "document-store" is the name of the
application which we will be using now.
00:06:58 So let's go to our Eclipse, let's "Import", "Import...", and "Existing Projects into Workspace".
Let's select our "document-store" example, open that, and let's add that to my working set.

00:07:19 The working set stuff, you don't have to do that – I just do that because I'm working with a
lot of projects. Here the "Java Resources", here we have our servlet, and here we then have
the second servlet which does the storage.
00:07:38 Or two servlets, depending on where you are exactly and what you are doing. So that's it.
00:07:44 And then also in the "WebContent", "WEB-INF" folder, we have our "web.xml" file, and we
have here our ECM service, so the access to the document service, the document service
put in as a resource.
00:08:02 You can also import that as an Apache Maven project and build it locally and so on, but we
won't do it in this case. That's also explained in the documentation, so if you want to do so,
you just follow the tutorial in the documentation.
00:08:17 Now we will simply deploy that project to the cloud. So let's select the project, "Run As",
"Run on Server",
00:08:27 then manually define a new server, select "SAP Cloud Platform", select our
"hanatrial.ondemand.com" landscape,
00:08:38 then click on "Next", "Application name: documentstore" – that's fine for me. Runtime – I'm
just selecting "Java Web Tomcat
00:08:46 The subaccount name – here again, the subaccount name for me is this "p", then the
numbers, and "trial". If you are in your account, at the top right, next to the logout, you see
your user icon,
00:09:01 where you can find out your user name, which is then in here. And your subaccount name is
your user name plus this "trial" at the end, so just user name and then "trial",
00:09:15 and that's your subaccount name for the trial landscape of the Neo environment. Let's click
on "Next", "document-store" is added as the application.

12
00:09:26 Let's create the server, and now the server is created, the "document-store" is automatically
added to this server, and then the server is started.
00:09:38 So first the server is created, "document-store" is now added to the server in our Eclipse,
now it's publishing to the cloud, so it's publishing our application to the cloud, and then the
server is started.
00:09:55 Let's see that also in the cloud – so we have here our Java applications, and here this new
server which was created, the "documentstore". Now that server... first the application is
publishing, that's already done.
00:10:13 So now the server is starting, and while that is starting, let's have a look at the repositories,
and here we have "Document Repositories".
00:10:25 You can control your repositories for the document service via the cockpit – you will find
them under "Repositories" and then "Document Repositories".
00:10:35 Via the cockpit, you can also create a new repository. There you would have to put in your
repository
00:10:42 which is then needed to delete the repository again if you would like to do that at one point
or another. So what our application now does – let's see that in the code as well...
00:10:57 We had it... give me a second... we had it... "listRootFolder", "createFolderAndDoc", okay.
So here, when the function "createFolderAndDoc"... oh, it's already started – so that's the
application.
00:11:19 The application first and that servlet here, the "DocumentStoreServlet", displays just the
sentence. And now you can click on "Connect" to actually initialize the connection to the
document service.
00:11:38 And then here, in the "DocumentStoreConnectServlet", you then find here, in the
"createFolderAndDoc" method, the functions which are used to initialize your repository,
00:11:50 to create it, and then also to create a first document in there. And we also had it here, it's...
here... Here we also have the strings, the unique name, so "connectToEcm" in the
"connectToEcm" function.
00:12:10 We had a secret key, so it's just "abcdef" and then the numbers from 0 to 9. That's my
secret key in this simple scenario, and we don't need to protect it because it's just a demo
scenario.
00:12:23 And the repository is called "SampleRepository", so let's connect. And then this repository
should be created, also with that key,
00:12:33 and if you would like to delete the repository, then we would need to put in that key. So here
we now have the product name "SAP Cloud Platform Document Service",
00:12:44 the repository ID, our root folder ID, "The root folder (...) contains no objects", my folder with
the name "My Folder" was created, and then the document with the name "HelloWorld.txt"
was created.
00:12:59 Now let's just call that one more time, that service... ah, here we have it. So now, if we call
that servlet a second time, already it's displayed what's already in, and that's our root folder
and our "HelloWorld.txt" file.
00:13:22 The last thing, perhaps let's look at the created repository here in the cockpit. So this
sample repository was now created here, and if I wanted to delete that, I would need to put
in my repository key,
00:13:40 which, in the case of this sample application, would be this "abcdef0123456789". And with
this, let's go back to the slides.
00:13:55 Here we had it again, what we had in the "web.xml" file – that we had added our ECM
service as a resource. Then in our repository, when that was created, the code in the
function... the function was called... here: "connectToEcm".
00:14:15 And then we had our document service, the CMIS commands on how to interact with the
metadata, and also the lookup for the document service.

13
00:14:30 So you can manage your repositories – we saw that already in the cockpit – you can create
your repositories, and you can delete repositories. Now if you are in the Cloud Foundry
environment and you would still like to consume the document service running in the Neo
environment,
00:14:46 what you can currently do there is put in a proxy bridge, which is a simple application
running in the Neo environment with which you interact, and you can connect to that from
any application, be it in the Cloud Foundry environment,
00:14:59 or be it an application running on premise or somewhere else in the cloud. So you can also
use this proxy bridge to connect any external application to the document service.
00:15:12 Here are some more links, including the link to the tutorial again, also the link to the proxy
bridge, and to some videos of the SAP HANA Academy channel on YouTube.
00:15:22 So have fun there. So what have you learned in this unit?
00:15:27 You got to know the SAP Cloud Platform Document service, its features, and its capabilities.
You got to know a bit about the CMIS standard and then the edit functionality by SAP on
top.
00:15:39 And you got the sample scenario, and hopefully you also performed it hands-on, and you
got some experience of how to work with the document service on SAP Cloud Platform.
00:15:48 Thanks a lot and see you in the next unit.

14
Week 3 Unit 5

00:00:08 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
5: "Cloud Foundry Persistence". And that's exactly what we will be dealing with in this unit
and the next unit.
00:00:20 We will be dealing with persistence – so data and storage – for our Cloud Foundry
environment. In this unit, we will focus on SAP HANA as probably the main persistence
options on SAP Cloud Platform,
00:00:36 and in the next unit, we will then go into our open- source storage solutions. So SAP HANA
– it's an in-memory database.
00:00:46 We've already covered a lot about SAP HANA for the Neo environment earlier this week. So
now, what's it like in the Cloud Foundry environment?
00:00:57 In the Cloud Foundry environment, we directly have SAP HANA 2.0 as the version for the
database. And it's always an MDC-enabled database – so a multitenant database container,
which is what MDC stands for.
00:01:14 So you have one dedicated database for you as a customer, or multiples, but at least one.
And then you can create your own MDC tenants there, and for a database user it's
transparent if it's an MDC or if it's a full database.
00:01:35 So an MDC container is more or less a full virtual database. And what you then also do is
create instances of the database – so HDI containers – there and then you bind them to
your applications.
00:01:55 For trial accounts, as already seen in the applications week when we deployed SHINE,
there we only have shared HANA systems available.
00:02:07 So not your own dedicated HANA, not an MDC database, but shared HANAs, which you
can use via the hdi-shared service. So here, database systems, tenant databases which
you can create.
00:02:25 So let's go to one of my productive landscapes. There I have a HANA system running,
which is a 64 GB HANA system and it's currently under full load,
00:02:38 therefore also in warning state, but that won't bother us for now. Here... let me increase the
size a bit... I created one tenant database called "shine",
00:02:56 and in that tenant there, I'm currently doing a lot of work, so let's switch back the slides. You
also have some config parameters for your tenants if you want the DI server, DP server,
Script server enabled, disabled, and so on.
00:03:16 And you can also see your database there, your events for your database, and via the
database explorer and also via the HANA database cockpit,
00:03:27 you can monitor your database in a similar way to how you did it for the Neo environment.
Then applications – how do you handle them, how do you connect them to the database?
00:03:44 You do that – if you do it after development – by selecting an app, creating a service
binding, and then binding a service to the database.
00:03:56 Also some config parameters you need to put in there: the Service Type, the Service, the
Service Plan, that kind of thing. But when you use an MTA project, you put that in your
config files already,
00:04:11 and then when you deploy the application, all that is done automatically for you. Here, some
more on the service binding.
00:04:20 Here, just as one example, you create such service bindings for the MongoDB system in
exactly the same way. Also, one of the principles which we discussed last week when we
discussed application and the 12-factor principles
00:04:43 was to store environment-specific information directly in the environment, and not transport
that with the application. So if you have a DEV, TEST, and PROD system and you have
back ends which you connect to in each of those – you have different back ends –
00:05:01 then the connection to those back ends, the connection information, the credentials should
be stored in an environment variable, for example. They should not be stored in your
application and then transported,

15
00:05:14 but in your application, you should use, or connect to an environment variable which has
one name, and then in each of the environments, you have an environment variable with
that exact name,
00:05:29 which then has the credentials to connect to the different back-end systems which you are
using. You can also use the Cloud Foundry Command Line Interface to do the service
binding.
00:05:42 It works pretty much the same as in the cockpit. It depends on what you would rather use:
the command line or the cockpit.
00:05:54 What you can also do with your applications and so on is after you do a binding, you need
to stop and start an application, or better still, stop it before you do the binding, then do the
binding,
00:06:06 and then start it again so that the binding takes effect. You can also do that via the cockpit,
or you can do it via the command line.
00:06:18 So here we have our deployed SHINE applications, and if I now went here into the "shine-
web", which was the SHINE dashboard, the SHINE launchpad already,
00:06:30 I see here all the options that I have for restarting, for stopping, for adding a second
instance of that service, and so on and so forth. So before we go to the further reading, let's
perhaps – we saw it here in SHINE – go to...
00:06:54 here, that was the service binding which we had in... let's go back here, and then go to our
service instances. And you will see that here, under "shine- container", we have "Service",
"hanatrial", "Plan", "hdi-shared",
00:07:13 and we have bound three applications which are referencing that service instance. So now
how do you create such a service instance if you don't do it via the deployment of an MTA
project?
00:07:29 You do it – if you want to do it in the cockpit – by going to the service, and then you see
here "Instances", and via that... let's also increase the size here...
00:07:43 via that you can click on "New Instance", With trial accounts, the plan "hdi-shared" is also
the only plan available.
00:07:53 So here you click on "Next", you can specify parameters, and then you can already create a
binding to an application,
00:08:03 and then you can create a service instance. And this works for this "hanatrial" service – it
also works for productive HANA services, and it also works for a MongoDB service.
00:08:15 They're all the same. They are the principles which a Cloud Foundry has. The principles in
our Cloud Foundry environment
00:08:24 are the same as the principles in a Cloud Foundry environment you might use from a
different vendor. So here it's all the same.
00:08:34 What's different is, for example, our MTA projects here which enable very easy lifecycle
management. We developed those, and you only get those helpful projects and delivery
types to enable good lifecycle management on SAP Cloud Platform.
00:09:00 So with that, let's see what else we have here. Some further reading.
00:09:07 So how you can in general also consume the persistence service in the Cloud Foundry
environment, and also a tutorial on using HANA on Cloud Foundry.
00:09:19 But here, really, I suggest you do the SHINE deployment, which I hope you did last week. If
not, go back and have a look at Unit 6 of Week 2 where we deployed SHINE.
00:09:34 That's pretty interesting because it has a good JavaScript back end. It also has a front end,
and it has a database part.
00:09:44 So when we also look at the code here, we had the "mta.yaml" file, for example. If you
deploy an MTA project, that file is your deployment descriptor and is used to create all those
service instances.
00:10:04 So that is all specified here: How many megabytes of RAM each service should have, what
service bindings you have, what is required by what – all that is in here.

16
00:10:17 And also, when we go into the "core-db" parts here – we also saw it here in the
architecture... The "core-db" is the service, or the part of the application running your
database parts there.
00:10:36 An HDI container is also used to isolate that. For example, in a productive environment, you
could also have multiple different applications
00:10:46 with different HDI containers on the same HANA tenant, and the HDIs, so the SAP HANA
deployment infrastructures, would make sure that one container doesn't influence another
container,
00:10:59 so that you also have clear separation in the database. We have the parts for the "core-js",
for the
"user-js",
00:11:08 and for our front end either the SHINE launchpad or the SAP Fiori launchpad for SHINE,
depending on what you would like to use. And then the other back-end services like the
UAA, like the Job Scheduler, and also the SAP Cloud Platform Portal.
00:11:28 That's it for this unit – I hope you learned a bit. You learned how an SAP HANA database in
an enterprise account works,
00:11:38 that you get a dedicated system, and from that you can create your own MDC tenants. And
here usually like if you have a database with 64 GB, you would like to create perhaps two
tenants,
00:11:55 then each of those two tenants, the HANA also needs some memory to breathe, but then,
with a 64 GB system, two tenants would be fine, so it really depends.
00:12:07 In our documentation, we also have a lot more information on that. And in those tenants...
you can then use those tenants for your departments, for your development teams to deploy
your applications.
00:12:21 And also, if we go back again and look at this enterprise account here, you always have an
SAP HANA system in your space,
00:12:38 but you can also share that database system and also the tenants thereof with other spaces
in the same organization, so that's all possible here. And therefore, depending on the size of
the organization and the size of the projects you develop,
00:12:58 sometimes it definitely makes sense to have different subaccounts: a subaccount for DEV, a
subaccount for TEST, a subaccount for productive applications,
00:13:08 perhaps also for QA – a subaccount in between. And then usually to have a bigger
dedicated HANA system for you
00:13:18 and then to have different tenant databases: one for DEV, a second tenant database for
TEST, a third tenant database for PROD, and so on. You also saw how you can create a
service instance,
00:13:37 and then how to bind an application to your service instance, which I showed you in the
cockpit, but you can also use the command line interface to do those things if that's better
for you.
00:13:49 With that, we are at the end of this unit. Thanks a lot and see you in the next unit.

17
Week 3 Unit 6

00:00:07 Hello and welcome to the openSAP course "SAP Cloud Platform Essentials" – Week 3, Unit
6: "Cloud Foundry Persistence, Part II". And we'll continue where we left off, with Cloud
Foundry persistence – the backing services.
00:00:22 In the last unit, we looked at SAP HANA as a persistence option. Now we will look at all the
open-source persistence options which you have on
00:00:33 SAP Cloud Platform and the Cloud Foundry environment there. They are usually defined as
backing services, so you treat attached resources as backing services.
00:00:45 It's from 12-factor app principles, which we also covered last week. So what exactly are
those backing services?
00:00:54 They're everything that you use, like messaging services, for example RabbitMQ, which we
have, queuing and scheduling services, like the Job Scheduler,
00:01:04 Then everything that you use for mail, push notifications, and so on. Then connectivity
services – those as well, like the Cloud Connector and everything you do there.
00:01:15 And then all technical services attached to your application, which back your application –
databases, in-memory databases, non-in-memory databases, relational, NoSQL databases,
so all those things.
00:01:35 And what we have there is – as I said – backing services, and also one of the value-adds
from the Cloud Foundry environment is that we can bring in new capabilities.
00:01:51 As Cloud Foundry is standardized, it's easier to bring in open-source capabilities, and we
did that, for example, with RabbitMQ, with MongoDB, PostgreSQL, and Redis.
00:02:02 So four main options which have different use cases. If you go into your account and then
you open up your Service Marketplace in the space,
00:02:18 you see the services which are available, and the open-source services are MongoDB,
which is a NoSQL storage option, PostgreSQL, which is a relational database system,
RabbitMQ, which is a messaging queue, and Redis, an in-memory cache.
00:02:43 PostgreSQL, which I already mentioned, is a relational database, and it's definitely not as
fast as HANA but therefore it's also a bit cheaper. For certain scenarios, it makes sense to
use it – it really depends on the scenarios.
00:02:59 But for really huge-load scenarios where you want to store a lot of data, SAP HANA would
probably be the better option. MongoDB is a NoSQL storage for documents, for JSON files,
and that kind of thing.
00:03:17 SAP HANA now also supports document storage with text search and so on. So here it
really depends also on your use case whether it makes sense to rather use MongoDB.
00:03:28 But for many, especially advanced things you might like to do, SAP HANA would probably
be the option to go for. But if you already have some solutions using either of those
services,
00:03:41 you can bring those solutions very easily onto the platform by directly using those services.
Then Redis – an in-memory cache.
00:03:52 You really often use Redis and RabbitMQ in large- scale cloud-native applications. So you
have, for example, your SAP HANA system as a database to store all your database
content,
00:04:07 and then, to enable your application to be a cloud- native application, you need to make
these services stateless, okay? One way to do that is to store the state in a Redis in-
memory cache.
00:04:21 Also, if you have long-running batch processes, you need a queue to put the batch
processes into, and then you have worker services who process them.
00:04:29 There you often use RabbitMQ as the messaging service. ObjectStore for unstructured
data, for mass storage.
00:04:40 So rather cheap storage where you can store a lot of unstructured content, video files, and
so on. It's based on Amazon S3, which you might already be familiar with.

18
00:04:52 How do you use them? You use them by creating service instances. We already covered
how to do that in the last unit as well, where I showed it to you.
00:05:02 Now we will also do that for one scenario, where we will just use MongoDB and a sample
application of ours to do that. Here we have a lot of links where you can explore more,
00:05:17 but what I would suggest that you do now is download the PDF of the slides below and then
click on the link "Tutorials on CF backing services" and that will take you here.
00:05:30 So here, we have a lot of tutorials available which you can do, and these four are for our
open-source backing services.
00:05:40 Now we will just take the MongoDB tutorial, and that's it here. So it's probably best if you
just copy this part here without ".git",
00:05:53 paste it in your browser, and you will get to our Git repository where we store the sample
code for those four samples. The easiest option would be to just download the ZIP and then
you can deploy the application.
00:06:09 A bit more sophisticated is to use the GitHub desktop or any Git client to get the sources
and then you can work with the projects. So the first thing would be to get the source code –
okay, done that.
00:06:26 Now the second thing is to log in to your Cloud Foundry instance. So here we are – we are
already in the folder of the MongoDB sample.
00:06:43 So what I did here was simply download it to my "Downloads" and then here, this is our
MongoDB tutorial. So there we have that.
00:06:55 And "cf api" – we can see which URL is already And "cf api" and then we could type in the
needed API of our region.
00:07:09 For me, I want to deploy to Frankfurt, therefore that's the right one. In the documentation,
which we have linked here, you can see the different regions and hosts and find that
information.
00:07:23 So the next command would be "cf login". I need to put in my e-mail address.
00:07:31 And I need to put in my password. And then I'm in my account, I'm logged in, in my
organization, in my space, with my trial account.
00:07:54 So what's next there? Next, we need to create the service instance which I mentioned. So
first would be to check with "cf marketplace" whether this marketplace is available for my
space
00:08:11 because I also need the version here. MongoDB – it's still version v3.1-dev,
00:08:18 so I can just use this command here, and with that command, I create a service instance of
the MongoDB service.
00:08:33 Okay, so that's done. The next thing is to go into our MongoDB folder – I already did that
beforehand, I believe... yes, we are already in that.
00:08:43 So the next thing would be to do "mvn package". We are using Maven – it's also one of the
prerequisites here, that you have Maven installed.
00:08:53 If you don't have that yet, download Maven, add it to your PATH environment variable, and
then you can perform the command "mvn package". What that command does is scan your
projects and it does a Maven build for your project,
00:09:12 so downloading additional libraries which you have in your project, and then you have your
project. There is also a "manifest.yml" file where you can put in information for deployment,
which is then taken by the "cf push" command.
00:09:35 So here... if we go here... and then to here, this "manifest.yml" file... we see here the name
of the application, we see the memory that we put to it...
00:09:51 increase the size, yep... and then we see the "host", the "path", and then the "services". So
what's recommended here?
00:10:00 It might be that the host is already taken, so the host needs to be unique. And to ensure
that, I will just go to my account, here I will take my subaccount name, which is the "p" and
then those numbers,
00:10:17 and then I will just add that in the host, so my host is what was already in, and then I just
added my subaccount name, which for me is this "p", then the numbers, and then "trial".

19
00:10:35 Then I save that. And next – when the "mvn package" is also finished – I can push my
application to Cloud Foundry.
00:10:51 So let's check here – "BUILD SUCCESS", so we can do a "cf push"... and now our
application is pushed to Cloud Foundry.
00:11:05 It's the application build with Maven and... "Done uploading", okay. So let's go to our
account,
00:11:17 go to our "Applications" first, and there we will find our "mongodb-tutorial".
00:11:25 It's still not fully started but it's in process. Next, we can also check our "Service Instances",

00:11:34 and there we will find a service instance of MongoDB which we created with the command
line before. Under "Routes", we might also find a route – yeah, there we have one for our
mapped application, our "mongodb-tutorial".
00:11:56 So there we have our application running. In the cockpit we can open the service,
00:12:04 and then also click on that URL, and there we see it – we successfully accessed our
MongoDB service, and we retrieved the data object inserted in the test collection.
00:12:20 Okay, so with that, we successfully deployed a very simple application, accessing our
MongoDB service. And if you have some more time and you would also like to experiment
with the other services, you can do so.
00:12:36 Just follow the tutorials here and the sample code provided in GitHub. With that, we are at
the end of this unit.
00:12:48 What did we learn in this unit? At the beginning of the unit, we talked a bit about the 12-
factor app principles, and to treat attached resources as backing services, like storage
options, like a messaging service, like a Job Scheduler, and so on.
00:13:07 Also, we looked at the benefits of the Cloud Foundry environment with the open-source
backing services that we now also provide. And then we examined some of those options,
for example Redis and RabbitMQ,
00:13:22 which you oftentimes use for very scalable cloud- native applications. And then we also did
a deployment for one sample application using MongoDB,
00:13:32 where we created a service instance – that needs to be created first – and then you can
push your application and that is bound to your service instance.
00:13:41 Thanks a lot and see you in the next unit.

20
www.sap.com

© 2017 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://global12.sap.com/corporate-en/legal/copyright/index.epx 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 SE’s 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.