@tegarimansyah
Walkthrough
Google Cloud Platform
GDG Cloud Surabaya #1 Meetup
Webinar, 11 April 2020
Tegar Imansyah
Software & IoT Enthusiast
About:
Software Architect at Alterra
Surabaya.py Organizer Advisor
Interested in IoT, Linux, Web
Spoke at PyCon Malaysia and PyCon Indonesia
Get in Touch:
github.com/tegarimansyah
t.me/tegarimansyah
linked.in/tegarimansyah
@tegarimansyah 2
@tegarimansyah
Agenda
● GCP at a glance
● Project ideation
● Approach to implement the idea
● How much? Free?
3
@tegarimansyah
Any Question? Put it in: https://sli.do
4
And enter event code: #91018
@tegarimansyah
What is Google Cloud Platform?
Google Cloud Platform (GCP), offered by
Google, is a suite of cloud computing services
that runs on the same infrastructure that
Google uses internally for its end-user
products, such as Google Search, Gmail and
YouTube.
Alongside a set of management tools, it
provides a series of modular cloud services
including computing, data storage, data
analytics and machine learning.
5Source: https://en.wikipedia.org/wiki/Google_Cloud_Platform
@tegarimansyah
Some GCP Services
6
https://cloud.google.com/products
@tegarimansyah
Sample Project: Cloud Recording
Think like SoundCloud, everyone can put their record and hear each other.
Features:
● It should use https
● It should handling user registration and login
● It should handling user upload and playback audio
● It should handling files storage
7
@tegarimansyah
Service We Will Use
8
Approach #1: Single VM
* I’m not saying this is the best design for this scenario
@tegarimansyah
Single VM
9
● It should use https → Google Compute Engine (NGINX + Let’s Encrypt) or Cloud
DNS + Load Balancer
● It should handling user registration and login → Google Compute Engine
(Our own app + Database) or Database Service (Cloud SQL or Firestore)
● It should handling user upload and playback audio → Google Compute
Engine (Our own app + Database) or Database Service (Cloud SQL or Firestore)
● It should handling files storage → Google Compute Engine (Our Own App
access to its storage) + Persistent Disk
@tegarimansyah
Pros and Cons
10
Pros
● Build like other IaaS or your own computer
● Great flexibility
● Always On
Cons
● Manage all by yourself
● Manual scale
@tegarimansyah
Service We Will Use
11
Approach #2: Serverless
* I’m not saying this is the best design for this scenario
@tegarimansyah
Serverless #1 App Engine
12
● It should use https → Google App Engine (Custom Domain)
● It should handling user registration and login → Identity Platform
● It should handling user upload and playback audio → Google App Engine
(Our own app) + Database Service (Firestore)
● It should handling files storage → Cloud Storage
Quickstart: https://cloud.google.com/appengine/docs/standard/python3/quickstart
@tegarimansyah
Pros and Cons
13
Pros
● Very fast for getting started -- only specify your app
● Automatic Scaling
● Able to scale down to 0 (Free if no request)
Cons
● Specific YAML setup
● Cold Start
● Only for specific language (Java, Python, PHP, Go, and Node.js)
@tegarimansyah
Serverless #2 Cloud Functions
14
● It should use https → Cloud Functions + API Management (Custom Domain)
● It should handling user registration and login → Identity Platform
● It should handling user upload and playback audio → Cloud Functions (Our
own app) + Database Service (Firestore)
● It should handling files storage → Cloud Storage
Quickstart: https://cloud.google.com/functions/docs/quickstart
@tegarimansyah
Pros and Cons
15
Pros
● Very fast for getting started -- only specify your function
● Automatic Scaling
● Able to scale down to 0 (Free if no request)
Cons
● Specific YAML setup
● Cold Start
● Only for specific language (Python, Go, and Node.js) and runtime
@tegarimansyah
Service We Will Use
16
Approach #3: Container Based
* I’m not saying this is the best design for this scenario
@tegarimansyah
Container Based
17
● It should use https → Cloud Run (Running Container with Knative) or Use
Google Kubernetes Engine
● It should handling user registration and login → Identity Platform
● It should handling user upload and playback audio → Cloud Run (Our own
app) + Database Service (Firestore)
● It should handling files storage → Cloud Storage
Quickstart: https://cloud.google.com/run/docs/quickstarts/build-and-deploy
@tegarimansyah
Pros and Cons
18
Pros
● Use our own dockerfile
● Integration with kubernetes cluster
● Able to scale down to 0 (Free if no request)
Cons
● Prior container (docker) knowledge required
● Only HTTP (80/443)
@tegarimansyah
Comparison
19
Task Compute
Engine
App Engine Function Run
Preparation Domain + DNS
Web Server
Runtime
App.yaml - Dockerfile
Code Full App Full App Function Full App
Deployment ssh gcloud app
deploy
gcloud functions
deploy ${fn_name}
--runtime python37
--trigger-http
gcloud builds submit --tag
gcr.io/${PROJECT}/{IMAGE}
gcloud run deploy
hello-broken --image
gcr.io/${PROJECT}/{IMAGE}
@tegarimansyah
Something Else We Should Consider
20
Operations
(Logging, Monitoring,
and Reporting, etc)
* Especially if our app going bigger
Networking
(VPC, Load Balancing,
DNS etc)
Data Analytics
(BigQuery, Data
Studio, etc)
Identity
(IAM, Secret
Manager, etc)
@tegarimansyah
I Want Free!
21
https://cloud.google.com/free
@tegarimansyah
I Want More Power! How Much I Need to Pay?
22
https://cloud.google.com/products/calculator
@tegarimansyah
Any Question? Put it in: https://sli.do
That’s All,
Let’s getting started https://cloud.google.com/gcp/getting-started
And enter event code: #91018
@tegarimansyah
Join us: https://www.meetup.com/GDG-Cloud-Surabaya/
Thank You!
Poke me https://t.me/tegarimansyah
This slide https://slideshare.com/tegarimansyah

Walkthrough google cloud platform

  • 1.
    @tegarimansyah Walkthrough Google Cloud Platform GDGCloud Surabaya #1 Meetup Webinar, 11 April 2020
  • 2.
    Tegar Imansyah Software &IoT Enthusiast About: Software Architect at Alterra Surabaya.py Organizer Advisor Interested in IoT, Linux, Web Spoke at PyCon Malaysia and PyCon Indonesia Get in Touch: github.com/tegarimansyah t.me/tegarimansyah linked.in/tegarimansyah @tegarimansyah 2
  • 3.
    @tegarimansyah Agenda ● GCP ata glance ● Project ideation ● Approach to implement the idea ● How much? Free? 3
  • 4.
    @tegarimansyah Any Question? Putit in: https://sli.do 4 And enter event code: #91018
  • 5.
    @tegarimansyah What is GoogleCloud Platform? Google Cloud Platform (GCP), offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail and YouTube. Alongside a set of management tools, it provides a series of modular cloud services including computing, data storage, data analytics and machine learning. 5Source: https://en.wikipedia.org/wiki/Google_Cloud_Platform
  • 6.
  • 7.
    @tegarimansyah Sample Project: CloudRecording Think like SoundCloud, everyone can put their record and hear each other. Features: ● It should use https ● It should handling user registration and login ● It should handling user upload and playback audio ● It should handling files storage 7
  • 8.
    @tegarimansyah Service We WillUse 8 Approach #1: Single VM * I’m not saying this is the best design for this scenario
  • 9.
    @tegarimansyah Single VM 9 ● Itshould use https → Google Compute Engine (NGINX + Let’s Encrypt) or Cloud DNS + Load Balancer ● It should handling user registration and login → Google Compute Engine (Our own app + Database) or Database Service (Cloud SQL or Firestore) ● It should handling user upload and playback audio → Google Compute Engine (Our own app + Database) or Database Service (Cloud SQL or Firestore) ● It should handling files storage → Google Compute Engine (Our Own App access to its storage) + Persistent Disk
  • 10.
    @tegarimansyah Pros and Cons 10 Pros ●Build like other IaaS or your own computer ● Great flexibility ● Always On Cons ● Manage all by yourself ● Manual scale
  • 11.
    @tegarimansyah Service We WillUse 11 Approach #2: Serverless * I’m not saying this is the best design for this scenario
  • 12.
    @tegarimansyah Serverless #1 AppEngine 12 ● It should use https → Google App Engine (Custom Domain) ● It should handling user registration and login → Identity Platform ● It should handling user upload and playback audio → Google App Engine (Our own app) + Database Service (Firestore) ● It should handling files storage → Cloud Storage Quickstart: https://cloud.google.com/appengine/docs/standard/python3/quickstart
  • 13.
    @tegarimansyah Pros and Cons 13 Pros ●Very fast for getting started -- only specify your app ● Automatic Scaling ● Able to scale down to 0 (Free if no request) Cons ● Specific YAML setup ● Cold Start ● Only for specific language (Java, Python, PHP, Go, and Node.js)
  • 14.
    @tegarimansyah Serverless #2 CloudFunctions 14 ● It should use https → Cloud Functions + API Management (Custom Domain) ● It should handling user registration and login → Identity Platform ● It should handling user upload and playback audio → Cloud Functions (Our own app) + Database Service (Firestore) ● It should handling files storage → Cloud Storage Quickstart: https://cloud.google.com/functions/docs/quickstart
  • 15.
    @tegarimansyah Pros and Cons 15 Pros ●Very fast for getting started -- only specify your function ● Automatic Scaling ● Able to scale down to 0 (Free if no request) Cons ● Specific YAML setup ● Cold Start ● Only for specific language (Python, Go, and Node.js) and runtime
  • 16.
    @tegarimansyah Service We WillUse 16 Approach #3: Container Based * I’m not saying this is the best design for this scenario
  • 17.
    @tegarimansyah Container Based 17 ● Itshould use https → Cloud Run (Running Container with Knative) or Use Google Kubernetes Engine ● It should handling user registration and login → Identity Platform ● It should handling user upload and playback audio → Cloud Run (Our own app) + Database Service (Firestore) ● It should handling files storage → Cloud Storage Quickstart: https://cloud.google.com/run/docs/quickstarts/build-and-deploy
  • 18.
    @tegarimansyah Pros and Cons 18 Pros ●Use our own dockerfile ● Integration with kubernetes cluster ● Able to scale down to 0 (Free if no request) Cons ● Prior container (docker) knowledge required ● Only HTTP (80/443)
  • 19.
    @tegarimansyah Comparison 19 Task Compute Engine App EngineFunction Run Preparation Domain + DNS Web Server Runtime App.yaml - Dockerfile Code Full App Full App Function Full App Deployment ssh gcloud app deploy gcloud functions deploy ${fn_name} --runtime python37 --trigger-http gcloud builds submit --tag gcr.io/${PROJECT}/{IMAGE} gcloud run deploy hello-broken --image gcr.io/${PROJECT}/{IMAGE}
  • 20.
    @tegarimansyah Something Else WeShould Consider 20 Operations (Logging, Monitoring, and Reporting, etc) * Especially if our app going bigger Networking (VPC, Load Balancing, DNS etc) Data Analytics (BigQuery, Data Studio, etc) Identity (IAM, Secret Manager, etc)
  • 21.
  • 22.
    @tegarimansyah I Want MorePower! How Much I Need to Pay? 22 https://cloud.google.com/products/calculator
  • 23.
    @tegarimansyah Any Question? Putit in: https://sli.do That’s All, Let’s getting started https://cloud.google.com/gcp/getting-started And enter event code: #91018
  • 24.
    @tegarimansyah Join us: https://www.meetup.com/GDG-Cloud-Surabaya/ ThankYou! Poke me https://t.me/tegarimansyah This slide https://slideshare.com/tegarimansyah