Quickly Build Spring Boot Apps to
Consume Public Cloud Services
Colin Stevenson - Pivotal Partner Architect, @cwsteve
Prasad Bopardikar - Pivotal Partner Architect, @PrasadB26
1
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Wait… this seems familiar
2
Thank you!
Microsoft and Google
Java and Service Broker Teams
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
We have service brokers!
4
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What’s in the box?
5
BigTable
BigQuery
Cloud SQL
Cloud Storage
Cloud Pub/Sub
Machine Learning
Spanner
StackDriver Debugger
StackDriver Trace
SQL DB
BLOB Storage
CosmosDB
Azure Redis Cache
Service Bus
Event Hubs
MySQL
PostgreSQL
RDS PostgreSQL
RDS MySQL
RDS SQL Server
RDS Oracle Database
RDS MariaDB
S3
Aurora
DynamoDB
SQS
EMR (coming soon)
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What about vendor lock in?
• Open Service Broker API to the rescue!
• Deploy the brokers to any Cloud Foundry deployment anywhere.
• Consider the benefits of managed cloud services.
• Do you really want to administer that highly available database?
• Don’t let Perfect be the enemy of Good
• No analysis paralysis!
6
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
We have service creds – now what?
7
Who has parsed VCAP Services
without Spring Boot?
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The “hard way”
1. Write code to read VCAP_SERVICES credentials from the environment
2. Add JSON dependencies and parse the VCAP_SERVICES JSON to extract
the credential values
3. Add the dependencies for the libraries provided by the service provider for the
type of service.
4. Write code to instantiate the appropriate beans. Examples:
• com.google.cloud.storage.Storage
• com.microsoft.azure.documentdb.DocumentClient
9
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Spring Boot to the Rescue!
10
Demo Time!
Spring Boot Starters Demo App
Azure Storage Container
App
Gateway
Pivotal Cloud Foundry
Demo App
GCP Storage Bucket
Upload image
Upload image to Azure storage
Upload image to GCP storage
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The “hard way”
1. Write code to read VCAP_SERVICES credentials from the environment
2. Add JSON dependencies and parse the VCAP_SERVICES JSON to extract
the credential values
3. Add the dependencies for the libraries provided by the service provider for the
type of service.
4. Write code to instantiate the appropriate beans. Examples:
• com.google.cloud.storage.Storage
• com.microsoft.azure.documentdb.DocumentClient
13
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
14
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Key Takeaways
• Use Spring Boot!!!
• Use the Service Brokers wherever you can – the Brokers
are evolving.
• If you are writing CF apps to consume Azure/GCP services,
use the Starters
15
Unless otherwise indicated, these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Resources
https://github.com/Microsoft/azure-spring-boot
https://github.com/spring-cloud/spring-cloud-gcp
https://seroter.wordpress.com/2017/11/02/trying-out-microsofts-spring-boot-
starters/
16
Learn More. Stay Connected.
Check out all the Starters, provide feedback!
17
#springone@s1p

Quickly Build Spring Boot Applications to Consume Public Cloud Services

  • 1.
    Quickly Build SpringBoot Apps to Consume Public Cloud Services Colin Stevenson - Pivotal Partner Architect, @cwsteve Prasad Bopardikar - Pivotal Partner Architect, @PrasadB26 1
  • 2.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Wait… this seems familiar 2
  • 3.
    Thank you! Microsoft andGoogle Java and Service Broker Teams
  • 4.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ We have service brokers! 4
  • 5.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What’s in the box? 5 BigTable BigQuery Cloud SQL Cloud Storage Cloud Pub/Sub Machine Learning Spanner StackDriver Debugger StackDriver Trace SQL DB BLOB Storage CosmosDB Azure Redis Cache Service Bus Event Hubs MySQL PostgreSQL RDS PostgreSQL RDS MySQL RDS SQL Server RDS Oracle Database RDS MariaDB S3 Aurora DynamoDB SQS EMR (coming soon)
  • 6.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What about vendor lock in? • Open Service Broker API to the rescue! • Deploy the brokers to any Cloud Foundry deployment anywhere. • Consider the benefits of managed cloud services. • Do you really want to administer that highly available database? • Don’t let Perfect be the enemy of Good • No analysis paralysis! 6
  • 7.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ We have service creds – now what? 7
  • 8.
    Who has parsedVCAP Services without Spring Boot?
  • 9.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The “hard way” 1. Write code to read VCAP_SERVICES credentials from the environment 2. Add JSON dependencies and parse the VCAP_SERVICES JSON to extract the credential values 3. Add the dependencies for the libraries provided by the service provider for the type of service. 4. Write code to instantiate the appropriate beans. Examples: • com.google.cloud.storage.Storage • com.microsoft.azure.documentdb.DocumentClient 9
  • 10.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot to the Rescue! 10
  • 11.
  • 12.
    Spring Boot StartersDemo App Azure Storage Container App Gateway Pivotal Cloud Foundry Demo App GCP Storage Bucket Upload image Upload image to Azure storage Upload image to GCP storage
  • 13.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The “hard way” 1. Write code to read VCAP_SERVICES credentials from the environment 2. Add JSON dependencies and parse the VCAP_SERVICES JSON to extract the credential values 3. Add the dependencies for the libraries provided by the service provider for the type of service. 4. Write code to instantiate the appropriate beans. Examples: • com.google.cloud.storage.Storage • com.microsoft.azure.documentdb.DocumentClient 13
  • 14.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 14
  • 15.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Key Takeaways • Use Spring Boot!!! • Use the Service Brokers wherever you can – the Brokers are evolving. • If you are writing CF apps to consume Azure/GCP services, use the Starters 15
  • 16.
    Unless otherwise indicated,these slides are © 2013 -2016 Piv otal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Resources https://github.com/Microsoft/azure-spring-boot https://github.com/spring-cloud/spring-cloud-gcp https://seroter.wordpress.com/2017/11/02/trying-out-microsofts-spring-boot- starters/ 16
  • 17.
    Learn More. StayConnected. Check out all the Starters, provide feedback! 17 #springone@s1p