2
@saturnism @gcpcloud
Ray Tsang
Developer Advocate
Google Cloud Platform
Java Champion
Spring Cloud GCP
cloud.spring.io/spring-cloud-gcp/
@saturnism saturnism.me
Slide 3
Slide 3 text
3
@saturnism @gcpcloud
Order
UI
PostgreSQL
Order
Service
CRUD
Slide 4
Slide 4 text
4
@saturnism @gcpcloud
Order
UI
PostgreSQL
Order
Service
CRUD
Where do you run this?
Slide 5
Slide 5 text
5
@saturnism @gcpcloud
Order
UI
PostgreSQL
Order
Service
CRUD
Zipkin RabbitMQ
Trace Data
Vault
Slide 6
Slide 6 text
6
@saturnism @gcpcloud
Order
UI
PostgreSQL
Order
Service
CRUD
Zipkin RabbitMQ
Publish Event
Vault
Slide 7
Slide 7 text
7
@saturnism @gcpcloud
Order
UI
PostgreSQL
Order
Service
CRUD
Zipkin RabbitMQ
Secrets
Vault
Slide 8
Slide 8 text
8
@saturnism @gcpcloud
Order
UI
MySQL
Order
Service
CRUD
Zipkin RabbitMQ
Zipkin
Zipkin
RabbitMQ
RabbitMQ
Publish Event
Trace Data
PostgreSQL
Vault
Vault
Vault
Secrets
Slide 9
Slide 9 text
9
@saturnism @gcpcloud
Order
UI
Cloud SQL
Order
Service
CRUD
Cloud Trace Pub/Sub
Publish Event
Trace Data
Secret Manager
Secrets
15
@saturnism @gcpcloud
Just search for "Spring Boot GCP"
https://github.com/spring-cloud/spring-cloud-gcp
https://spring.io/projects/spring-cloud-gcp
Collaboration between GCP and Spring engineers
Idiomatic integrations with Spring Boot for 10+ GCP services
+
Slide 16
Slide 16 text
16
@saturnism @gcpcloud
Feature GCP Service Spring Framework
Configuration Cloud Secret Manager Spring Cloud Config
Messaging Cloud Pub/Sub Spring Integration
Spring Cloud Stream
Spring Dataflow
Database Cloud SQL
Cloud Spanner
Cloud Firestore
Cloud Datastore
Spring Data JPA
Spring Data Spanner, r2dbc driver, Hibernate
Spring Data Reactive Firestore
Spring Data Datastore
Data Warehouse Cloud BigQuery Spring Integration
Storage Cloud Storage Spring Resource
Logging Stackdriver Logging Logback
Trace Stackdriver Trace Spring Cloud Sleuth
Metrics Stackdriver Monitoring Use Micrometer
Security Cloud Identity-Aware Proxy Spring Security
Vision Vision API Vision Starter
Slide 17
Slide 17 text
17
@saturnism @gcpcloud
@SpringBootApplication
class ExampleApplication {
@Bean fun restTemplate() = RestTemplate()
}
fun main(args: Array) {
runApplication(*args)
}
@RepositoryRestResource
interface PersonRepositiory : PagingAndSortingRepository
@Table
data class Person(
@PrimaryKey
var id: String? = null,
var name: String? = null
)
Slide 18
Slide 18 text
18
@saturnism @gcpcloud 18
Databases
Slide 19
Slide 19 text
19
@saturnism @gcpcloud
Bring your own Fully Managed Serverless
What? Install your own MySQL
Anything you want
Cloud SQL (MySQL,
PostgreSQL)
Cloud spanner
Firestore (NoSQL)
Datastore (NoSQL)
Where? Compute Engine VM
Kubernetes Container
We host it for you We host it for you
Billing? Compute resource Compute resource Usage
(Reads/Writes/Storage)
Slide 20
Slide 20 text
20
@saturnism @gcpcloud
Cloud SQL
MySQL, PostgreSQL, MS SQL
Multi-zone replication
Automatic Failover
Vertical Scaling
Up to 416 GB of RAM and 30 TB
Slide 21
Slide 21 text
21
@saturnism @gcpcloud
SELECT * FROM Order
WHERE done = FALSE AND priority >= 4
ORDER BY priority DESC
Each field is individually indexed
Manual composite index
=, >, >=, <, <=
No "Like" queries
Slide 22
Slide 22 text
22
@saturnism @gcpcloud
Datastore
Spring Data Integration
POJO + Annotation
Spring Data Repository
Declarative Transaction
Slide 23
Slide 23 text
23
@saturnism @gcpcloud
Spring Data
ORM Mapping for Spanner, Datastore, Firestore
No boilerplate code
Slide 24
Slide 24 text
24
@saturnism @gcpcloud
Spring Data
CRUD operations, Pagination, Sorting out of the box
Automatic Query generation, and custom queries
No boilerplate code
Slide 25
Slide 25 text
25
@saturnism @gcpcloud 25
Secret Manager
Slide 26
Slide 26 text
26
@saturnism @gcpcloud
Secret Manager
Secret Store
Multi-version
Fine-grained IAM
Audit Logging
Slide 27
Slide 27 text
27
@saturnism @gcpcloud
Spring Cloud Config with Secret Manager
Store credentials, configurations in Cloud Secret Manager
Reference values in properties or SpEL
No code
34
@saturnism @gcpcloud
Spring Integration
With Pub/Sub, BigQuery, Cloud Storage and more
Slide 35
Slide 35 text
35
@saturnism @gcpcloud 35
Storage
Slide 36
Slide 36 text
36
@saturnism @gcpcloud
Object store
No more "disk out of space"
Multi-regional, global availability
Tiered storage options
Encryption at rest
Cloud Storage
Slide 37
Slide 37 text
37
@saturnism @gcpcloud 37
Serverless Runtimes
Slide 38
Slide 38 text
38
@saturnism @gcpcloud
App Engine Cloud Run
Deploys Your application
A JAR!
Your application
A Container Image
Billing Instance Hours Billable time
Scaling 0 to N 0 to N
CPU Available when instance is up Available when request is being
processed