SlideShare a Scribd company logo
2023
Building Portable and Reliable
Applications on Google Cloud
李琦 Rich
Application Architect
• Microservices
• Event-driven
• Cloud Native App Development
• Kafka & Event-driven consultant
rich04230@gmail.com RICH0423 @rich04230
About Me
Agenda
Cloud Native Application
Application Development in Google Cloud
Dapr : Distributed Application Runtime
Application Resiliency Patterns
What is Cloud Native?
Cloud native is building software applications as a collection of
independent, loosely coupled, business-capability-oriented
services that can run on dynamic environments in an
automated, scalable, resilient, manageable, and
observable way.
<<Design Patterns for Cloud Native Applications>> Kasun Indrasiri and Sriskandarajah Suhothayan
Distributed Systems Communication
Service A
• Core functionality
• Retry / Timeout
• Logging
• Configuration
request
Service B
• Core functionality
• Retry / Timeout
• Logging
• Configuration
Distributed Systems Communication – Sidecar
Service A
• Core functionality
Service B
• Core functionality
• Retry / Timeout
• Logging
• Service Discovery
Sidecar
• Retry / Timeout
• Logging
• Service Discovery
Sidecar
Problems with Cloud Native Application
Any cloud or edge infrastructure
Application Code
Client SDK
GCP SDK AWS SDK AZURE SDK Spring
Application Code
Problems with Cloud Native Application
Any cloud or edge infrastructure
Client SDK
GCP SDK AWS SDK AZURE SDK Spring
Application
high coupled
Developing Applications with Google Cloud
# Imports the Google Cloud client library
from google.cloud import datastore
# Instantiates a client
datastore_client = datastore.Client()
# The kind for the new entity
kind = "Order"
name = "order1"
# The Cloud Datastore key for the new entity
order_key = datastore_client.key(kind, name)
order = datastore.Entity(key=order_key)
order["description"] = "Milk"
order["created"] = datetime.datetime.now()
# Saves the entity
datastore_client.put(order)
Application
google-cloud-storage==1.4.0
GCP SDK
{
"Name/ID":"order1",
"description":"Milk",
"created":"2023/07/29 14:00:00"
}
Cloud Firestore
Dapr
Dapr
Support any language
Provides over 70+ components
Dapr Architecture
My App
Pub/sub
Brokers
Bindings
& Triggers
Secret
Stores
Observability
Prometheus AppInsights Jaeger
Zipkin
State
Stores
Configuration
Distributed
Lock
Workflow
Dapr components
Swappable component model Service 2
Swappable component model Service 2
Swappable component model Service 2
Using Dapr and Firestore
DEMO
cloud-firestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orderstore
spec:
type: state.gcp.firestore
version: v1
metadata:
- name: type
value: service_account
- name: project_id
value: dascs-lab
- name: private_key_id
value:
486ec036cca569ecc151c4cd5aa17ba46fb
- name: client_email
value: sa@rich-
lab.iam.gserviceaccount.com
Developing Applications with Dapr
Application
key Field value
myapp||order1 description "Milk"
myapp||order1 created 2023/07/29
14:00:00
Cloud Firestore
<code>
Application Resiliency Patterns
Application Resiliency – Retry Pattern
Service A
• Core functionality
• Retry / Timeout
(Retries = 4, duration=2 sec)
request
Service B
• Core functionality
• Retry / Timeout
200
500
500
The Retry pattern enables a service to retry a failed request operation a
(configurable) number of times with an exponentially increasing wait time.
Application Resiliency – Circuit Breaker Pattern
Service A
• Core functionality
• Retry / Timeout
(Retries=4, duration=2 sec)
• Circuit Breaker
(failed count = 5, check = 30sec)
request
Service B
• Core functionality
• Retry / Timeout
The Circuit Breaker pattern can prevent an application from repeatedly trying
to execute an operation that's likely to fail. After a pre-defined number of failed
calls, it blocks all traffic to the service.
5
resiliency.yaml
apiVersion: dapr.io/v1alpha1
kind: Resiliency
metadata:
name: myresiliency
spec:
policies:
retries:
retryForever:
policy: constant
duration: 5s
maxRetries: -1
circuitBreakers:
simpleCB:
maxRequests: 1
timeout: 5s
trip: consecutiveFailures >= 5
• Resiliency patterns can be applied across
Dapr APIs
• Retries
• Timeouts
• Circuit breakers
• Declarative and decoupled from
application code
• Available across all component types,
service invocation and actors.
Dapr - Resiliency
State
Management
v2
Publish &
Subscribe
Secret
Management
Input
Binding
Output
Binding
Service
Invocation
Get
state
Retrieve secret
Publish
Subscribe
Trigger
Call
method
Get
config
Application
Configuration
resiliency
resiliency
resiliency
resiliency
resiliency
resiliency
resiliency
Dapr - Resiliency
Order
Processor
Checkout
Pub/sub queue
Inbound
Outbound
1
Outbound component resiliency
policies for `retries`, `timeouts and
`circuit breakers` can be applied to
message publishing
1
Additionally, many pub/sub
components have `retry` capabilities
built-in. The policies are configured
on a per component basis.
Resiliency in PubSub
1
Inbound component resiliency polices for
`retries`, `timeouts and `circuit breakers`
policies can be applied to subscriptions
when delivering messages
Key Takeaways
💪 Cloud Native Application on Google Cloud
💪 Decoupling from Cloud Provider/Infra with Dapr
💪 Resilience patterns and implement with Dapr

More Related Content

PDF
Developing scalable enterprise serverless applications on azure with .net
PDF
Cloud Native Apps
PPTX
Festive Tech Calendar 2022
PPTX
Microservices with Net Core 8 and Net Core 6
PDF
Azure-Migration-Presentation-Fresno-1-28-2020.pdf
PDF
Microsoft Azure For Solutions Architects
PDF
Cloud Native Application Development
PDF
Modernizing Testing as Apps Re-Architect
Developing scalable enterprise serverless applications on azure with .net
Cloud Native Apps
Festive Tech Calendar 2022
Microservices with Net Core 8 and Net Core 6
Azure-Migration-Presentation-Fresno-1-28-2020.pdf
Microsoft Azure For Solutions Architects
Cloud Native Application Development
Modernizing Testing as Apps Re-Architect

Similar to COSCUP 2023 Building Portable and Reliable Applications on Google Cloud (20)

PDF
DEVNET-1184 Microservices Patterns
PPTX
Disruptive Trends in Application Development
PPTX
Delivering SaaS Using IaaS - RightScale Compute 2013
PDF
apidays LIVE New York 2021 - API for multi-cloud management platform by Pawel...
PDF
Collaborative Line of Business Applications on IBM Bluemix
PDF
VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...
PDF
apidays LIVE Helsinki & North 2022_API for Multi-Cloud Management Platform
PPTX
Service Fabric – building tomorrows applications today
PDF
Azure Spring Cloud Workshop - June 17, 2020
PPTX
성공적인 서비스로의 플랫폼 선택
PPTX
Moorthy Dynamics 365 AX Technical Consultant and Microsoft Certified Trainer
PDF
RightScale Webinar: Get Your App To Azure
PDF
MicroServices-Part-1.pdf
PDF
Modern Software Architecture - Cloud Scale Computing
PDF
Cloud_Testing_The_future_of_softwareV1.04
PPTX
Performance Testing webinar
PPTX
Cloud Computing & Business Intelligence
PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
PPTX
Designing Microservices
PDF
GEN AI EDM -Generative AI: Beyond Chatbots, Shaping the Future
DEVNET-1184 Microservices Patterns
Disruptive Trends in Application Development
Delivering SaaS Using IaaS - RightScale Compute 2013
apidays LIVE New York 2021 - API for multi-cloud management platform by Pawel...
Collaborative Line of Business Applications on IBM Bluemix
VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...
apidays LIVE Helsinki & North 2022_API for Multi-Cloud Management Platform
Service Fabric – building tomorrows applications today
Azure Spring Cloud Workshop - June 17, 2020
성공적인 서비스로의 플랫폼 선택
Moorthy Dynamics 365 AX Technical Consultant and Microsoft Certified Trainer
RightScale Webinar: Get Your App To Azure
MicroServices-Part-1.pdf
Modern Software Architecture - Cloud Scale Computing
Cloud_Testing_The_future_of_softwareV1.04
Performance Testing webinar
Cloud Computing & Business Intelligence
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Designing Microservices
GEN AI EDM -Generative AI: Beyond Chatbots, Shaping the Future
Ad

More from Rich Lee (11)

PDF
2021 JCConf 使用Dapr簡化Java微服務應用開發
PDF
GDG Taipei 2020 - Cloud and On-premises Applications Integration Using Event-...
PDF
JCConf.tw 2020 - Building cloud-native applications with Quarkus
PDF
Redis Cache design
PDF
Couchbase & FTS
PPTX
Centralized log-management-with-elastic-stack
PDF
Microservice Architecture
PPTX
Apache Spark Introduction
PPTX
AWS IoT in action
PPTX
Realtime web development
PPTX
Event sourcing
2021 JCConf 使用Dapr簡化Java微服務應用開發
GDG Taipei 2020 - Cloud and On-premises Applications Integration Using Event-...
JCConf.tw 2020 - Building cloud-native applications with Quarkus
Redis Cache design
Couchbase & FTS
Centralized log-management-with-elastic-stack
Microservice Architecture
Apache Spark Introduction
AWS IoT in action
Realtime web development
Event sourcing
Ad

Recently uploaded (20)

PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
TLE Review Electricity (Electricity).pptx
Hindi spoken digit analysis for native and non-native speakers
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Unlocking AI with Model Context Protocol (MCP)
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Building Integrated photovoltaic BIPV_UPV.pdf
cloud_computing_Infrastucture_as_cloud_p
Web App vs Mobile App What Should You Build First.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
DP Operators-handbook-extract for the Mautical Institute
WOOl fibre morphology and structure.pdf for textiles
Encapsulation_ Review paper, used for researhc scholars
gpt5_lecture_notes_comprehensive_20250812015547.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Tartificialntelligence_presentation.pptx
A comparative study of natural language inference in Swahili using monolingua...
TLE Review Electricity (Electricity).pptx

COSCUP 2023 Building Portable and Reliable Applications on Google Cloud